feat: 新增禾圃集应用版本更新管理功能
新增禾圃集应用(appCode=garden)的版本策略管理功能,包括后端接口、前端API、页面路由、数据库迁移及相关常量配置,支持对不同平台和渠道的版本策略进行增删改查操作,与现有讯工捷使(appCode=im)版本管理功能保持一致的架构和交互逻辑。
This commit is contained in:
@@ -16,13 +16,18 @@ import (
|
||||
|
||||
type ImAppReleaseListInp struct {
|
||||
form.PageReq
|
||||
AppCode string `json:"appCode" dc:"应用标识"`
|
||||
Platform string `json:"platform" dc:"平台"`
|
||||
Channel string `json:"channel" dc:"渠道"`
|
||||
}
|
||||
|
||||
func (in *ImAppReleaseListInp) Filter(ctx context.Context) (err error) {
|
||||
in.AppCode = strings.TrimSpace(in.AppCode)
|
||||
in.Platform = strings.TrimSpace(in.Platform)
|
||||
in.Channel = strings.TrimSpace(in.Channel)
|
||||
if in.AppCode != "" && !dict.HasOptionKey(consts.ImAppCodeOptions, in.AppCode) {
|
||||
return gerror.New("应用标识不合法")
|
||||
}
|
||||
if in.Platform != "" && !dict.HasOptionKey(consts.ImAppPlatformOptions, in.Platform) {
|
||||
return gerror.New("客户端平台不合法")
|
||||
}
|
||||
@@ -31,6 +36,7 @@ func (in *ImAppReleaseListInp) Filter(ctx context.Context) (err error) {
|
||||
|
||||
type ImAppReleaseModel struct {
|
||||
Id int64 `json:"id" dc:"ID"`
|
||||
AppCode string `json:"appCode" dc:"应用标识"`
|
||||
Platform string `json:"platform" dc:"平台"`
|
||||
Channel string `json:"channel" dc:"渠道"`
|
||||
LatestVersion string `json:"latestVersion" dc:"最新版本"`
|
||||
@@ -48,6 +54,7 @@ type ImAppReleaseModel struct {
|
||||
|
||||
type ImAppReleaseEditInp struct {
|
||||
Id int64 `json:"id" dc:"ID"`
|
||||
AppCode string `json:"appCode" dc:"应用标识"`
|
||||
Platform string `json:"platform" v:"required#平台不能为空" dc:"平台"`
|
||||
Channel string `json:"channel" v:"required#渠道不能为空" dc:"渠道"`
|
||||
LatestVersion string `json:"latestVersion" v:"required#最新版本不能为空" dc:"最新版本"`
|
||||
@@ -61,6 +68,7 @@ type ImAppReleaseEditInp struct {
|
||||
}
|
||||
|
||||
func (in *ImAppReleaseEditInp) Filter(ctx context.Context) (err error) {
|
||||
in.AppCode = strings.TrimSpace(in.AppCode)
|
||||
in.Platform = strings.TrimSpace(in.Platform)
|
||||
in.Channel = strings.TrimSpace(in.Channel)
|
||||
in.LatestVersion = strings.TrimSpace(in.LatestVersion)
|
||||
@@ -69,6 +77,12 @@ func (in *ImAppReleaseEditInp) Filter(ctx context.Context) (err error) {
|
||||
in.StoreUrl = strings.TrimSpace(in.StoreUrl)
|
||||
in.PackageUrl = strings.TrimSpace(in.PackageUrl)
|
||||
in.Checksum = strings.TrimSpace(in.Checksum)
|
||||
if in.AppCode == "" {
|
||||
in.AppCode = consts.ImAppCodeIm
|
||||
}
|
||||
if !dict.HasOptionKey(consts.ImAppCodeOptions, in.AppCode) {
|
||||
return gerror.New("应用标识不合法")
|
||||
}
|
||||
if !dict.HasOptionKey(consts.ImAppPlatformOptions, in.Platform) {
|
||||
return gerror.New("客户端平台不合法")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user