diff --git a/platformapi/jdshopapi/store.go b/platformapi/jdshopapi/store.go index 3232bc58..3f05bdc1 100644 --- a/platformapi/jdshopapi/store.go +++ b/platformapi/jdshopapi/store.go @@ -1,6 +1,8 @@ package jdshopapi import ( + "fmt" + "git.rosy.net.cn/baseapi/utils" ) @@ -36,6 +38,9 @@ type GetAddressCodeResult struct { func (a *API) CreateEntityStore(createEntityStoreParam *CreateEntityStoreParam) (vendorStoreID string, err error) { result, err := a.AccessAPI("jingdong.createEntityStore", prodURL, utils.Struct2FlatMap(createEntityStoreParam)) if err == nil { + if !result["jingdong_createEntityStore_responce"].(map[string]interface{})["createentitystore_result"].(map[string]interface{})["success"].(bool) { + return vendorStoreID, fmt.Errorf(result["jingdong_createEntityStore_responce"].(map[string]interface{})["createentitystore_result"].(map[string]interface{})["message"].(string)) + } return result["jingdong_createEntityStore_responce"].(map[string]interface{})["createentitystore_result"].(map[string]interface{})["result"].(map[string]interface{})["name"].(string), err } return vendorStoreID, err