warehouseDetail response
This commit is contained in:
@@ -46,7 +46,8 @@ func (c *ShopGetStoreDetailRequest) GetParams() *ShopGetStoreDetailParam {
|
||||
|
||||
type ShopGetStoreDetailParam struct {
|
||||
// 门店ID
|
||||
StoreId int64 `json:"store_id"`
|
||||
StoreId string `json:"store_id"`
|
||||
//StoreId int64 `json:"store_id"`
|
||||
// 是否需要poi审核信息,注:只要审核状态的审核不要传true,需要详细的提交信息时传true
|
||||
IsNeedPoiAuditInfo bool `json:"is_need_poi_audit_info"`
|
||||
// 是否需要关联的抖店信息,注:只要shopId不要传true,需要关联店铺名称等信息时传true
|
||||
|
||||
@@ -43,18 +43,10 @@ type WarehouseInfoMapItem struct {
|
||||
UpdateTime int64 `json:"update_time"`
|
||||
// 创建时间
|
||||
CreateTime int64 `json:"create_time"`
|
||||
// 店铺id
|
||||
ShopId int64 `json:"shop_id"`
|
||||
// 仓类型
|
||||
WarehouseType int64 `json:"warehouse_type"`
|
||||
// 绑定的外部围栏ID列表
|
||||
OutFenceIds []string `json:"out_fence_ids"`
|
||||
Latitude float64 `json:"latitude"`
|
||||
Longitude float64 `json:"longitude"`
|
||||
Addresses []string `json:"addresses"`
|
||||
StoreNames []string `json:"store_names"`
|
||||
}
|
||||
type WarehouseGetWarehouseByStoreData struct {
|
||||
// 仓信息map
|
||||
WarehouseInfoMap map[int64][]WarehouseInfoMapItem `json:"warehouse_info_map"`
|
||||
WarehouseInfoMap map[string]WarehouseInfoMapItem `json:"warehouse_info_map"`
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
var token = `{"access_token":"88a8dd73-b276-4eb6-830e-007b2cf18208","expires_in":1669018480,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"4fefd9c8-ae3b-41c3-98f0-427585370f61","authority_id":""}`
|
||||
var token = `{"access_token":"2baa1126-bba0-4510-8ffa-6af55ba0bdbd","expires_in":1670828768,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"23b3eb4e-bb00-4b85-952d-de47801de80d","authority_id":""}`
|
||||
var a = New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", token)
|
||||
|
||||
// 查询售后单详情
|
||||
|
||||
@@ -394,7 +394,7 @@ func (a *API) StoreBindWarehouse(param *warehouse_bindStore_request.WarehouseBin
|
||||
}
|
||||
|
||||
//获取门店绑定的仓库信息
|
||||
func (a *API) GetWarehouseByStore(storeID int64) (map[int64][]warehouse_getWarehouseByStore_response.WarehouseInfoMapItem, error) {
|
||||
func (a *API) GetWarehouseByStore(storeID int64) (*warehouse_getWarehouseByStore_response.WarehouseGetWarehouseByStoreData, error) {
|
||||
request := warehouse_getWarehouseByStore_request.New()
|
||||
request.Param.StoreIds = append(request.Param.StoreIds, storeID)
|
||||
response, err := request.Execute(a.accessTokenObj)
|
||||
@@ -407,7 +407,7 @@ func (a *API) GetWarehouseByStore(storeID int64) (map[int64][]warehouse_getWareh
|
||||
if len(response.Data.WarehouseInfoMap) == 0 {
|
||||
return nil, errors.New(fmt.Sprintf("门店%d 暂时未绑定仓库,请进行绑定!", storeID))
|
||||
}
|
||||
return response.Data.WarehouseInfoMap, nil
|
||||
return response.Data, nil
|
||||
}
|
||||
|
||||
//创建电子围栏
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
shop_batchCreateStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_batchCreateStore/request"
|
||||
shop_bindStoreSaleLimit_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_bindStoreSaleLimit/request"
|
||||
shop_editStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_editStore/request"
|
||||
shop_getStoreDetail_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_getStoreDetail/request"
|
||||
shop_getStoreList_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_getStoreList/request"
|
||||
shop_storeSuspend_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_storeSuspend/request"
|
||||
shop_unsuspendStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_unsuspendStore/request"
|
||||
@@ -56,6 +57,21 @@ func TestCreateStore(t *testing.T) {
|
||||
fmt.Println("err==", err)
|
||||
}
|
||||
|
||||
//单个获取门店详情
|
||||
func TestGetStoreDetail(t *testing.T) {
|
||||
accesstoken := `{"access_token":"8de708c3-f2d1-4b45-bc56-31f704ca0f1e","expires_in":1670227126,"scope":"SCOPE","shop_id":57939570,"shop_name":"京西菜市速食","refresh_token":"86ef17a7-7964-4f57-ae2d-4f8bcbfff97e","authority_id":""}`
|
||||
a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", accesstoken)
|
||||
data, err := a.GetStoreDetail(&shop_getStoreDetail_request.ShopGetStoreDetailParam{
|
||||
//StoreId: 76879546,
|
||||
StoreId: "76879546",
|
||||
IsNeedRelShopUser: false,
|
||||
IsNeedPoiAuditInfo: false,
|
||||
IsNeedChargeInfo: false,
|
||||
})
|
||||
fmt.Println("data==========", utils.Format4Output(data, false))
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
//门店列表分页查询
|
||||
func TestGetStoreList(t *testing.T) {
|
||||
data, err := a.GetStoreList(&shop_getStoreList_request.ShopGetStoreListParam{
|
||||
@@ -233,9 +249,9 @@ func TestUpdateStore(t *testing.T) {
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
//获取门店绑定仓库
|
||||
//获取门店绑定仓库以及电子围栏
|
||||
func TestGetWarehouseByStore(t *testing.T) {
|
||||
resp, err := a.GetWarehouseByStore(65402632)
|
||||
resp, err := a.GetWarehouseByStore(63520016)
|
||||
fmt.Println(resp)
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user