This commit is contained in:
邹宗楠
2023-02-02 18:30:54 +08:00
parent f032189688
commit 616102db91
6 changed files with 118 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
package app_version
import (
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/model"
"git.rosy.net.cn/jx-callback/business/model/dao"
)
// AddApplicationVersion 添加app版本控制
func AddApplicationVersion(userName, appId, version string) error {
config := &model.NewConfig{
Type: model.ConfigTypeApplication,
Key: appId,
Value: version,
}
dao.WrapAddIDCULDEntity(config, userName)
return dao.CreateEntity(dao.GetDB(), config)
}
// UpdateApplicationVersion 修改app版本
func UpdateApplicationVersion(appId, version string) error {
sql := ` UPDATE new_config c SET c.value = ? WHERE c.key = ? AND c.deleted_at = ? `
param := []interface{}{version, appId, utils.DefaultTimeValue}
_, err := dao.ExecuteSQL(dao.GetDB(), sql, param...)
return err
}
// GetApplicationVersion 查询小程序版本控制
func GetApplicationVersion(appId string) ([]*model.NewConfig, error) {
return dao.QueryConfigs(dao.GetDB(), appId, model.ConfigTypeApplication, "")
}

View File

@@ -68,7 +68,7 @@ type ModelIDCULD struct {
ID int `orm:"column(id)" json:"id"`
CreatedAt time.Time `orm:"auto_now_add;type(datetime)" json:"createdAt"`
UpdatedAt time.Time `orm:"auto_now;type(datetime)" json:"updatedAt"`
LastOperator string `orm:"size(32)" json:"lastOperator"` // 最后操作员
LastOperator string `orm:"size(32)" json:"lastOperator"` // 最后操作员1
DeletedAt time.Time `orm:"type(datetime);null" json:"deletedAt"`
}

View File

@@ -10,6 +10,7 @@ const (
ConfigTypeCookie = "Cookie"
ConfigTypeDiscountCard = "DiscountCard"
ConfigTypeReply = "Reply"
ConfigTypeApplication = "App"
)
const (