- ISingleStoreStoreSkuHandler中几个Category相关的API改名
This commit is contained in:
@@ -76,12 +76,13 @@ type IPurchasePlatformStoreSkuHandler interface {
|
|||||||
type ISingleStoreStoreSkuHandler interface {
|
type ISingleStoreStoreSkuHandler interface {
|
||||||
IPurchasePlatformStoreSkuHandler
|
IPurchasePlatformStoreSkuHandler
|
||||||
|
|
||||||
|
// GetStoreAllSkus(ctx *jxcontext.Context, vendorStoreID string) (cats []*BareCategoryInfo, err error)
|
||||||
CreateStoreSkus(ctx *jxcontext.Context, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (err error)
|
CreateStoreSkus(ctx *jxcontext.Context, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (err error)
|
||||||
UpdateStoreSkus(ctx *jxcontext.Context, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (err error)
|
UpdateStoreSkus(ctx *jxcontext.Context, vendorStoreID string, storeSkuList []*dao.StoreSkuSyncInfo) (err error)
|
||||||
DeleteStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*BareStoreSkuInfo) (err error)
|
DeleteStoreSkus(ctx *jxcontext.Context, storeID int, vendorStoreID string, storeSkuList []*BareStoreSkuInfo) (err error)
|
||||||
|
|
||||||
GetStoreAllCategories(ctx *jxcontext.Context, vendorStoreID string) (cats []*BareCategoryInfo, err error)
|
GetStoreAllCategories(ctx *jxcontext.Context, vendorStoreID string) (cats []*BareCategoryInfo, err error)
|
||||||
CreateStoreSkuCategory(ctx *jxcontext.Context, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error)
|
CreateStoreCategory(ctx *jxcontext.Context, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error)
|
||||||
UpdateStoreSkuCategory(ctx *jxcontext.Context, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error)
|
UpdateStoreCategory(ctx *jxcontext.Context, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error)
|
||||||
DeleteStoreSkuCategory(ctx *jxcontext.Context, vendorStoreID, vendorCatID string) (err error)
|
DeleteStoreCategory(ctx *jxcontext.Context, vendorStoreID, vendorCatID string) (err error)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ func convertVendorCatList(remoteCats []*ebaiapi.CategoryInfo) (cats []*partner.B
|
|||||||
return cats
|
return cats
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PurchaseHandler) CreateStoreSkuCategory(ctx *jxcontext.Context, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) {
|
func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) {
|
||||||
var vendorCatID int64
|
var vendorCatID int64
|
||||||
if globals.EnableEbaiStoreWrite {
|
if globals.EnableEbaiStoreWrite {
|
||||||
vendorCatID, err = api.EbaiAPI.ShopCategoryCreate(vendorStoreID, utils.Str2Int64WithDefault(storeCat.ParentVendorCatID, 0), storeCat.Name, jxCatSeq2Ebai(storeCat.Seq))
|
vendorCatID, err = api.EbaiAPI.ShopCategoryCreate(vendorStoreID, utils.Str2Int64WithDefault(storeCat.ParentVendorCatID, 0), storeCat.Name, jxCatSeq2Ebai(storeCat.Seq))
|
||||||
@@ -60,14 +60,14 @@ func (p *PurchaseHandler) CreateStoreSkuCategory(ctx *jxcontext.Context, vendorS
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PurchaseHandler) UpdateStoreSkuCategory(ctx *jxcontext.Context, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) {
|
func (p *PurchaseHandler) UpdateStoreCategory(ctx *jxcontext.Context, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) {
|
||||||
if globals.EnableEbaiStoreWrite {
|
if globals.EnableEbaiStoreWrite {
|
||||||
err = api.EbaiAPI.ShopCategoryUpdate(vendorStoreID, utils.Str2Int64WithDefault(storeCat.VendorCatID, 0), storeCat.Name, jxCatSeq2Ebai(storeCat.Seq))
|
err = api.EbaiAPI.ShopCategoryUpdate(vendorStoreID, utils.Str2Int64WithDefault(storeCat.VendorCatID, 0), storeCat.Name, jxCatSeq2Ebai(storeCat.Seq))
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PurchaseHandler) DeleteStoreSkuCategory(ctx *jxcontext.Context, vendorStoreID, vendorCatID string) (err error) {
|
func (p *PurchaseHandler) DeleteStoreCategory(ctx *jxcontext.Context, vendorStoreID, vendorCatID string) (err error) {
|
||||||
if globals.EnableEbaiStoreWrite {
|
if globals.EnableEbaiStoreWrite {
|
||||||
err = api.EbaiAPI.ShopCategoryDelete(vendorStoreID, utils.Str2Int64WithDefault(vendorCatID, 0))
|
err = api.EbaiAPI.ShopCategoryDelete(vendorStoreID, utils.Str2Int64WithDefault(vendorCatID, 0))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ func convertVendorCatList(remoteCats []*mtwmapi.RetailCategoryInfo) (cats []*par
|
|||||||
return cats
|
return cats
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PurchaseHandler) CreateStoreSkuCategory(ctx *jxcontext.Context, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) {
|
func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) {
|
||||||
level := 1
|
level := 1
|
||||||
if storeCat.ParentCatName != "" {
|
if storeCat.ParentCatName != "" {
|
||||||
level = 2
|
level = 2
|
||||||
@@ -72,7 +72,7 @@ func (p *PurchaseHandler) CreateStoreSkuCategory(ctx *jxcontext.Context, vendorS
|
|||||||
if catName == "" {
|
if catName == "" {
|
||||||
panic("catName is empty")
|
panic("catName is empty")
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("mtwm CreateStoreSkuCategory vendorStoreID:%s, originName:%s, catName:%s, subCatName:%s, seq:%d", vendorStoreID, originName, catName, subCatName, storeCat.Seq)
|
globals.SugarLogger.Debugf("mtwm CreateStoreCategory vendorStoreID:%s, originName:%s, catName:%s, subCatName:%s, seq:%d", vendorStoreID, originName, catName, subCatName, storeCat.Seq)
|
||||||
if globals.EnableMtwmStoreWrite {
|
if globals.EnableMtwmStoreWrite {
|
||||||
err = api.MtwmAPI.RetailCatUpdate(vendorStoreID, originName, catName, subCatName, storeCat.Seq)
|
err = api.MtwmAPI.RetailCatUpdate(vendorStoreID, originName, catName, subCatName, storeCat.Seq)
|
||||||
}
|
}
|
||||||
@@ -82,11 +82,11 @@ func (p *PurchaseHandler) CreateStoreSkuCategory(ctx *jxcontext.Context, vendorS
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PurchaseHandler) UpdateStoreSkuCategory(ctx *jxcontext.Context, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) {
|
func (p *PurchaseHandler) UpdateStoreCategory(ctx *jxcontext.Context, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) {
|
||||||
return p.CreateStoreSkuCategory(ctx, vendorStoreID, storeCat)
|
return p.CreateStoreCategory(ctx, vendorStoreID, storeCat)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PurchaseHandler) DeleteStoreSkuCategory(ctx *jxcontext.Context, vendorStoreID, vendorCatID string) (err error) {
|
func (p *PurchaseHandler) DeleteStoreCategory(ctx *jxcontext.Context, vendorStoreID, vendorCatID string) (err error) {
|
||||||
if globals.EnableMtwmStoreWrite {
|
if globals.EnableMtwmStoreWrite {
|
||||||
err = api.MtwmAPI.RetailCatDelete(vendorStoreID, vendorCatID)
|
err = api.MtwmAPI.RetailCatDelete(vendorStoreID, vendorCatID)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ func convertVendorCatList(remoteCats []*weimobapi.GoodsClassify) (cats []*partne
|
|||||||
return cats
|
return cats
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PurchaseHandler) CreateStoreSkuCategory(ctx *jxcontext.Context, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) {
|
func (p *PurchaseHandler) CreateStoreCategory(ctx *jxcontext.Context, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) {
|
||||||
var vendorCatID int64
|
var vendorCatID int64
|
||||||
if globals.EnableWscStoreWrite {
|
if globals.EnableWscStoreWrite {
|
||||||
vendorCatID, err = api.WeimobAPI.AddClassify(storeCat.Name, utils.Str2Int64WithDefault(storeCat.ParentVendorCatID, 0), "")
|
vendorCatID, err = api.WeimobAPI.AddClassify(storeCat.Name, utils.Str2Int64WithDefault(storeCat.ParentVendorCatID, 0), "")
|
||||||
@@ -50,14 +50,14 @@ func (p *PurchaseHandler) CreateStoreSkuCategory(ctx *jxcontext.Context, vendorS
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PurchaseHandler) UpdateStoreSkuCategory(ctx *jxcontext.Context, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) {
|
func (p *PurchaseHandler) UpdateStoreCategory(ctx *jxcontext.Context, vendorStoreID string, storeCat *dao.SkuStoreCatInfo) (err error) {
|
||||||
if globals.EnableWscStoreWrite {
|
if globals.EnableWscStoreWrite {
|
||||||
err = api.WeimobAPI.UpdateClassify(utils.Str2Int64WithDefault(storeCat.VendorCatID, 0), storeCat.Name, "")
|
err = api.WeimobAPI.UpdateClassify(utils.Str2Int64WithDefault(storeCat.VendorCatID, 0), storeCat.Name, "")
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PurchaseHandler) DeleteStoreSkuCategory(ctx *jxcontext.Context, vendorStoreID, vendorCatID string) (err error) {
|
func (p *PurchaseHandler) DeleteStoreCategory(ctx *jxcontext.Context, vendorStoreID, vendorCatID string) (err error) {
|
||||||
if globals.EnableWscStoreWrite {
|
if globals.EnableWscStoreWrite {
|
||||||
err = api.WeimobAPI.UpdateClassify(utils.Str2Int64WithDefault(vendorCatID, 0), composeFakeDelName(vendorCatID), "")
|
err = api.WeimobAPI.UpdateClassify(utils.Str2Int64WithDefault(vendorCatID, 0), composeFakeDelName(vendorCatID), "")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user