- new config param:EnableEbaiStoreWrite
This commit is contained in:
@@ -67,9 +67,13 @@ func (p *PurchaseHandler) CreateStore(db *dao.DaoDB, storeID int, userName strin
|
||||
params["category1"] = ""
|
||||
params["category2"] = ""
|
||||
params["category3"] = ""
|
||||
intVendorStoreID, err2 := api.EbaiAPI.ShopCreate(params)
|
||||
if err = err2; err == nil {
|
||||
return utils.Int64ToStr(intVendorStoreID), err
|
||||
if globals.EnableStoreWrite && globals.EnableEbaiStoreWrite {
|
||||
intVendorStoreID, err2 := api.EbaiAPI.ShopCreate(params)
|
||||
if err = err2; err == nil {
|
||||
return utils.Int64ToStr(intVendorStoreID), err
|
||||
}
|
||||
} else {
|
||||
return utils.Int64ToStr(jxutils.GenFakeID()), nil
|
||||
}
|
||||
}
|
||||
return "", err
|
||||
@@ -148,7 +152,7 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
|
||||
for _, store := range stores {
|
||||
params := genStoreMapFromStore(store)
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(params, false))
|
||||
if globals.EnableStoreWrite {
|
||||
if globals.EnableStoreWrite && globals.EnableEbaiStoreWrite {
|
||||
if err = api.EbaiAPI.ShopUpdate(params); err == nil {
|
||||
shopID := 0
|
||||
if store.SyncStatus&model.SyncFlagDeletedMask == 0 {
|
||||
@@ -218,7 +222,7 @@ func (p *PurchaseHandler) RefreshAllStoresID(ctx *jxcontext.Context, parentTask
|
||||
shopIDs[k] = utils.GetUUID()
|
||||
}
|
||||
}
|
||||
if globals.EnableStoreWrite {
|
||||
if globals.EnableStoreWrite && globals.EnableEbaiStoreWrite {
|
||||
err = api.EbaiAPI.ShopIDBatchUpdate(baiduShopIDs, shopIDs)
|
||||
}
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user