-
Notifications
You must be signed in to change notification settings - Fork 9
/
AliexpressAffiliateFeaturedpromoProductsGetAPIRequest.go
270 lines (233 loc) · 9.95 KB
/
AliexpressAffiliateFeaturedpromoProductsGetAPIRequest.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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
package aecreatives
import (
"net/url"
"sync"
"github.com/bububa/opentaobao/model"
)
// AliexpressAffiliateFeaturedpromoProductsGetAPIRequest 联盟主题推广活动商品信息获取 API请求
// aliexpress.affiliate.featuredpromo.products.get
//
// 根据联盟主题推广活动或主题品库查询对应的商品。如下品库为固定品库,可长期调用。品库类型和名称如下:高佣品(Hot Product)、新品(New Arrival)、热销商品(Best Seller)、每周尖货(weeklydeals)
type AliexpressAffiliateFeaturedpromoProductsGetAPIRequest struct {
model.Params
// 请求签名
_appSignature string
// 类目 ID 如何获取category_id,请参考,https://open.taobao.com/api.htm?docId=45801&docType=2&scopeId=17063
_categoryId string
// 返回字段列表
_fields string
// 活动结束时间,PST 时区
_promotionEndTime string
// 主题活动的名称,如何获取主题活动,请参考"get featuredpromo info" API. 固定主题:高佣品(Hot Product)、新品(New Arrival)、热销商品(Best Seller)、每周尖货(weeklydeals)
_promotionName string
// 活动开始时间,PST 时区
_promotionStartTime string
// 排序方式:commissionAsc,commissionDesc, priceAsc,priceDesc,volumeAsc、volumeDesc, discountAsc, discountDesc, ratingAsc,ratingDesc, promotionTimeAsc, pr
_sort string
// 目标币种,可根据目标币种返回对应币种:USD, GBP, CAD, EUR, UAH, MXN, TRY, RUB, BRL, AUD, INR, JPY, IDR, SEK,KRW
_targetCurrency string
// 目标语言,可根据目标语言返回对应语言:EN,RU,PT,ES,FR,ID,IT,TH,JA,AR,VI,TR,DE,HE,KO,NL,PL,MX,CL,IN
_targetLanguage string
// trackingID
_trackingId string
// 商品收货国家,可筛选能销售至该国家的商品,并根据该国家税率政策返回对应商品价格
_country string
// 查询页码
_pageNo int64
// 每页记录数,1-50
_pageSize int64
}
// NewAliexpressAffiliateFeaturedpromoProductsGetRequest 初始化AliexpressAffiliateFeaturedpromoProductsGetAPIRequest对象
func NewAliexpressAffiliateFeaturedpromoProductsGetRequest() *AliexpressAffiliateFeaturedpromoProductsGetAPIRequest {
return &AliexpressAffiliateFeaturedpromoProductsGetAPIRequest{
Params: model.NewParams(13),
}
}
// Reset IRequest interface 方法, 清空结构体
func (r *AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) Reset() {
r._appSignature = ""
r._categoryId = ""
r._fields = ""
r._promotionEndTime = ""
r._promotionName = ""
r._promotionStartTime = ""
r._sort = ""
r._targetCurrency = ""
r._targetLanguage = ""
r._trackingId = ""
r._country = ""
r._pageNo = 0
r._pageSize = 0
r.Params.ToZero()
}
// GetApiMethodName IRequest interface 方法, 获取Api method
func (r AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) GetApiMethodName() string {
return "aliexpress.affiliate.featuredpromo.products.get"
}
// GetApiParams IRequest interface 方法, 获取API参数
func (r AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) GetApiParams(params url.Values) {
for k, v := range r.Params {
params.Set(k, v.String())
}
}
// GetRawParams IRequest interface 方法, 获取API原始参数
func (r AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) GetRawParams() model.Params {
return r.Params
}
// SetAppSignature is AppSignature Setter
// 请求签名
func (r *AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) SetAppSignature(_appSignature string) error {
r._appSignature = _appSignature
r.Set("app_signature", _appSignature)
return nil
}
// GetAppSignature AppSignature Getter
func (r AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) GetAppSignature() string {
return r._appSignature
}
// SetCategoryId is CategoryId Setter
// 类目 ID 如何获取category_id,请参考,https://open.taobao.com/api.htm?docId=45801&docType=2&scopeId=17063
func (r *AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) SetCategoryId(_categoryId string) error {
r._categoryId = _categoryId
r.Set("category_id", _categoryId)
return nil
}
// GetCategoryId CategoryId Getter
func (r AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) GetCategoryId() string {
return r._categoryId
}
// SetFields is Fields Setter
// 返回字段列表
func (r *AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) SetFields(_fields string) error {
r._fields = _fields
r.Set("fields", _fields)
return nil
}
// GetFields Fields Getter
func (r AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) GetFields() string {
return r._fields
}
// SetPromotionEndTime is PromotionEndTime Setter
// 活动结束时间,PST 时区
func (r *AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) SetPromotionEndTime(_promotionEndTime string) error {
r._promotionEndTime = _promotionEndTime
r.Set("promotion_end_time", _promotionEndTime)
return nil
}
// GetPromotionEndTime PromotionEndTime Getter
func (r AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) GetPromotionEndTime() string {
return r._promotionEndTime
}
// SetPromotionName is PromotionName Setter
// 主题活动的名称,如何获取主题活动,请参考"get featuredpromo info" API. 固定主题:高佣品(Hot Product)、新品(New Arrival)、热销商品(Best Seller)、每周尖货(weeklydeals)
func (r *AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) SetPromotionName(_promotionName string) error {
r._promotionName = _promotionName
r.Set("promotion_name", _promotionName)
return nil
}
// GetPromotionName PromotionName Getter
func (r AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) GetPromotionName() string {
return r._promotionName
}
// SetPromotionStartTime is PromotionStartTime Setter
// 活动开始时间,PST 时区
func (r *AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) SetPromotionStartTime(_promotionStartTime string) error {
r._promotionStartTime = _promotionStartTime
r.Set("promotion_start_time", _promotionStartTime)
return nil
}
// GetPromotionStartTime PromotionStartTime Getter
func (r AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) GetPromotionStartTime() string {
return r._promotionStartTime
}
// SetSort is Sort Setter
// 排序方式:commissionAsc,commissionDesc, priceAsc,priceDesc,volumeAsc、volumeDesc, discountAsc, discountDesc, ratingAsc,ratingDesc, promotionTimeAsc, pr
func (r *AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) SetSort(_sort string) error {
r._sort = _sort
r.Set("sort", _sort)
return nil
}
// GetSort Sort Getter
func (r AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) GetSort() string {
return r._sort
}
// SetTargetCurrency is TargetCurrency Setter
// 目标币种,可根据目标币种返回对应币种:USD, GBP, CAD, EUR, UAH, MXN, TRY, RUB, BRL, AUD, INR, JPY, IDR, SEK,KRW
func (r *AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) SetTargetCurrency(_targetCurrency string) error {
r._targetCurrency = _targetCurrency
r.Set("target_currency", _targetCurrency)
return nil
}
// GetTargetCurrency TargetCurrency Getter
func (r AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) GetTargetCurrency() string {
return r._targetCurrency
}
// SetTargetLanguage is TargetLanguage Setter
// 目标语言,可根据目标语言返回对应语言:EN,RU,PT,ES,FR,ID,IT,TH,JA,AR,VI,TR,DE,HE,KO,NL,PL,MX,CL,IN
func (r *AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) SetTargetLanguage(_targetLanguage string) error {
r._targetLanguage = _targetLanguage
r.Set("target_language", _targetLanguage)
return nil
}
// GetTargetLanguage TargetLanguage Getter
func (r AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) GetTargetLanguage() string {
return r._targetLanguage
}
// SetTrackingId is TrackingId Setter
// trackingID
func (r *AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) SetTrackingId(_trackingId string) error {
r._trackingId = _trackingId
r.Set("tracking_id", _trackingId)
return nil
}
// GetTrackingId TrackingId Getter
func (r AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) GetTrackingId() string {
return r._trackingId
}
// SetCountry is Country Setter
// 商品收货国家,可筛选能销售至该国家的商品,并根据该国家税率政策返回对应商品价格
func (r *AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) SetCountry(_country string) error {
r._country = _country
r.Set("country", _country)
return nil
}
// GetCountry Country Getter
func (r AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) GetCountry() string {
return r._country
}
// SetPageNo is PageNo Setter
// 查询页码
func (r *AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) SetPageNo(_pageNo int64) error {
r._pageNo = _pageNo
r.Set("page_no", _pageNo)
return nil
}
// GetPageNo PageNo Getter
func (r AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) GetPageNo() int64 {
return r._pageNo
}
// SetPageSize is PageSize Setter
// 每页记录数,1-50
func (r *AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) SetPageSize(_pageSize int64) error {
r._pageSize = _pageSize
r.Set("page_size", _pageSize)
return nil
}
// GetPageSize PageSize Getter
func (r AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) GetPageSize() int64 {
return r._pageSize
}
var poolAliexpressAffiliateFeaturedpromoProductsGetAPIRequest = sync.Pool{
New: func() any {
return NewAliexpressAffiliateFeaturedpromoProductsGetRequest()
},
}
// GetAliexpressAffiliateFeaturedpromoProductsGetRequest 从 sync.Pool 获取 AliexpressAffiliateFeaturedpromoProductsGetAPIRequest
func GetAliexpressAffiliateFeaturedpromoProductsGetAPIRequest() *AliexpressAffiliateFeaturedpromoProductsGetAPIRequest {
return poolAliexpressAffiliateFeaturedpromoProductsGetAPIRequest.Get().(*AliexpressAffiliateFeaturedpromoProductsGetAPIRequest)
}
// ReleaseAliexpressAffiliateFeaturedpromoProductsGetAPIRequest 将 AliexpressAffiliateFeaturedpromoProductsGetAPIRequest 放入 sync.Pool
func ReleaseAliexpressAffiliateFeaturedpromoProductsGetAPIRequest(v *AliexpressAffiliateFeaturedpromoProductsGetAPIRequest) {
v.Reset()
poolAliexpressAffiliateFeaturedpromoProductsGetAPIRequest.Put(v)
}