- RefreshAllStoresID
- RefreshAllSkusID - use new tasksch when possible(not use run directly).
This commit is contained in:
@@ -317,18 +317,3 @@ func (c *SkuController) SyncSku() {
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 重新刷新商家ID
|
||||
// @Description 重新刷新商家ID
|
||||
// @Param token header string true "认证token"
|
||||
// @Param nameID query int true "name ID, -1表示所有"
|
||||
// @Param skuID query int true "sku ID, -1表示所有"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /RefreshSkuIDs [put]
|
||||
func (c *SkuController) RefreshSkuIDs() {
|
||||
c.callRefreshSkuIDs(func(params *tSkuRefreshSkuIDsParams) (retVal interface{}, errCode string, err error) {
|
||||
err = cms.CurVendorSync.RefreshSkuIDs(params.Ctx, params.NameID, params.SkuID, params.Ctx.GetUserName())
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
55
controllers/cms_sync.go
Normal file
55
controllers/cms_sync.go
Normal file
@@ -0,0 +1,55 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
|
||||
"github.com/astaxie/beego"
|
||||
)
|
||||
|
||||
type SyncController struct {
|
||||
beego.Controller
|
||||
}
|
||||
|
||||
// @Title 查询长时间运行任务
|
||||
// @Description 查询长时间运行任务
|
||||
// @Param token header string true "认证token"
|
||||
// @Param vendorIDs query string true "需要刷新的厂商ID列表"
|
||||
// @Param isAsync query bool false "起始状态"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /RefreshAllStoresID [put]
|
||||
func (c *SyncController) RefreshAllStoresID() {
|
||||
c.callRefreshAllStoresID(func(params *tSyncRefreshAllStoresIDParams) (retVal interface{}, errCode string, err error) {
|
||||
var vendorIDs []int
|
||||
if err = utils.UnmarshalUseNumber([]byte(params.VendorIDs), &vendorIDs); err != nil {
|
||||
return retVal, "", err
|
||||
}
|
||||
retVal, err = cms.CurVendorSync.RefreshAllStoresID(params.Ctx, params.IsAsync, vendorIDs)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 重新刷新商家ID
|
||||
// @Description 重新刷新商家ID,单门店厂商必须指定storeIDs
|
||||
// @Param token header string true "认证token"
|
||||
// @Param vendorIDs query string true "需要刷新的厂商ID列表"
|
||||
// @Param storeIDs query string false "需要刷新的门店ID列表(对于单门店必须指定)"
|
||||
// @Param isAsync query bool false "起始状态"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /RefreshAllSkusID [put]
|
||||
func (c *SyncController) RefreshAllSkusID() {
|
||||
c.callRefreshAllSkusID(func(params *tSyncRefreshAllSkusIDParams) (retVal interface{}, errCode string, err error) {
|
||||
var vendorIDs, storeIDs []int
|
||||
if err = utils.UnmarshalUseNumber([]byte(params.VendorIDs), &vendorIDs); err != nil {
|
||||
return retVal, "", err
|
||||
}
|
||||
if params.StoreIDs != "" {
|
||||
if err = utils.UnmarshalUseNumber([]byte(params.StoreIDs), &storeIDs); err != nil {
|
||||
return retVal, "", err
|
||||
}
|
||||
}
|
||||
retVal, err = cms.CurVendorSync.RefreshAllSkusID(params.Ctx, params.IsAsync, vendorIDs, storeIDs)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user