-
Notifications
You must be signed in to change notification settings - Fork 9
/
TaobaoBusHistoryorderGetAPIRequest.go
142 lines (121 loc) · 3.85 KB
/
TaobaoBusHistoryorderGetAPIRequest.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
package bus
import (
"net/url"
"sync"
"github.com/bububa/opentaobao/model"
)
// TaobaoBusHistoryorderGetAPIRequest 历史订单查询(对账) API请求
// taobao.bus.historyorder.get
//
// 历史订单查询,对账接口
type TaobaoBusHistoryorderGetAPIRequest struct {
model.Params
// 开始时间 2017-04-23 13:33:43
_fromDate string
// 结束时间 2017-04-23 13:33:43
_toDate string
// offline_ticket 线下自助机; online_ticket:线上售票; 空 代表查全部
_type string
// 分页大小 不超过1w
_pageSize int64
// 第几页 从1开始
_pageIndex int64
}
// NewTaobaoBusHistoryorderGetRequest 初始化TaobaoBusHistoryorderGetAPIRequest对象
func NewTaobaoBusHistoryorderGetRequest() *TaobaoBusHistoryorderGetAPIRequest {
return &TaobaoBusHistoryorderGetAPIRequest{
Params: model.NewParams(5),
}
}
// Reset IRequest interface 方法, 清空结构体
func (r *TaobaoBusHistoryorderGetAPIRequest) Reset() {
r._fromDate = ""
r._toDate = ""
r._type = ""
r._pageSize = 0
r._pageIndex = 0
r.Params.ToZero()
}
// GetApiMethodName IRequest interface 方法, 获取Api method
func (r TaobaoBusHistoryorderGetAPIRequest) GetApiMethodName() string {
return "taobao.bus.historyorder.get"
}
// GetApiParams IRequest interface 方法, 获取API参数
func (r TaobaoBusHistoryorderGetAPIRequest) GetApiParams(params url.Values) {
for k, v := range r.Params {
params.Set(k, v.String())
}
}
// GetRawParams IRequest interface 方法, 获取API原始参数
func (r TaobaoBusHistoryorderGetAPIRequest) GetRawParams() model.Params {
return r.Params
}
// SetFromDate is FromDate Setter
// 开始时间 2017-04-23 13:33:43
func (r *TaobaoBusHistoryorderGetAPIRequest) SetFromDate(_fromDate string) error {
r._fromDate = _fromDate
r.Set("from_date", _fromDate)
return nil
}
// GetFromDate FromDate Getter
func (r TaobaoBusHistoryorderGetAPIRequest) GetFromDate() string {
return r._fromDate
}
// SetToDate is ToDate Setter
// 结束时间 2017-04-23 13:33:43
func (r *TaobaoBusHistoryorderGetAPIRequest) SetToDate(_toDate string) error {
r._toDate = _toDate
r.Set("to_date", _toDate)
return nil
}
// GetToDate ToDate Getter
func (r TaobaoBusHistoryorderGetAPIRequest) GetToDate() string {
return r._toDate
}
// SetType is Type Setter
// offline_ticket 线下自助机; online_ticket:线上售票; 空 代表查全部
func (r *TaobaoBusHistoryorderGetAPIRequest) SetType(_type string) error {
r._type = _type
r.Set("type", _type)
return nil
}
// GetType Type Getter
func (r TaobaoBusHistoryorderGetAPIRequest) GetType() string {
return r._type
}
// SetPageSize is PageSize Setter
// 分页大小 不超过1w
func (r *TaobaoBusHistoryorderGetAPIRequest) SetPageSize(_pageSize int64) error {
r._pageSize = _pageSize
r.Set("page_size", _pageSize)
return nil
}
// GetPageSize PageSize Getter
func (r TaobaoBusHistoryorderGetAPIRequest) GetPageSize() int64 {
return r._pageSize
}
// SetPageIndex is PageIndex Setter
// 第几页 从1开始
func (r *TaobaoBusHistoryorderGetAPIRequest) SetPageIndex(_pageIndex int64) error {
r._pageIndex = _pageIndex
r.Set("page_index", _pageIndex)
return nil
}
// GetPageIndex PageIndex Getter
func (r TaobaoBusHistoryorderGetAPIRequest) GetPageIndex() int64 {
return r._pageIndex
}
var poolTaobaoBusHistoryorderGetAPIRequest = sync.Pool{
New: func() any {
return NewTaobaoBusHistoryorderGetRequest()
},
}
// GetTaobaoBusHistoryorderGetRequest 从 sync.Pool 获取 TaobaoBusHistoryorderGetAPIRequest
func GetTaobaoBusHistoryorderGetAPIRequest() *TaobaoBusHistoryorderGetAPIRequest {
return poolTaobaoBusHistoryorderGetAPIRequest.Get().(*TaobaoBusHistoryorderGetAPIRequest)
}
// ReleaseTaobaoBusHistoryorderGetAPIRequest 将 TaobaoBusHistoryorderGetAPIRequest 放入 sync.Pool
func ReleaseTaobaoBusHistoryorderGetAPIRequest(v *TaobaoBusHistoryorderGetAPIRequest) {
v.Reset()
poolTaobaoBusHistoryorderGetAPIRequest.Put(v)
}