feat: 新增禾圃集应用版本更新管理功能
新增禾圃集应用(appCode=garden)的版本策略管理功能,包括后端接口、前端API、页面路由、数据库迁移及相关常量配置,支持对不同平台和渠道的版本策略进行增删改查操作,与现有讯工捷使(appCode=im)版本管理功能保持一致的架构和交互逻辑。
This commit is contained in:
@@ -468,8 +468,15 @@ func (c *cConfig) TenantLoginIPWhitelist(ctx context.Context, req *api.TenantLog
|
||||
}
|
||||
|
||||
func (c *cConfig) AppReleaseLatest(ctx context.Context, req *api.AppReleaseLatestReq) (res *api.AppReleaseLatestRes, err error) {
|
||||
appCode := strings.ToLower(strings.TrimSpace(req.AppCode))
|
||||
platform := strings.ToLower(strings.TrimSpace(req.Platform))
|
||||
channel := strings.ToLower(strings.TrimSpace(req.Channel))
|
||||
if appCode == "" {
|
||||
appCode = "im"
|
||||
}
|
||||
if appCode != "im" && appCode != "garden" {
|
||||
return nil, gerror.New("应用标识不合法")
|
||||
}
|
||||
if platform != "ios" && platform != "android" {
|
||||
return nil, gerror.New("客户端平台不合法")
|
||||
}
|
||||
@@ -481,6 +488,7 @@ func (c *cConfig) AppReleaseLatest(ctx context.Context, req *api.AppReleaseLates
|
||||
}
|
||||
var row struct {
|
||||
ID int64 `json:"id"`
|
||||
AppCode string `json:"app_code"`
|
||||
Platform string `json:"platform"`
|
||||
Channel string `json:"channel"`
|
||||
LatestVersion string `json:"latest_version"`
|
||||
@@ -496,6 +504,7 @@ func (c *cConfig) AppReleaseLatest(ctx context.Context, req *api.AppReleaseLates
|
||||
UpdatedAt *gtime.Time `json:"updated_at"`
|
||||
}
|
||||
err = imtenant.RegistryDB().Model("im_app_releases").Safe().Ctx(ctx).
|
||||
Where("app_code", appCode).
|
||||
Where("platform", platform).Where("channel", channel).Limit(1).Scan(&row)
|
||||
if err != nil {
|
||||
return nil, gerror.Wrap(err, "获取IM客户端版本策略失败")
|
||||
@@ -504,7 +513,7 @@ func (c *cConfig) AppReleaseLatest(ctx context.Context, req *api.AppReleaseLates
|
||||
return nil, gerror.New("IM客户端版本策略不存在")
|
||||
}
|
||||
return &api.AppReleaseLatestRes{
|
||||
ID: row.ID, Platform: row.Platform, Channel: row.Channel,
|
||||
ID: row.ID, AppCode: row.AppCode, Platform: row.Platform, Channel: row.Channel,
|
||||
LatestVersion: row.LatestVersion, MinSupportedVersion: row.MinSupportedVersion,
|
||||
UpdateType: row.UpdateType, ReleaseNotes: row.ReleaseNotes, StoreURL: row.StoreURL,
|
||||
PackageURL: row.PackageURL, Checksum: row.Checksum, RemindAfterSeconds: row.RemindAfterSeconds,
|
||||
|
||||
Reference in New Issue
Block a user