mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-04-28 14:29:19 +08:00
update app
This commit is contained in:
@@ -33,6 +33,7 @@ type UploadUpdateAppReq struct {
|
||||
File *multipart.FileHeader `form:"file" binding:"required"`
|
||||
Yaml *multipart.FileHeader `form:"yaml"`
|
||||
ForceUpdate bool `form:"forceUpdate"`
|
||||
UpdateLog string `form:"updateLog" binding:"update_log"`
|
||||
}
|
||||
|
||||
type UploadUpdateAppResp struct {
|
||||
@@ -52,5 +53,7 @@ type GetDownloadURLResp struct {
|
||||
ForceUpdate bool `json:"forceUpdate"`
|
||||
FileURL string `json:"fileURL"`
|
||||
YamlURL string `json:"yamlURL"`
|
||||
Version string `json:"version"`
|
||||
UpdateLog string `json:"update_log"`
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
@@ -280,6 +280,7 @@ type AppVersion struct {
|
||||
ForceUpdate bool `gorm:"column:force_update" json:"force_update"`
|
||||
FileName string `gorm:"column:file_name" json:"file_name"`
|
||||
YamlName string `gorm:"column:yaml_name" json:"yaml_name"`
|
||||
UpdateLog string `gorm:"column:update_log" json:"update_log"`
|
||||
}
|
||||
|
||||
func (AppVersion) TableName() string {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
func UpdateAppVersion(appType int, version string, forceUpdate bool, fileName, yamlName string) error {
|
||||
func UpdateAppVersion(appType int, version string, forceUpdate bool, fileName, yamlName, updateLog string) error {
|
||||
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -18,9 +18,10 @@ func UpdateAppVersion(appType int, version string, forceUpdate bool, fileName, y
|
||||
FileName: fileName,
|
||||
YamlName: yamlName,
|
||||
ForceUpdate: forceUpdate,
|
||||
UpdateLog: updateLog,
|
||||
}
|
||||
result := dbConn.Model(db.AppVersion{}).Where("type = ?", appType).Update(map[string]interface{}{"force_update": forceUpdate,
|
||||
"version": version, "update_time": int(time.Now().Unix()), "file_name": fileName, "yaml_name": yamlName, "type": appType})
|
||||
"version": version, "update_time": int(time.Now().Unix()), "file_name": fileName, "yaml_name": yamlName, "type": appType, "update_log": updateLog})
|
||||
if result.Error != nil {
|
||||
return result.Error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user