- 一些与门店商品信息操作相关的API
This commit is contained in:
@@ -20,6 +20,17 @@ type RetailTag struct {
|
||||
NamePath string `json:"namePath"`
|
||||
}
|
||||
|
||||
type BareStoreSkuInfo struct {
|
||||
SkuID string `json:"sku_id"`
|
||||
Price string `json:"price,omitempty"`
|
||||
Stock string `json:"stock,omitempty"`
|
||||
}
|
||||
|
||||
type BareStoreFoodInfo struct {
|
||||
AppFoodCode string `json:"app_food_code"`
|
||||
Skus []*BareStoreSkuInfo `json:"skus"`
|
||||
}
|
||||
|
||||
// 美团分类没有ID,就以名字为唯一标识,不论级别都必须不能重名
|
||||
// name(和originName)的长度不能超过10个字符(字符,不是字节)
|
||||
// 创建一级分类,originName为空,name为新分类名,secondaryName为空
|
||||
@@ -100,7 +111,7 @@ func (a *API) RetailBatchInitData(poiCode string, foodDataList []map[string]inte
|
||||
return err
|
||||
}
|
||||
|
||||
func (a *API) RetailSkuPrice(poiCode string, foodData []map[string]interface{}) (err error) {
|
||||
func (a *API) RetailSkuPrice(poiCode string, foodData []*BareStoreFoodInfo) (err error) {
|
||||
_, err = a.AccessAPI("retail/sku/price", false, map[string]interface{}{
|
||||
KeyAppPoiCode: poiCode,
|
||||
"food_data": string(utils.MustMarshal(foodData)),
|
||||
@@ -108,7 +119,7 @@ func (a *API) RetailSkuPrice(poiCode string, foodData []map[string]interface{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (a *API) RetailSkuStock(poiCode string, foodData []map[string]interface{}) (err error) {
|
||||
func (a *API) RetailSkuStock(poiCode string, foodData []*BareStoreFoodInfo) (err error) {
|
||||
_, err = a.AccessAPI("retail/sku/stock", false, map[string]interface{}{
|
||||
KeyAppPoiCode: poiCode,
|
||||
"food_data": string(utils.MustMarshal(foodData)),
|
||||
@@ -146,6 +157,15 @@ func (a *API) RetailSkuSellStatus(poiCode string, foodData []map[string]interfac
|
||||
return err
|
||||
}
|
||||
|
||||
func (a *API) RetailSkuSellStatus2(poiCode string, foodData []*BareStoreFoodInfo, sellStatus int) (err error) {
|
||||
_, err = a.AccessAPI("retail/sku/sellStatus", false, map[string]interface{}{
|
||||
KeyAppPoiCode: poiCode,
|
||||
"food_data": string(utils.MustMarshal(foodData)),
|
||||
"sell_status": sellStatus,
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
func (a *API) RetailDelete(poiCode, foodCode string) (err error) {
|
||||
_, err = a.AccessAPI("retail/delete", false, map[string]interface{}{
|
||||
KeyAppPoiCode: poiCode,
|
||||
|
||||
Reference in New Issue
Block a user