-
Notifications
You must be signed in to change notification settings - Fork 9
/
CainiaoGlobalHandoverSavedraftAPIRequest.go
206 lines (177 loc) · 5.84 KB
/
CainiaoGlobalHandoverSavedraftAPIRequest.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
package cainiaohandover
import (
"net/url"
"sync"
"github.com/bububa/opentaobao/model"
)
// CainiaoGlobalHandoverSavedraftAPIRequest 创建交接单草稿 API请求
// cainiao.global.handover.savedraft
//
// 提供给ISV通过该接口创建交接单草稿
type CainiaoGlobalHandoverSavedraftAPIRequest struct {
model.Params
// 需要组装大包的小包编码集合,最多限制200个小包
_orderCodeList []string
// 备注
_remark string
// 重量单位,克:g, 千克:kg,默认g
_weightUnit string
// 客户端名称,ISV:ISV-ISV英文或拼音名称、商家ERP:SELLER-商家英文或拼音名称
_client string
// 多语言
_locale string
// 用户信息
_userInfo *UserInfoDto
// 大包重量
_weight int64
// 揽收信息
_pickupInfo *PickupDto
// 退件信息
_returnInfo *ReturnerDto
}
// NewCainiaoGlobalHandoverSavedraftRequest 初始化CainiaoGlobalHandoverSavedraftAPIRequest对象
func NewCainiaoGlobalHandoverSavedraftRequest() *CainiaoGlobalHandoverSavedraftAPIRequest {
return &CainiaoGlobalHandoverSavedraftAPIRequest{
Params: model.NewParams(9),
}
}
// Reset IRequest interface 方法, 清空结构体
func (r *CainiaoGlobalHandoverSavedraftAPIRequest) Reset() {
r._orderCodeList = r._orderCodeList[:0]
r._remark = ""
r._weightUnit = ""
r._client = ""
r._locale = ""
r._userInfo = nil
r._weight = 0
r._pickupInfo = nil
r._returnInfo = nil
r.Params.ToZero()
}
// GetApiMethodName IRequest interface 方法, 获取Api method
func (r CainiaoGlobalHandoverSavedraftAPIRequest) GetApiMethodName() string {
return "cainiao.global.handover.savedraft"
}
// GetApiParams IRequest interface 方法, 获取API参数
func (r CainiaoGlobalHandoverSavedraftAPIRequest) GetApiParams(params url.Values) {
for k, v := range r.Params {
params.Set(k, v.String())
}
}
// GetRawParams IRequest interface 方法, 获取API原始参数
func (r CainiaoGlobalHandoverSavedraftAPIRequest) GetRawParams() model.Params {
return r.Params
}
// SetOrderCodeList is OrderCodeList Setter
// 需要组装大包的小包编码集合,最多限制200个小包
func (r *CainiaoGlobalHandoverSavedraftAPIRequest) SetOrderCodeList(_orderCodeList []string) error {
r._orderCodeList = _orderCodeList
r.Set("order_code_list", _orderCodeList)
return nil
}
// GetOrderCodeList OrderCodeList Getter
func (r CainiaoGlobalHandoverSavedraftAPIRequest) GetOrderCodeList() []string {
return r._orderCodeList
}
// SetRemark is Remark Setter
// 备注
func (r *CainiaoGlobalHandoverSavedraftAPIRequest) SetRemark(_remark string) error {
r._remark = _remark
r.Set("remark", _remark)
return nil
}
// GetRemark Remark Getter
func (r CainiaoGlobalHandoverSavedraftAPIRequest) GetRemark() string {
return r._remark
}
// SetWeightUnit is WeightUnit Setter
// 重量单位,克:g, 千克:kg,默认g
func (r *CainiaoGlobalHandoverSavedraftAPIRequest) SetWeightUnit(_weightUnit string) error {
r._weightUnit = _weightUnit
r.Set("weight_unit", _weightUnit)
return nil
}
// GetWeightUnit WeightUnit Getter
func (r CainiaoGlobalHandoverSavedraftAPIRequest) GetWeightUnit() string {
return r._weightUnit
}
// SetClient is Client Setter
// 客户端名称,ISV:ISV-ISV英文或拼音名称、商家ERP:SELLER-商家英文或拼音名称
func (r *CainiaoGlobalHandoverSavedraftAPIRequest) SetClient(_client string) error {
r._client = _client
r.Set("client", _client)
return nil
}
// GetClient Client Getter
func (r CainiaoGlobalHandoverSavedraftAPIRequest) GetClient() string {
return r._client
}
// SetLocale is Locale Setter
// 多语言
func (r *CainiaoGlobalHandoverSavedraftAPIRequest) SetLocale(_locale string) error {
r._locale = _locale
r.Set("locale", _locale)
return nil
}
// GetLocale Locale Getter
func (r CainiaoGlobalHandoverSavedraftAPIRequest) GetLocale() string {
return r._locale
}
// SetUserInfo is UserInfo Setter
// 用户信息
func (r *CainiaoGlobalHandoverSavedraftAPIRequest) SetUserInfo(_userInfo *UserInfoDto) error {
r._userInfo = _userInfo
r.Set("user_info", _userInfo)
return nil
}
// GetUserInfo UserInfo Getter
func (r CainiaoGlobalHandoverSavedraftAPIRequest) GetUserInfo() *UserInfoDto {
return r._userInfo
}
// SetWeight is Weight Setter
// 大包重量
func (r *CainiaoGlobalHandoverSavedraftAPIRequest) SetWeight(_weight int64) error {
r._weight = _weight
r.Set("weight", _weight)
return nil
}
// GetWeight Weight Getter
func (r CainiaoGlobalHandoverSavedraftAPIRequest) GetWeight() int64 {
return r._weight
}
// SetPickupInfo is PickupInfo Setter
// 揽收信息
func (r *CainiaoGlobalHandoverSavedraftAPIRequest) SetPickupInfo(_pickupInfo *PickupDto) error {
r._pickupInfo = _pickupInfo
r.Set("pickup_info", _pickupInfo)
return nil
}
// GetPickupInfo PickupInfo Getter
func (r CainiaoGlobalHandoverSavedraftAPIRequest) GetPickupInfo() *PickupDto {
return r._pickupInfo
}
// SetReturnInfo is ReturnInfo Setter
// 退件信息
func (r *CainiaoGlobalHandoverSavedraftAPIRequest) SetReturnInfo(_returnInfo *ReturnerDto) error {
r._returnInfo = _returnInfo
r.Set("return_info", _returnInfo)
return nil
}
// GetReturnInfo ReturnInfo Getter
func (r CainiaoGlobalHandoverSavedraftAPIRequest) GetReturnInfo() *ReturnerDto {
return r._returnInfo
}
var poolCainiaoGlobalHandoverSavedraftAPIRequest = sync.Pool{
New: func() any {
return NewCainiaoGlobalHandoverSavedraftRequest()
},
}
// GetCainiaoGlobalHandoverSavedraftRequest 从 sync.Pool 获取 CainiaoGlobalHandoverSavedraftAPIRequest
func GetCainiaoGlobalHandoverSavedraftAPIRequest() *CainiaoGlobalHandoverSavedraftAPIRequest {
return poolCainiaoGlobalHandoverSavedraftAPIRequest.Get().(*CainiaoGlobalHandoverSavedraftAPIRequest)
}
// ReleaseCainiaoGlobalHandoverSavedraftAPIRequest 将 CainiaoGlobalHandoverSavedraftAPIRequest 放入 sync.Pool
func ReleaseCainiaoGlobalHandoverSavedraftAPIRequest(v *CainiaoGlobalHandoverSavedraftAPIRequest) {
v.Reset()
poolCainiaoGlobalHandoverSavedraftAPIRequest.Put(v)
}