- make defsch.time2Schedule3rdCarrier configable.

This commit is contained in:
gazebo
2018-12-10 11:00:21 +08:00
parent 6e91ada15a
commit ad763b290b
7 changed files with 171 additions and 8 deletions

View File

@@ -3,6 +3,7 @@ package controllers
import (
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
"git.rosy.net.cn/jx-callback/business/jxutils/configindb"
"github.com/astaxie/beego"
)
@@ -103,3 +104,32 @@ func (c *CmsController) GetCoordinateDistrictCode() {
return retVal, "", err
})
}
// @Title 得到配置参数
// @Description 得到配置参数
// @Param token header string true "认证token"
// @Param key query string true "参数名"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetConfig [get]
func (c *CmsController) GetConfig() {
c.callGetConfig(func(params *tCmsGetConfigParams) (retVal interface{}, errCode string, err error) {
retVal, err = configindb.GetConfig(params.Key, "")
return retVal, "", err
})
}
// @Title 设置配置参数
// @Description 设置配置参数
// @Param token header string true "认证token"
// @Param key query string true "参数名"
// @Param value query string true "参数值"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /SetConfig [put]
func (c *CmsController) SetConfig() {
c.callSetConfig(func(params *tCmsSetConfigParams) (retVal interface{}, errCode string, err error) {
retVal, err = configindb.SetConfig(params.Ctx, params.Key, params.Value)
return retVal, "", err
})
}