饿百获取门店橱窗商品api修改

This commit is contained in:
苏尹岚
2020-01-20 17:26:40 +08:00
parent c0b3f5fc38
commit 1bc0db94bc
2 changed files with 55 additions and 70 deletions

View File

@@ -321,21 +321,7 @@ type ShopList struct {
ProxyBusinessState int `json:"proxy_business_state"` ProxyBusinessState int `json:"proxy_business_state"`
} }
type StoreShowWindowList struct { type StoreShowWindowSkuList struct {
ID string `json:"id"`
WindowID string `json:"window_id"`
WindowName string `json:"window_name"`
Wid string `json:"wid"`
SupplierID string `json:"supplier_id"`
OperatorID string `json:"operator_id"`
Status string `json:"status"`
CreateTime string `json:"create_time"`
UpdateTime string `json:"update_time"`
SkuIds string `json:"sku_ids"`
WindowType string `json:"window_type"`
Ext string `json:"ext"`
ShopName string `json:"shop_name"`
SkuList []struct {
SkuID string `json:"sku_id"` SkuID string `json:"sku_id"`
UpcID string `json:"upc_id"` UpcID string `json:"upc_id"`
Wid string `json:"wid"` Wid string `json:"wid"`
@@ -343,7 +329,7 @@ type StoreShowWindowList struct {
UpdateTime string `json:"update_time"` UpdateTime string `json:"update_time"`
ShelfNumber string `json:"shelf_number"` ShelfNumber string `json:"shelf_number"`
LeftNum string `json:"left_num"` LeftNum string `json:"left_num"`
MarketPrice int `json:"market_price"` MarketPrice float64 `json:"market_price"`
Ext string `json:"ext"` Ext string `json:"ext"`
ExtCode string `json:"ext_code"` ExtCode string `json:"ext_code"`
WeightFlag string `json:"weight_flag"` WeightFlag string `json:"weight_flag"`
@@ -387,7 +373,6 @@ type StoreShowWindowList struct {
Cat3Name string `json:"cat3_name"` Cat3Name string `json:"cat3_name"`
Editable int `json:"editable"` Editable int `json:"editable"`
SkuStatus int `json:"sku_status"` SkuStatus int `json:"sku_status"`
} `json:"sku_list"`
} }
func (a *API) AccessStorePage2(subURL string, params map[string]interface{}, isPost bool, cookies map[string]string) (retVal map[string]interface{}, err error) { func (a *API) AccessStorePage2(subURL string, params map[string]interface{}, isPost bool, cookies map[string]string) (retVal map[string]interface{}, err error) {
@@ -802,13 +787,13 @@ func (a *API) ModifyTip4OrderWaybill(orderID, elemeOrderID string, tip, zhongBao
} }
//查询饿百门店橱窗商品信息 //查询饿百门店橱窗商品信息
func (a *API) GetStoresShowWindowSkus(baiduShopID int64) (storeShowWindowList *StoreShowWindowList, err error) { func (a *API) GetStoresShowWindowSkus(baiduShopID int64) (storeShowWindowList []*StoreShowWindowSkuList, err error) {
params := map[string]interface{}{ params := map[string]interface{}{
"wid": baiduShopID, "wid": baiduShopID,
} }
result, err := a.AccessStorePage("crm/shop/getcurrshopwindow", params, true) result, err := a.AccessStorePage("crm/shop/getcurrshopwindow", params, true)
if err == nil { if err == nil {
err2 := utils.Map2StructByJson(result, &storeShowWindowList, false) err2 := utils.Map2StructByJson(result["sku_list"], &storeShowWindowList, false)
if err2 != nil { if err2 != nil {
return storeShowWindowList, err return storeShowWindowList, err
} }

View File

@@ -148,6 +148,6 @@ func TestGetShopListIDs(t *testing.T) {
} }
func TestGetStoresShowWindowSkus(t *testing.T) { func TestGetStoresShowWindowSkus(t *testing.T) {
result, _ := api.GetStoresShowWindowSkus(32267315055) result, _ := api.GetStoresShowWindowSkus(32267089415)
t.Log(utils.Format4Output(result, false)) t.Log(utils.Format4Output(result, false))
} }