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, "")
}