55 lines
2.0 KiB
Go
55 lines
2.0 KiB
Go
package controllers
|
|
|
|
import (
|
|
"git.rosy.net.cn/jx-callback/business/app_version"
|
|
"github.com/astaxie/beego/server/web"
|
|
)
|
|
|
|
type VersionController struct {
|
|
web.Controller
|
|
}
|
|
|
|
// @Title 添加小程序的版本控制
|
|
// @Description 添加小程序的版本控制
|
|
// @Param token header string true "认证token"
|
|
// @Param appId query string true "小程序id"
|
|
// @Param version query string true "小程序版本"
|
|
// @Success 200 {object} controllers.CallResult
|
|
// @Failure 200 {object} controllers.CallResult
|
|
// @router /AddVersionController [post]
|
|
func (c *VersionController) AddVersionController() {
|
|
c.callAddVersionController(func(params *tVersionAddVersionControllerParams) (interface{}, string, error) {
|
|
err := app_version.AddApplicationVersion(params.Ctx.GetUserName(), params.AppId, params.Version)
|
|
return nil, "", err
|
|
})
|
|
}
|
|
|
|
// @Title 修改小程序的版本控制
|
|
// @Description 修改小程序的版本控制
|
|
// @Param token header string true "认证token"
|
|
// @Param appId query string true "小程序id"
|
|
// @Param version query string true "小程序版本"
|
|
// @Success 200 {object} controllers.CallResult
|
|
// @Failure 200 {object} controllers.CallResult
|
|
// @router /UpdateVersionController [post]
|
|
func (c *VersionController) UpdateVersionController() {
|
|
c.callUpdateVersionController(func(params *tVersionUpdateVersionControllerParams) (interface{}, string, error) {
|
|
err := app_version.UpdateApplicationVersion(params.AppId, params.Version)
|
|
return nil, "", err
|
|
})
|
|
}
|
|
|
|
// @Title 获取版本控制
|
|
// @Description 获取版本控制
|
|
// @Param token header string false "认证token"
|
|
// @Param appId query string false "小程序id"
|
|
// @Success 200 {object} controllers.CallResult
|
|
// @Failure 200 {object} controllers.CallResult
|
|
// @router /GetVersionController [get]
|
|
func (c *VersionController) GetVersionController() {
|
|
c.callGetVersionController(func(params *tVersionGetVersionControllerParams) (interface{}, string, error) {
|
|
configs, err := app_version.GetApplicationVersion(params.AppId)
|
|
return configs, "", err
|
|
})
|
|
}
|