diff --git a/platformapi/jdshopapi/jdshopapi.go b/platformapi/jdshopapi/jdshopapi.go
index 4a603676..ae2fcab0 100644
--- a/platformapi/jdshopapi/jdshopapi.go
+++ b/platformapi/jdshopapi/jdshopapi.go
@@ -14,10 +14,12 @@ import (
)
const (
- prodURL = "https://api.jd.com/routerjson"
- sigKey = "sign"
- JdsImgURL = "//img10.360buyimg.com/imgzone/"
- JdsImgDescURL = `
`
+ prodURL = "https://api.jd.com/routerjson"
+ sigKey = "sign"
+ JdsImgURL = "//img10.360buyimg.com/imgzone/"
+ JdsImgDescURL = `
`
+ JdsStoreImg = "http://image.jxc4.com/image/b90ae8585e8cf2f3871f6e8318bde1dc.tem.png"
+ JdsStoreCategoryName = "pop-mendian-Selfdelivery"
CreateCatType = "3"
UpdateCatType = "1"
diff --git a/platformapi/jdshopapi/store.go b/platformapi/jdshopapi/store.go
index 265db187..3232bc58 100644
--- a/platformapi/jdshopapi/store.go
+++ b/platformapi/jdshopapi/store.go
@@ -33,9 +33,12 @@ type GetAddressCodeResult struct {
//创建门店
//https://open.jd.com/home/home#/doc/api?apiCateId=351&apiId=2224&apiName=jingdong.createEntityStore
-func (a *API) CreateEntityStore(createEntityStoreParam *CreateEntityStoreParam) (err error) {
- _, err = a.AccessAPI("jingdong.createEntityStore", prodURL, utils.Struct2FlatMap(createEntityStoreParam))
- return err
+func (a *API) CreateEntityStore(createEntityStoreParam *CreateEntityStoreParam) (vendorStoreID string, err error) {
+ result, err := a.AccessAPI("jingdong.createEntityStore", prodURL, utils.Struct2FlatMap(createEntityStoreParam))
+ if err == nil {
+ return result["jingdong_createEntityStore_responce"].(map[string]interface{})["createentitystore_result"].(map[string]interface{})["result"].(map[string]interface{})["name"].(string), err
+ }
+ return vendorStoreID, err
}
//修改门店
diff --git a/platformapi/jdshopapi/store_test.go b/platformapi/jdshopapi/store_test.go
index 4798aa52..44efe82e 100644
--- a/platformapi/jdshopapi/store_test.go
+++ b/platformapi/jdshopapi/store_test.go
@@ -9,14 +9,14 @@ import (
func TestCreateEntityStore(t *testing.T) {
data, _, err := DownloadFileByURL("http://image.jxc4.com/image/b90ae8585e8cf2f3871f6e8318bde1dc.tem.png")
- err = api.CreateEntityStore(&CreateEntityStoreParam{
+ result, err := api.CreateEntityStore(&CreateEntityStoreParam{
Name: "京西菜市门店1",
AddCode: 50946,
AddCodeName: "金牛区",
AddName: "成都金牛区@!加州湾v派",
Coordinate: "29.707870,115.980868",
Phone: "18160030913",
- ExtendJSON: `{"businessBeginTime":"09:00","businessEndTime":"22:00"}`,
+ ExtendJSON: `{"businessBeginTime":"9:00","businessEndTime":"22:00"}`,
ImageFile: base64.StdEncoding.EncodeToString(data),
CategoryName: "pop-mendian-Selfdelivery",
CustomerID: "666934",
@@ -24,7 +24,7 @@ func TestCreateEntityStore(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- // t.Log(utils.Format4Output(result, false))
+ t.Log(utils.Format4Output(result, false))
}
func TestGetProvince(t *testing.T) {