-
Notifications
You must be signed in to change notification settings - Fork 9
/
TaobaoTradesSimpleSoldGetAPIRequest.go
274 lines (237 loc) · 13 KB
/
TaobaoTradesSimpleSoldGetAPIRequest.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
271
272
273
274
package trade
import (
"net/url"
"sync"
"github.com/bububa/opentaobao/model"
)
// TaobaoTradesSimpleSoldGetAPIRequest 查询卖家已卖出的交易简易数据 API请求
// taobao.trades.simple.sold.get
//
// 搜索当前会话用户作为卖家已卖出的交易数据(只能获取到三个月以内的交易信息)
// <br/>1. 返回的数据结果是以订单的创建时间倒序排列的。
// <br/>2. 返回的数据结果只包含了订单的部分数据,可通过taobao.trade.simple.get获取订单信息。
// <br/>注意:type字段的说明,如果该字段不传,接口默认只查4种类型订单,非默认查询的订单是不返回。遇到订单查不到的情况的,解决办法就是type加上订单类型就可正常返回了。
// <br/><strong><a href="https://console.open.taobao.com/dingWeb.htm?from=tradeapi" target="_blank">点击查看更多交易API说明</a></strong>
type TaobaoTradesSimpleSoldGetAPIRequest struct {
model.Params
// 需要返回的字段列表,多个字段用半角逗号分隔,可选值为返回示例中能看到的所有字段。rx_audit_status=0,处方药未审核
_fields string
// 查询三个月内交易创建时间开始。格式:yyyy-MM-dd HH:mm:ss
_startCreated string
// 查询交易创建时间结束。格式:yyyy-MM-dd HH:mm:ss
_endCreated string
// 交易状态(<a href="http://open.taobao.com/doc/detail.htm?id=102856" target="_blank">查看可选值</a>),默认查询所有交易状态的数据,除了默认值外每次只能查询一种状态。
_status string
// 买家昵称
_buyerNick string
// 交易类型列表,同时查询多种交易类型可用逗号分隔。<span style="color:red;font-weight: bold;">默认同时查询guarantee_trade,auto_delivery,ec,cod,step 这5 种的交易类型的数据;查询所有交易类型的数据,需要设置下面全部可选值。</span>可选值:fixed(一口价)auction(拍卖)guarantee_trade(一口价、拍卖)step(分阶段付款,万人团,阶梯团订单)independent_simple_trade(旺店入门版交易)independent_shop_trade(旺店标准版交易)auto_delivery(自动发货)ec(直冲)cod(货到付款)game_equipment(游戏装备)shopex_trade(ShopEX交易)netcn_trade(万网交易)external_trade(统一外部交易)instant_trade (即时到账)b2c_cod(大商家货到付款)hotel_trade(酒店类型交易)super_market_trade(商超交易)super_market_cod_trade(商超货到付款交易)taohua(淘花网交易类型)waimai(外卖交易类型)o2o_offlinetrade(O2O交易)nopaid(即时到帐/趣味猜交易类型)step (万人团) eticket(电子凭证) tmall_i18n(天猫国际);nopaid (无付款交易)insurance_plus(保险)finance(基金)注:guarantee_trade是一个组合查询条件,并不是一种交易类型,获取批量或单个订单中不会返回此种类型的订单。pre_auth_type(预授权0元购) lazada(获取lazada订单类型)
_type string
// 可选值有ershou(二手市场的订单),service(商城服务子订单)mark(双十一大促活动异常订单)作为扩展类型筛选只能做单个ext_type查询,不能全部查询所有的ext_type类型
_extType string
// 评价状态,默认查询所有评价状态的数据,除了默认值外每次只能查询一种状态。<br>可选值:RATE_UNBUYER(买家未评)RATE_UNSELLER(卖家未评)RATE_BUYER_UNSELLER(买家已评,卖家未评)RATE_UNBUYER_SELLER(买家未评,卖家已评)RATE_BUYER_SELLER(买家已评,卖家已评)
_rateStatus string
// 卖家对交易的自定义分组标签,目前可选值为:time_card(点卡软件代充),fee_card(话费软件代充)
_tag string
// 买家的openId
_buyerOpenId string
// 页码。默认值:1,可填整数,通过传入page_no来控制获取的页数,总页数=total_results÷page_size
_pageNo int64
// 每页条数。 默认值:40;最大值:100,可填整数。通过page_no和page_size组合多次调用实现翻页获取全量数据。
_pageSize int64
// 是否启用has_next的分页方式,如果指定true,则返回的结果中不包含总记录数,但是会新增一个是否存在下一页的的字段,通过此种方式获取增量交易,接口调用成功率在原有的基础上有所提升。
_useHasNext bool
}
// NewTaobaoTradesSimpleSoldGetRequest 初始化TaobaoTradesSimpleSoldGetAPIRequest对象
func NewTaobaoTradesSimpleSoldGetRequest() *TaobaoTradesSimpleSoldGetAPIRequest {
return &TaobaoTradesSimpleSoldGetAPIRequest{
Params: model.NewParams(13),
}
}
// Reset IRequest interface 方法, 清空结构体
func (r *TaobaoTradesSimpleSoldGetAPIRequest) Reset() {
r._fields = ""
r._startCreated = ""
r._endCreated = ""
r._status = ""
r._buyerNick = ""
r._type = ""
r._extType = ""
r._rateStatus = ""
r._tag = ""
r._buyerOpenId = ""
r._pageNo = 0
r._pageSize = 0
r._useHasNext = false
r.Params.ToZero()
}
// GetApiMethodName IRequest interface 方法, 获取Api method
func (r TaobaoTradesSimpleSoldGetAPIRequest) GetApiMethodName() string {
return "taobao.trades.simple.sold.get"
}
// GetApiParams IRequest interface 方法, 获取API参数
func (r TaobaoTradesSimpleSoldGetAPIRequest) GetApiParams(params url.Values) {
for k, v := range r.Params {
params.Set(k, v.String())
}
}
// GetRawParams IRequest interface 方法, 获取API原始参数
func (r TaobaoTradesSimpleSoldGetAPIRequest) GetRawParams() model.Params {
return r.Params
}
// SetFields is Fields Setter
// 需要返回的字段列表,多个字段用半角逗号分隔,可选值为返回示例中能看到的所有字段。rx_audit_status=0,处方药未审核
func (r *TaobaoTradesSimpleSoldGetAPIRequest) SetFields(_fields string) error {
r._fields = _fields
r.Set("fields", _fields)
return nil
}
// GetFields Fields Getter
func (r TaobaoTradesSimpleSoldGetAPIRequest) GetFields() string {
return r._fields
}
// SetStartCreated is StartCreated Setter
// 查询三个月内交易创建时间开始。格式:yyyy-MM-dd HH:mm:ss
func (r *TaobaoTradesSimpleSoldGetAPIRequest) SetStartCreated(_startCreated string) error {
r._startCreated = _startCreated
r.Set("start_created", _startCreated)
return nil
}
// GetStartCreated StartCreated Getter
func (r TaobaoTradesSimpleSoldGetAPIRequest) GetStartCreated() string {
return r._startCreated
}
// SetEndCreated is EndCreated Setter
// 查询交易创建时间结束。格式:yyyy-MM-dd HH:mm:ss
func (r *TaobaoTradesSimpleSoldGetAPIRequest) SetEndCreated(_endCreated string) error {
r._endCreated = _endCreated
r.Set("end_created", _endCreated)
return nil
}
// GetEndCreated EndCreated Getter
func (r TaobaoTradesSimpleSoldGetAPIRequest) GetEndCreated() string {
return r._endCreated
}
// SetStatus is Status Setter
// 交易状态(<a href="http://open.taobao.com/doc/detail.htm?id=102856" target="_blank">查看可选值</a>),默认查询所有交易状态的数据,除了默认值外每次只能查询一种状态。
func (r *TaobaoTradesSimpleSoldGetAPIRequest) SetStatus(_status string) error {
r._status = _status
r.Set("status", _status)
return nil
}
// GetStatus Status Getter
func (r TaobaoTradesSimpleSoldGetAPIRequest) GetStatus() string {
return r._status
}
// SetBuyerNick is BuyerNick Setter
// 买家昵称
func (r *TaobaoTradesSimpleSoldGetAPIRequest) SetBuyerNick(_buyerNick string) error {
r._buyerNick = _buyerNick
r.Set("buyer_nick", _buyerNick)
return nil
}
// GetBuyerNick BuyerNick Getter
func (r TaobaoTradesSimpleSoldGetAPIRequest) GetBuyerNick() string {
return r._buyerNick
}
// SetType is Type Setter
// 交易类型列表,同时查询多种交易类型可用逗号分隔。<span style="color:red;font-weight: bold;">默认同时查询guarantee_trade,auto_delivery,ec,cod,step 这5 种的交易类型的数据;查询所有交易类型的数据,需要设置下面全部可选值。</span>可选值:fixed(一口价)auction(拍卖)guarantee_trade(一口价、拍卖)step(分阶段付款,万人团,阶梯团订单)independent_simple_trade(旺店入门版交易)independent_shop_trade(旺店标准版交易)auto_delivery(自动发货)ec(直冲)cod(货到付款)game_equipment(游戏装备)shopex_trade(ShopEX交易)netcn_trade(万网交易)external_trade(统一外部交易)instant_trade (即时到账)b2c_cod(大商家货到付款)hotel_trade(酒店类型交易)super_market_trade(商超交易)super_market_cod_trade(商超货到付款交易)taohua(淘花网交易类型)waimai(外卖交易类型)o2o_offlinetrade(O2O交易)nopaid(即时到帐/趣味猜交易类型)step (万人团) eticket(电子凭证) tmall_i18n(天猫国际);nopaid (无付款交易)insurance_plus(保险)finance(基金)注:guarantee_trade是一个组合查询条件,并不是一种交易类型,获取批量或单个订单中不会返回此种类型的订单。pre_auth_type(预授权0元购) lazada(获取lazada订单类型)
func (r *TaobaoTradesSimpleSoldGetAPIRequest) SetType(_type string) error {
r._type = _type
r.Set("type", _type)
return nil
}
// GetType Type Getter
func (r TaobaoTradesSimpleSoldGetAPIRequest) GetType() string {
return r._type
}
// SetExtType is ExtType Setter
// 可选值有ershou(二手市场的订单),service(商城服务子订单)mark(双十一大促活动异常订单)作为扩展类型筛选只能做单个ext_type查询,不能全部查询所有的ext_type类型
func (r *TaobaoTradesSimpleSoldGetAPIRequest) SetExtType(_extType string) error {
r._extType = _extType
r.Set("ext_type", _extType)
return nil
}
// GetExtType ExtType Getter
func (r TaobaoTradesSimpleSoldGetAPIRequest) GetExtType() string {
return r._extType
}
// SetRateStatus is RateStatus Setter
// 评价状态,默认查询所有评价状态的数据,除了默认值外每次只能查询一种状态。<br>可选值:RATE_UNBUYER(买家未评)RATE_UNSELLER(卖家未评)RATE_BUYER_UNSELLER(买家已评,卖家未评)RATE_UNBUYER_SELLER(买家未评,卖家已评)RATE_BUYER_SELLER(买家已评,卖家已评)
func (r *TaobaoTradesSimpleSoldGetAPIRequest) SetRateStatus(_rateStatus string) error {
r._rateStatus = _rateStatus
r.Set("rate_status", _rateStatus)
return nil
}
// GetRateStatus RateStatus Getter
func (r TaobaoTradesSimpleSoldGetAPIRequest) GetRateStatus() string {
return r._rateStatus
}
// SetTag is Tag Setter
// 卖家对交易的自定义分组标签,目前可选值为:time_card(点卡软件代充),fee_card(话费软件代充)
func (r *TaobaoTradesSimpleSoldGetAPIRequest) SetTag(_tag string) error {
r._tag = _tag
r.Set("tag", _tag)
return nil
}
// GetTag Tag Getter
func (r TaobaoTradesSimpleSoldGetAPIRequest) GetTag() string {
return r._tag
}
// SetBuyerOpenId is BuyerOpenId Setter
// 买家的openId
func (r *TaobaoTradesSimpleSoldGetAPIRequest) SetBuyerOpenId(_buyerOpenId string) error {
r._buyerOpenId = _buyerOpenId
r.Set("buyer_open_id", _buyerOpenId)
return nil
}
// GetBuyerOpenId BuyerOpenId Getter
func (r TaobaoTradesSimpleSoldGetAPIRequest) GetBuyerOpenId() string {
return r._buyerOpenId
}
// SetPageNo is PageNo Setter
// 页码。默认值:1,可填整数,通过传入page_no来控制获取的页数,总页数=total_results÷page_size
func (r *TaobaoTradesSimpleSoldGetAPIRequest) SetPageNo(_pageNo int64) error {
r._pageNo = _pageNo
r.Set("page_no", _pageNo)
return nil
}
// GetPageNo PageNo Getter
func (r TaobaoTradesSimpleSoldGetAPIRequest) GetPageNo() int64 {
return r._pageNo
}
// SetPageSize is PageSize Setter
// 每页条数。 默认值:40;最大值:100,可填整数。通过page_no和page_size组合多次调用实现翻页获取全量数据。
func (r *TaobaoTradesSimpleSoldGetAPIRequest) SetPageSize(_pageSize int64) error {
r._pageSize = _pageSize
r.Set("page_size", _pageSize)
return nil
}
// GetPageSize PageSize Getter
func (r TaobaoTradesSimpleSoldGetAPIRequest) GetPageSize() int64 {
return r._pageSize
}
// SetUseHasNext is UseHasNext Setter
// 是否启用has_next的分页方式,如果指定true,则返回的结果中不包含总记录数,但是会新增一个是否存在下一页的的字段,通过此种方式获取增量交易,接口调用成功率在原有的基础上有所提升。
func (r *TaobaoTradesSimpleSoldGetAPIRequest) SetUseHasNext(_useHasNext bool) error {
r._useHasNext = _useHasNext
r.Set("use_has_next", _useHasNext)
return nil
}
// GetUseHasNext UseHasNext Getter
func (r TaobaoTradesSimpleSoldGetAPIRequest) GetUseHasNext() bool {
return r._useHasNext
}
var poolTaobaoTradesSimpleSoldGetAPIRequest = sync.Pool{
New: func() any {
return NewTaobaoTradesSimpleSoldGetRequest()
},
}
// GetTaobaoTradesSimpleSoldGetRequest 从 sync.Pool 获取 TaobaoTradesSimpleSoldGetAPIRequest
func GetTaobaoTradesSimpleSoldGetAPIRequest() *TaobaoTradesSimpleSoldGetAPIRequest {
return poolTaobaoTradesSimpleSoldGetAPIRequest.Get().(*TaobaoTradesSimpleSoldGetAPIRequest)
}
// ReleaseTaobaoTradesSimpleSoldGetAPIRequest 将 TaobaoTradesSimpleSoldGetAPIRequest 放入 sync.Pool
func ReleaseTaobaoTradesSimpleSoldGetAPIRequest(v *TaobaoTradesSimpleSoldGetAPIRequest) {
v.Reset()
poolTaobaoTradesSimpleSoldGetAPIRequest.Put(v)
}