aa
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user