Files
jx-callback/controllers/cms.go
2018-09-14 10:01:34 +08:00

38 lines
1.4 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package controllers
import (
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
"github.com/astaxie/beego"
)
type CmsController struct {
beego.Controller
}
// @Title 得到服务相关的一些基础信息
// @Description 得到服务相关的一些基础信息,包括版本,及一些元数据信息
// @Param token header string true "认证token"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetServiceInfo [get]
func (c *CmsController) GetServiceInfo() {
c.callGetServiceInfo(func(params *tCmsGetServiceInfoParams) (retVal interface{}, errCode string, err error) {
retVal = cms.GetServiceInfo()
return retVal, "", err
})
}
// @Title 得到七牛上传服务临时token
// @Description 得到七牛上传服务临时token当前设置为5分钟内有效。正常使用场景为每次上传资源前实时获取而不是保存下来一直使用
// @Param token header string true "认证token"
// @Param suffix query string true "门店所属的厂商ID"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetQiniuUploadToken [get]
func (c *CmsController) GetQiniuUploadToken() {
c.callGetQiniuUploadToken(func(params *tCmsGetQiniuUploadTokenParams) (retVal interface{}, errCode string, err error) {
retVal, err = cms.GetQiniuUploadToken(params.Suffix)
return retVal, "", err
})
}