修改门店评分相关

This commit is contained in:
Rosy-zhudan
2019-09-09 10:55:27 +08:00
parent b82327cefa
commit 4822f7741f
5 changed files with 75 additions and 54 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/jxstore/misc"
"git.rosy.net.cn/jx-callback/business/jxutils"
"git.rosy.net.cn/jx-callback/business/jxutils/netprinter"
"git.rosy.net.cn/jx-callback/business/model"
@@ -422,3 +423,36 @@ func (c *StoreController) SyncStoresQualify() {
return retVal, "", err
})
}
// @Title 门店评分
// @Description 门店评分
// @Param token header string true "认证token"
// @Param storeIDs formData string false "京西门店ID列表"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /ScoreStore [post]
func (c *StoreController) ScoreStore() {
c.callScoreStore(func(params *tStoreScoreStoreParams) (retVal interface{}, errCode string, err error) {
var storeIDList []int
if err = jxutils.Strings2Objs(params.StoreIDs, &storeIDList); err == nil {
misc.ScoreStore(params.Ctx, storeIDList)
}
return retVal, "", err
})
}
// @Title 得到门店周平均分数数据
// @Description 得到门店周平均分数数据
// @Param token header string true "认证token"
// @Param storeID query int true "京西门店ID"
// @Param weekIndex query int true "周索引(起始索引为0, -1为所有周数据)"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetWeeklyStoreScore [get]
func (c *StoreController) GetWeeklyStoreScore() {
c.callGetWeeklyStoreScore(func(params *tStoreGetWeeklyStoreScoreParams) (retVal interface{}, errCode string, err error) {
retVal, err = misc.GetWeeklyStoreScore(params.StoreID, params.WeekIndex)
return retVal, "", err
})
}

View File

@@ -316,37 +316,3 @@ func (c *TempOpController) CheckSkuDiffBetweenJxAndVendor() {
return retVal, "", err
})
}
// @Title 门店评分
// @Description 门店评分
// @Param token header string true "认证token"
// @Param storeIDs formData string false "京西门店ID列表"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /ScoreStore [post]
func (c *TempOpController) ScoreStore() {
c.callScoreStore(func(params *tTempopScoreStoreParams) (retVal interface{}, errCode string, err error) {
var storeIDList []int
if err = jxutils.Strings2Objs(params.StoreIDs, &storeIDList); err == nil {
misc.ScoreStore(params.Ctx, storeIDList)
}
return retVal, "", err
})
}
// @Title 得到门店周平均分数数据
// @Description 得到门店周平均分数数据
// @Param token header string true "认证token"
// @Param storeID query int true "京西门店ID"
// @Param weekIndex query int true "周索引(起始索引为0, -1为所有周数据)"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetWeeklyStoreScore [get]
func (c *TempOpController) GetWeeklyStoreScore() {
c.callGetWeeklyStoreScore(func(params *tTempopGetWeeklyStoreScoreParams) (retVal interface{}, errCode string, err error) {
retVal, err = misc.GetWeeklyStoreScore(params.StoreID, params.WeekIndex)
return retVal, "", err
})
}