1
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package freightTemplate_update_response
|
||||
|
||||
import doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
|
||||
type FreightTemplateUpdateResponse struct {
|
||||
doudian_sdk.BaseDoudianOpApiResponse
|
||||
Data *FreightTemplateUpdateData `json:"data"`
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
package warehouse_setFence_request
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
warehouse_setFence_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_setFence/response"
|
||||
doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
)
|
||||
|
||||
type WarehouseSetFenceRequest struct {
|
||||
doudian_sdk.BaseDoudianOpApiRequest
|
||||
Param *WarehouseSetFenceParam
|
||||
}
|
||||
|
||||
func (c *WarehouseSetFenceRequest) GetUrlPath() string {
|
||||
return "/warehouse/setFence"
|
||||
}
|
||||
|
||||
func New() *WarehouseSetFenceRequest {
|
||||
request := &WarehouseSetFenceRequest{
|
||||
Param: &WarehouseSetFenceParam{},
|
||||
}
|
||||
request.SetConfig(doudian_sdk.GlobalConfig)
|
||||
request.SetClient(doudian_sdk.DefaultDoudianOpApiClient)
|
||||
return request
|
||||
|
||||
}
|
||||
|
||||
func (c *WarehouseSetFenceRequest) Execute(accessToken *doudian_sdk.AccessToken) (*warehouse_setFence_response.WarehouseSetFenceResponse, error) {
|
||||
responseJson, err := c.GetClient().Request(c, accessToken)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response := &warehouse_setFence_response.WarehouseSetFenceResponse{}
|
||||
_ = json.Unmarshal([]byte(responseJson), response)
|
||||
return response, nil
|
||||
|
||||
}
|
||||
|
||||
func (c *WarehouseSetFenceRequest) GetParamObject() interface{} {
|
||||
return c.Param
|
||||
}
|
||||
|
||||
func (c *WarehouseSetFenceRequest) GetParams() *WarehouseSetFenceParam {
|
||||
return c.Param
|
||||
}
|
||||
|
||||
type VerticesItem struct {
|
||||
// 经度
|
||||
Longitude float64 `json:"longitude"`
|
||||
// 纬度
|
||||
Latitude float64 `json:"latitude"`
|
||||
}
|
||||
type Polygon struct {
|
||||
// 多边形顶点的经纬度:逆时针
|
||||
Vertices []VerticesItem `json:"vertices"`
|
||||
}
|
||||
type PolygonsItem struct {
|
||||
// 多边形顶点
|
||||
Vertices []VerticesItem `json:"vertices"`
|
||||
}
|
||||
type Outer struct {
|
||||
// 经纬度列表,外圈为逆时针
|
||||
Vertices []VerticesItem `json:"vertices"`
|
||||
}
|
||||
type WarehouseSetFenceParam struct {
|
||||
// 围栏信息
|
||||
FenceInfo *FenceInfo `json:"fence_info"`
|
||||
}
|
||||
type Center struct {
|
||||
// 经度
|
||||
Longitude float64 `json:"longitude"`
|
||||
// 纬度
|
||||
Latitude float64 `json:"latitude"`
|
||||
}
|
||||
type Circular struct {
|
||||
// 圆的中心经纬度
|
||||
Center *Center `json:"center"`
|
||||
// 半径,单位 米
|
||||
Radius float64 `json:"radius"`
|
||||
}
|
||||
type InnerItem struct {
|
||||
// 经纬度列表,内圈为顺时针
|
||||
Vertices []VerticesItem `json:"vertices"`
|
||||
}
|
||||
type PolygonNew struct {
|
||||
// 带洞多边形的外圈数据
|
||||
Outer *Outer `json:"outer"`
|
||||
// 带洞多边形的内圈数据,空表示普通多边形
|
||||
Inner []InnerItem `json:"inner"`
|
||||
}
|
||||
type MultiPolygonsItem struct {
|
||||
// 带洞多边形的外圈数据
|
||||
Outer *Outer `json:"outer"`
|
||||
// 带洞多边形的内圈数据,空表示普通多边形
|
||||
Inner []InnerItem `json:"inner"`
|
||||
}
|
||||
type FenceInfo struct {
|
||||
// 外部围栏id,必传
|
||||
OutFenceId string `json:"out_fence_id"`
|
||||
// 形状 1. 圆 2:多边形 3:带洞多边形(兼容普通多边形)4:多个多边形,兼容带洞和不带洞
|
||||
Shape int32 `json:"shape"`
|
||||
// 形状为圆的经纬度信息
|
||||
Circular *Circular `json:"circular"`
|
||||
// 普通多边形
|
||||
Polygon *Polygon `json:"polygon"`
|
||||
// 带洞多边形,可兼容普通多边形
|
||||
Polygons []PolygonsItem `json:"polygons"`
|
||||
// 带洞多边形,可兼容普通多边形
|
||||
PolygonNew *PolygonNew `json:"polygon_new"`
|
||||
// 多个多边形
|
||||
MultiPolygons []MultiPolygonsItem `json:"multi_polygons"`
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package warehouse_setFence_response
|
||||
|
||||
import (
|
||||
doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
)
|
||||
|
||||
type WarehouseSetFenceResponse struct {
|
||||
doudian_sdk.BaseDoudianOpApiResponse
|
||||
Data *WarehouseSetFenceData `json:"data"`
|
||||
}
|
||||
type WarehouseSetFenceData struct {
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package warehouse_unbindStore_request
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
warehouse_unbindStore_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_unbindStore/response"
|
||||
doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
)
|
||||
|
||||
type WarehouseUnbindStoreRequest struct {
|
||||
doudian_sdk.BaseDoudianOpApiRequest
|
||||
Param *WarehouseUnbindStoreParam
|
||||
}
|
||||
|
||||
func (c *WarehouseUnbindStoreRequest) GetUrlPath() string {
|
||||
return "/warehouse/unbindStore"
|
||||
}
|
||||
|
||||
func New() *WarehouseUnbindStoreRequest {
|
||||
request := &WarehouseUnbindStoreRequest{
|
||||
Param: &WarehouseUnbindStoreParam{},
|
||||
}
|
||||
request.SetConfig(doudian_sdk.GlobalConfig)
|
||||
request.SetClient(doudian_sdk.DefaultDoudianOpApiClient)
|
||||
return request
|
||||
|
||||
}
|
||||
|
||||
func (c *WarehouseUnbindStoreRequest) Execute(accessToken *doudian_sdk.AccessToken) (*warehouse_unbindStore_response.WarehouseUnbindStoreResponse, error) {
|
||||
responseJson, err := c.GetClient().Request(c, accessToken)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response := &warehouse_unbindStore_response.WarehouseUnbindStoreResponse{}
|
||||
_ = json.Unmarshal([]byte(responseJson), response)
|
||||
return response, nil
|
||||
|
||||
}
|
||||
|
||||
func (c *WarehouseUnbindStoreRequest) GetParamObject() interface{} {
|
||||
return c.Param
|
||||
}
|
||||
|
||||
func (c *WarehouseUnbindStoreRequest) GetParams() *WarehouseUnbindStoreParam {
|
||||
return c.Param
|
||||
}
|
||||
|
||||
type WarehouseUnbindStoreParam struct {
|
||||
// 要删除的门店id列表
|
||||
StoreIds []int64 `json:"store_ids"`
|
||||
// 外部仓id
|
||||
OutWarehouseId string `json:"out_warehouse_id"`
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package warehouse_unbindStore_response
|
||||
|
||||
import (
|
||||
doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
)
|
||||
|
||||
type WarehouseUnbindStoreResponse struct {
|
||||
doudian_sdk.BaseDoudianOpApiResponse
|
||||
Data *WarehouseUnbindStoreData `json:"data"`
|
||||
}
|
||||
type WarehouseUnbindStoreData struct {
|
||||
}
|
||||
@@ -235,9 +235,10 @@ func TestUpdateSkuStore(t *testing.T) {
|
||||
SkuId: 1746278107578416,
|
||||
ProductId: 3576377564144516403,
|
||||
//OutProductId: 8076827,
|
||||
Incremental: false,
|
||||
IdempotentId: "",
|
||||
StockNum: 100,
|
||||
Incremental: false,
|
||||
IdempotentId: "",
|
||||
StockNum: 100,
|
||||
OutWarehouseId: "63114504",
|
||||
})
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ import (
|
||||
warehouse_createFence_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_createFence/response"
|
||||
warehouse_list_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_list/request"
|
||||
warehouse_list_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_list/response"
|
||||
warehouse_unbindStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_unbindStore/request"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
)
|
||||
@@ -396,6 +397,18 @@ func (a *API) QueryAllWarehouse(param *warehouse_list_request.WarehouseListParam
|
||||
}
|
||||
|
||||
// WarehouseUnbindStore 仓库解绑门店接口 /warehouse/unbindStore
|
||||
func (a *API) WarehouseUnbindStore() {
|
||||
func (a *API) WarehouseUnbindStore(storeId []int64, outWarehouseId string) error {
|
||||
request := warehouse_unbindStore_request.New()
|
||||
request.Param.StoreIds = storeId
|
||||
request.Param.OutWarehouseId = outWarehouseId
|
||||
|
||||
data, err := request.Execute(a.accessTokenObj)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if data.Code != RequestSuccessCode {
|
||||
return errors.New(data.SubMsg)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -102,3 +102,10 @@ func TestBindWarehouseToStore(t *testing.T) {
|
||||
fmt.Println(data)
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
// 仓库解绑门店
|
||||
func TestUnBindd(t *testing.T) {
|
||||
token := `{"access_token":"a1746210-a8a3-4497-a87b-09d1f10dbb95","expires_in":1665652230,"scope":"SCOPE","shop_id":"","shop_name":"小时达开放平台对接专用店","refresh_token":"c1cf8d88-0983-4f2a-b969-3746fae6b0cd","authority_id":""}`
|
||||
a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", token)
|
||||
a.WarehouseUnbindStore([]int64{63114504}, "666667")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user