update app

This commit is contained in:
wangchuxiao
2022-05-10 12:30:00 +08:00
parent 872f70a418
commit 7be5208daf
4 changed files with 21 additions and 13 deletions
+2
View File
@@ -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 {