1
This commit is contained in:
@@ -25,6 +25,43 @@ func New() *FreightTemplateDetailRequest {
|
||||
|
||||
}
|
||||
|
||||
type T struct {
|
||||
Code int `json:"code"`
|
||||
Data struct {
|
||||
Columns []struct {
|
||||
AddNum int `json:"add_num"`
|
||||
AddNumPrice int `json:"add_num_price"`
|
||||
AddWeight int `json:"add_weight"`
|
||||
AddWeightPrice int `json:"add_weight_price"`
|
||||
FirstNum int `json:"first_num"`
|
||||
FirstNumPrice int `json:"first_num_price"`
|
||||
FirstWeight int `json:"first_weight"`
|
||||
FirstWeightPrice int `json:"first_weight_price"`
|
||||
IsDefault int `json:"is_default"`
|
||||
IsLimited bool `json:"is_limited"`
|
||||
IsOverFree bool `json:"is_over_free"`
|
||||
OverAmount int `json:"over_amount"`
|
||||
OverNum int `json:"over_num"`
|
||||
OverWeight int `json:"over_weight"`
|
||||
ProvinceInfos []interface{} `json:"province_infos"`
|
||||
} `json:"columns"`
|
||||
Template struct {
|
||||
CalculateType int `json:"calculate_type"`
|
||||
FixedAmount int `json:"fixed_amount"`
|
||||
Id int `json:"id"`
|
||||
ProductCity string `json:"product_city"`
|
||||
ProductProvince string `json:"product_province"`
|
||||
RuleType int `json:"rule_type"`
|
||||
TemplateName string `json:"template_name"`
|
||||
TransferType int `json:"transfer_type"`
|
||||
} `json:"template"`
|
||||
} `json:"data"`
|
||||
LogId string `json:"log_id"`
|
||||
Msg string `json:"msg"`
|
||||
SubCode string `json:"sub_code"`
|
||||
SubMsg string `json:"sub_msg"`
|
||||
}
|
||||
|
||||
func (c *FreightTemplateDetailRequest) Execute(accessToken *doudian_sdk.AccessToken) (*freightTemplate_detail_response.FreightTemplateDetailResponse, error) {
|
||||
responseJson, err := c.GetClient().Request(c, accessToken)
|
||||
if err != nil {
|
||||
|
||||
@@ -4,8 +4,9 @@ import doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/c
|
||||
|
||||
type FreightTemplateDetailResponse struct {
|
||||
doudian_sdk.BaseDoudianOpApiResponse
|
||||
Data *FreightTemplateDetailData `json:"data"`
|
||||
Data *Data `json:"data"`
|
||||
}
|
||||
|
||||
type ColumnsItem struct {
|
||||
// 首重(单位:kg) 按重量计价必填 0.1-999.9之间的小数,小数点后一位
|
||||
FirstWeight float64 `json:"first_weight"`
|
||||
@@ -35,19 +36,17 @@ type ColumnsItem struct {
|
||||
OverAmount int64 `json:"over_amount"`
|
||||
// 满xx件包邮 1-10之间的整数
|
||||
OverNum int64 `json:"over_num"`
|
||||
// 当前规则生效的地址,统一以List<Struct>结构返回,该结构为嵌套结构。对应的json格式为[{"id":"32","children":[{"id":"320500","children":[{"id":"320508","children":[{"id":"320508014"},{"id":"320508004"}]}]}]}] 注意:返回的为最新的四级地址版本(地址存储升级变更的可能,以最新的返回)
|
||||
//当前规则生效的地址,统一以List<Struct>结构返回,该结构为嵌套结构。对应的json格式为[{"id":"32","children":[{"id":"320500","children":[{"id":"320508","children":[{"id":"320508014"},{"id":"320508004"}]}]}]}] 注意:返回的为最新的四级地址版本(地址存储升级变更的可能,以最新的返回)
|
||||
ProvinceInfos []ProvinceInfosItem `json:"province_infos"`
|
||||
}
|
||||
|
||||
type Data struct {
|
||||
// 模板信息
|
||||
Template *Template `json:"template"`
|
||||
// 规则
|
||||
Columns []ColumnsItem `json:"columns"`
|
||||
}
|
||||
type FreightTemplateDetailData struct {
|
||||
// 模板详情
|
||||
Data *Data `json:"data"`
|
||||
}
|
||||
|
||||
type Template struct {
|
||||
// 模板id
|
||||
Id int64 `json:"id"`
|
||||
|
||||
@@ -56,6 +56,7 @@ import (
|
||||
warehouse_list_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_list/response"
|
||||
warehouse_setFence_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_setFence/request"
|
||||
warehouse_unbindStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_unbindStore/request"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
)
|
||||
|
||||
//GetStoreDetail 单个获取门店信息
|
||||
@@ -261,11 +262,13 @@ func (a *API) StoreQuerySaleLimitTemp(storeId int64) (int64, error) {
|
||||
func (a *API) FreightTemplateCreate(param *freightTemplate_create_request.FreightTemplateCreateParam) (*freightTemplate_create_response.FreightTemplateCreateData, error) {
|
||||
request := freightTemplate_create_request.New()
|
||||
request.Param = param
|
||||
globals.SugarLogger.Debugf("创建运费模板参数====%v", param)
|
||||
response, err := request.Execute(a.accessTokenObj)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if response.Code != RequestSuccessCode {
|
||||
globals.SugarLogger.Debugf("创建门店运费模板错误信息====%v", errors.New(response.SubMsg))
|
||||
return nil, errors.New(response.Msg + "," + response.SubMsg)
|
||||
}
|
||||
return response.Data, nil
|
||||
@@ -308,6 +311,7 @@ func (a *API) GetStoreFreight(storeId int64) ([]int64, error) {
|
||||
return nil, err
|
||||
}
|
||||
if result.Code != RequestSuccessCode {
|
||||
globals.SugarLogger.Debugf("获取门店运费模板错误信息====%v", errors.New(result.SubMsg))
|
||||
return nil, errors.New(result.SubMsg)
|
||||
}
|
||||
tempList := make([]int64, 0)
|
||||
@@ -324,6 +328,7 @@ func (a *API) GetStoreFreight(storeId int64) ([]int64, error) {
|
||||
//获取运费模板详情
|
||||
func (a *API) GetStoreFreightDetail(freightId int64) (*freightTemplate_detail_response.Data, error) {
|
||||
request := freightTemplate_detail_request.New()
|
||||
request.Param.FreightId = freightId
|
||||
result, err := request.Execute(a.accessTokenObj)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user