京东商城增加图片等api
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package jdshopapi
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -41,6 +43,23 @@ type GetAddressCodeResult struct {
|
||||
AreaID int `json:"areaId"`
|
||||
}
|
||||
|
||||
type QueryEntityStoreResult struct {
|
||||
VenderID int64 `json:"venderId"`
|
||||
StoreID int64 `json:"storeId"`
|
||||
StoreName string `json:"storeName"`
|
||||
Address string `json:"address"`
|
||||
FullAddress string `json:"fullAddress"`
|
||||
Phone string `json:"phone"`
|
||||
AddrCode int `json:"addrCode"`
|
||||
Status int `json:"status"`
|
||||
Coordinate string `json:"coordinate"`
|
||||
ExtendValue string `json:"extendValue"`
|
||||
ExStoreID string `json:"exStoreId"`
|
||||
AuditStatus int `json:"auditStatus"`
|
||||
StoreStatus string `json:"storeStatus"`
|
||||
OperateStatus string `json:"operateStatus"`
|
||||
}
|
||||
|
||||
//创建门店
|
||||
//https://open.jd.com/home/home#/doc/api?apiCateId=351&apiId=2224&apiName=jingdong.createEntityStore
|
||||
func (a *API) CreateEntityStore(createEntityStoreParam *CreateEntityStoreParam) (vendorStoreID string, err error) {
|
||||
@@ -145,3 +164,19 @@ func (a *API) UpdateSkuSiteStock(skuId, stockNum, siteId int) (err error) {
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
//获取门店信息
|
||||
//https://open.jd.com/home/home#/doc/api?apiCateId=351&apiId=2223&apiName=jingdong.queryEntityStore
|
||||
func (a *API) QueryEntityStore(storeId int64) (queryEntityStoreResult *QueryEntityStoreResult, err error) {
|
||||
result, err := a.AccessAPI("jingdong.queryEntityStore", prodURL, map[string]interface{}{
|
||||
"storeId": storeId,
|
||||
})
|
||||
if err == nil {
|
||||
data := result["jingdong_queryEntityStore_responce"].(map[string]interface{})["queryentitystore_result"].(map[string]interface{})["jsonResult"].(string)
|
||||
data = strings.ReplaceAll(data, "[", "")
|
||||
data = strings.ReplaceAll(data, "]", "")
|
||||
err = json.Unmarshal([]byte(data), &queryEntityStoreResult)
|
||||
// utils.Map2StructByJson(data, &queryEntityStoreResult, false)
|
||||
}
|
||||
return queryEntityStoreResult, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user