This commit is contained in:
苏尹岚
2021-03-12 16:35:40 +08:00
parent cb13becfd9
commit 60ff7e5854
2 changed files with 44 additions and 0 deletions

View File

@@ -1150,3 +1150,39 @@ func (a *API) SetOrderStateToFinish(orderId int64) (err error) {
_, err = a.AccessStorePage("https://porder.shop.jd.com/order/global/setOrderStateToFinish", params, false)
return err
}
type StoreProductSearchResult struct {
SkuID int64 `json:"skuId"`
CategoryID int `json:"categoryId"`
CategoryName []string `json:"categoryName"`
StoreID string `json:"storeId"`
StoreName string `json:"storeName"`
StoreAddress string `json:"storeAddress"`
VenderID string `json:"venderId"`
Status int `json:"status"`
LastUpTime interface{} `json:"lastUpTime"`
LastDownTime int64 `json:"lastDownTime"`
StorePrice interface{} `json:"storePrice"`
StockNum int `json:"stockNum"`
SkuName string `json:"skuName"`
Logo string `json:"logo"`
FeatureMap struct {
} `json:"featureMap"`
PriceAuditStatus interface{} `json:"priceAuditStatus"`
Reason interface{} `json:"reason"`
ShopSkuStatus interface{} `json:"shopSkuStatus"`
}
//门店商品查询
func (a *API) StoreProductSearch(pageNo, pageSize int, vendorStoreIDs []string) (storeProductSearchResult []*StoreProductSearchResult, totalCount int, err error) {
result, err := a.AccessStorePage2("https://ware.shop.jd.com/rest/storeProduct/search", map[string]interface{}{
"pageNo": pageNo,
"pageSize": pageSize,
"storeIds": vendorStoreIDs,
}, true)
if err == nil && result["data"] != nil {
utils.Map2StructByJson(result["data"].(map[string]interface{})["data"], &storeProductSearchResult, false)
totalCount = int(utils.MustInterface2Int64(result["data"].(map[string]interface{})["totalItem"]))
}
return storeProductSearchResult, totalCount, err
}

View File

@@ -734,3 +734,11 @@ func TestSetOrderStateToWait(t *testing.T) {
}
// t.Log(utils.Format4Output(result, false))
}
func TestStoreProductSearch(t *testing.T) {
result, _, err := api.StoreProductSearch(1, 20, []string{"1000069025"})
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}