Files
jx-callback/controllers/temp_op.go
2019-01-10 23:46:59 +08:00

58 lines
2.5 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/initdata"
"git.rosy.net.cn/jx-callback/business/jxutils"
)
// @Title 将遗留JD订单合并
// @Description 将遗留JD订单合并
// @Param token header string true "认证token"
// @Param isAsync formData bool false "是否异步操作"
// @Param isContinueWhenError formData bool false "单个同步失败是否继续缺省false"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /TransferLegacyJdOrder [post]
func (c *InitDataController) TransferLegacyJdOrder() {
c.callTransferLegacyJdOrder(func(params *tInitdataTransferLegacyJdOrderParams) (retVal interface{}, errCode string, err error) {
retVal, err = initdata.TransferLegacyJdOrder(params.Ctx, params.IsAsync, params.IsContinueWhenError)
return retVal, "", err
})
}
// @Title 将遗留ELM订单合并
// @Description 将遗留ELM订单合并
// @Param token header string true "认证token"
// @Param isAsync formData bool false "是否异步操作"
// @Param isContinueWhenError formData bool false "单个同步失败是否继续缺省false"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /TransferLegacyElmOrder [post]
func (c *InitDataController) TransferLegacyElmOrder() {
c.callTransferLegacyElmOrder(func(params *tInitdataTransferLegacyElmOrderParams) (retVal interface{}, errCode string, err error) {
retVal, err = initdata.TransferLegacyElmOrder(params.Ctx, params.IsAsync, params.IsContinueWhenError)
return retVal, "", err
})
}
// @Title 拉取京东订单补齐本地
// @Description 拉取京东订单补齐本地
// @Param token header string true "认证token"
// @Param fromTime formData string true "开始时间"
// @Param toTime formData string true "结束时间"
// @Param isAsync formData bool false "是否异步操作"
// @Param isContinueWhenError formData bool false "单个同步失败是否继续缺省false"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /PullJdOrder [post]
func (c *InitDataController) PullJdOrder() {
c.callPullJdOrder(func(params *tInitdataPullJdOrderParams) (retVal interface{}, errCode string, err error) {
timeList, err := jxutils.BatchStr2Time(params.FromTime, params.ToTime)
if err != nil {
return retVal, "", err
}
retVal, err = initdata.PullJdOrder(params.Ctx, timeList[0], timeList[1], params.IsAsync, params.IsContinueWhenError)
return retVal, "", err
})
}