73 lines
3.2 KiB
Go
73 lines
3.2 KiB
Go
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
|
||
})
|
||
}
|
||
|
||
// @Title 删除错误创建的SPU
|
||
// @Description 删除错误创建的SPU
|
||
// @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 /DeleteWrongSpu [delete]
|
||
func (c *InitDataController) DeleteWrongSpu() {
|
||
c.callDeleteWrongSpu(func(params *tInitdataDeleteWrongSpuParams) (retVal interface{}, errCode string, err error) {
|
||
retVal, err = initdata.DeleteWrongSpu(params.Ctx, params.IsAsync, params.IsContinueWhenError)
|
||
return retVal, "", err
|
||
})
|
||
}
|