qiniu roken
This commit is contained in:
@@ -2,6 +2,7 @@ package controllers
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/datares"
|
||||
"github.com/astaxie/beego"
|
||||
)
|
||||
|
||||
@@ -71,3 +72,18 @@ func (c *CmsController) QueryConfigs() {
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 得到七牛上传服务临时token
|
||||
// @Description 得到七牛上传服务临时token,当前设置为5分钟内有效。正常使用场景为每次上传资源前实时获取,而不是保存下来一直使用,如果hashCode有值,且本地有,可能直接返回URL
|
||||
// @Param token header string true "认证token"
|
||||
// @Param suffix query string true "前缀"
|
||||
// @Param hashCode query string false "图片hash"
|
||||
// @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 = datares.GetQiniuUploadToken(params.Ctx, params.Suffix, params.HashCode)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user