限售
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
package shop_getStoreSaleLimit_request
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
shop_getStoreSaleLimit_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/shop_getStoreSaleLimit/response"
|
||||
doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
)
|
||||
|
||||
type ShopGetStoreSaleLimitRequest struct {
|
||||
doudian_sdk.BaseDoudianOpApiRequest
|
||||
Param *ShopGetStoreSaleLimitParam
|
||||
}
|
||||
|
||||
func (c *ShopGetStoreSaleLimitRequest) GetUrlPath() string {
|
||||
return "/shop/getStoreSaleLimit"
|
||||
}
|
||||
|
||||
func New() *ShopGetStoreSaleLimitRequest {
|
||||
request := &ShopGetStoreSaleLimitRequest{
|
||||
Param: &ShopGetStoreSaleLimitParam{},
|
||||
}
|
||||
request.SetConfig(doudian_sdk.GlobalConfig)
|
||||
request.SetClient(doudian_sdk.DefaultDoudianOpApiClient)
|
||||
return request
|
||||
|
||||
}
|
||||
|
||||
func (c *ShopGetStoreSaleLimitRequest) Execute(accessToken *doudian_sdk.AccessToken) (*shop_getStoreSaleLimit_response.ShopGetStoreSaleLimitResponse, error) {
|
||||
responseJson, err := c.GetClient().Request(c, accessToken)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
response := &shop_getStoreSaleLimit_response.ShopGetStoreSaleLimitResponse{}
|
||||
_ = json.Unmarshal([]byte(responseJson), response)
|
||||
return response, nil
|
||||
|
||||
}
|
||||
|
||||
func (c *ShopGetStoreSaleLimitRequest) GetParamObject() interface{} {
|
||||
return c.Param
|
||||
}
|
||||
|
||||
func (c *ShopGetStoreSaleLimitRequest) GetParams() *ShopGetStoreSaleLimitParam {
|
||||
return c.Param
|
||||
}
|
||||
|
||||
type ShopGetStoreSaleLimitParam struct {
|
||||
// 门店ID
|
||||
StoreId int64 `json:"store_id"`
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package shop_getStoreSaleLimit_response
|
||||
|
||||
import (
|
||||
doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
|
||||
)
|
||||
|
||||
type ShopGetStoreSaleLimitResponse struct {
|
||||
doudian_sdk.BaseDoudianOpApiResponse
|
||||
Data *ShopGetStoreSaleLimitData `json:"data"`
|
||||
}
|
||||
type StoreSaleLimitsItem struct {
|
||||
// 门店id
|
||||
StoreId int64 `json:"store_id"`
|
||||
// 模版id
|
||||
SaleLimitId int64 `json:"sale_limit_id"`
|
||||
}
|
||||
type ShopGetStoreSaleLimitData struct {
|
||||
// 门店关联的限售模版
|
||||
StoreSaleLimits []StoreSaleLimitsItem `json:"store_sale_limits"`
|
||||
}
|
||||
Reference in New Issue
Block a user