- add optional params fromTime and toTime for TmpGetJxBadCommentsByStoreId

This commit is contained in:
gazebo
2019-02-19 16:36:31 +08:00
parent c18a522132
commit c0d659e300
7 changed files with 134 additions and 9 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"
"git.rosy.net.cn/jx-callback/business/model"
"github.com/astaxie/beego"
)
@@ -207,12 +208,17 @@ func (c *StoreController) TmpGetJxBadCommentsNo() {
// @Param type query int true "评论类型0差评1所有"
// @Param page query int true "起始页从1开始"
// @Param size query int true "页大小"
// @Param fromTime query string false "创建起始时间"
// @Param toTime query string false "创建结束时间"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /TmpGetJxBadCommentsByStoreId [get]
func (c *StoreController) TmpGetJxBadCommentsByStoreId() {
c.callTmpGetJxBadCommentsByStoreId(func(params *tStoreTmpGetJxBadCommentsByStoreIdParams) (retVal interface{}, errCode string, err error) {
retVal, err = cms.TmpGetJxBadCommentsByStoreId(params.Ctx, params.JxStoreId, params.Page, params.Size, params.Type)
timeList, err2 := jxutils.BatchStr2Time(params.FromTime, params.ToTime)
if err = err2; err == nil {
retVal, err = cms.TmpGetJxBadCommentsByStoreId(params.Ctx, params.JxStoreId, (params.Page-1)*params.Size, params.Size, params.Type, timeList[0], timeList[1])
}
return retVal, "", err
})
}

View File

@@ -127,3 +127,19 @@ func (c *InitDataController) TransformJdSpu2Sku() {
return retVal, "", err
})
}
// @Title 重新处理京东差评
// @Description 重新处理京东差评
// @Param token header string true "认证token"
// @Param isForce formData bool false "是否强制处理"
// @Param isAsync formData bool false "是否异步操作"
// @Param isContinueWhenError formData bool false "单个同步失败是否继续缺省false"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /ReProcessJdBadComment [post]
func (c *InitDataController) ReProcessJdBadComment() {
c.callReProcessJdBadComment(func(params *tInitdataReProcessJdBadCommentParams) (retVal interface{}, errCode string, err error) {
retVal, err = tempop.ReProcessJdBadComment(params.Ctx, params.IsForce, params.IsAsync, params.IsContinueWhenError)
return retVal, "", err
})
}