mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-07 18:45:58 +08:00
update app
This commit is contained in:
@@ -278,6 +278,8 @@ type AppVersion struct {
|
||||
Type int `gorm:"column:type;primary_key"`
|
||||
UpdateTime int `gorm:"column:update_time"`
|
||||
ForceUpdate bool `gorm:"column:force_update"`
|
||||
FileName string `gorm:"column:file_name"`
|
||||
YamlName string `gorm:"column:yaml_name"`
|
||||
}
|
||||
|
||||
func (AppVersion) TableName() string {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
func UpdateAppVersion(appType int, version string, forceUpdate bool) error {
|
||||
func UpdateAppVersion(appType int, version string, forceUpdate bool, fileName, yamlName string) error {
|
||||
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -15,6 +15,8 @@ func UpdateAppVersion(appType int, version string, forceUpdate bool) error {
|
||||
Type: appType,
|
||||
UpdateTime: int(time.Now().Unix()),
|
||||
ForceUpdate: forceUpdate,
|
||||
FileName: fileName,
|
||||
YamlName: yamlName,
|
||||
}
|
||||
result := dbConn.Model(db.AppVersion{}).Where("app_type = ?", appType).Updates(&app)
|
||||
if result.Error != nil {
|
||||
|
||||
Reference in New Issue
Block a user