-
Notifications
You must be signed in to change notification settings - Fork 9
/
TaobaoBillBookBillsGetAPIRequest.go
174 lines (149 loc) · 5.3 KB
/
TaobaoBillBookBillsGetAPIRequest.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
package bill
import (
"net/url"
"sync"
"github.com/bububa/opentaobao/model"
)
// TaobaoBillBookBillsGetAPIRequest 查询虚拟账户明细数据(自研发商家专用) API请求
// taobao.bill.book.bills.get
//
// 查询虚拟账户明细数据
type TaobaoBillBookBillsGetAPIRequest struct {
model.Params
// 明细流水类型:流水类型:101、可用金充值;102、可用金扣除;103、冻结;104、解冻;105、冻结金充值;106、冻结金扣除
_journalTypes []int64
// 需要返回的字段:bid,account_id,journal_type,amount,book_time,description,gmt_create,gmt_modified ,如果不是以上字段将自动忽略
_fields string
// 记账结束时间,end_time与start_time相差不能超过30天
_endTime string
// 记账开始时间
_startTime string
// 虚拟账户科目编号
_accountId int64
// 页码,传入值为1代表第一页,传入值为2代表第二页,依此类推.默认返回的数据是从第一页开始
_pageNo int64
// 每页大小,建议40~100,不能超过100
_pageSize int64
}
// NewTaobaoBillBookBillsGetRequest 初始化TaobaoBillBookBillsGetAPIRequest对象
func NewTaobaoBillBookBillsGetRequest() *TaobaoBillBookBillsGetAPIRequest {
return &TaobaoBillBookBillsGetAPIRequest{
Params: model.NewParams(7),
}
}
// Reset IRequest interface 方法, 清空结构体
func (r *TaobaoBillBookBillsGetAPIRequest) Reset() {
r._journalTypes = r._journalTypes[:0]
r._fields = ""
r._endTime = ""
r._startTime = ""
r._accountId = 0
r._pageNo = 0
r._pageSize = 0
r.Params.ToZero()
}
// GetApiMethodName IRequest interface 方法, 获取Api method
func (r TaobaoBillBookBillsGetAPIRequest) GetApiMethodName() string {
return "taobao.bill.book.bills.get"
}
// GetApiParams IRequest interface 方法, 获取API参数
func (r TaobaoBillBookBillsGetAPIRequest) GetApiParams(params url.Values) {
for k, v := range r.Params {
params.Set(k, v.String())
}
}
// GetRawParams IRequest interface 方法, 获取API原始参数
func (r TaobaoBillBookBillsGetAPIRequest) GetRawParams() model.Params {
return r.Params
}
// SetJournalTypes is JournalTypes Setter
// 明细流水类型:流水类型:101、可用金充值;102、可用金扣除;103、冻结;104、解冻;105、冻结金充值;106、冻结金扣除
func (r *TaobaoBillBookBillsGetAPIRequest) SetJournalTypes(_journalTypes []int64) error {
r._journalTypes = _journalTypes
r.Set("journal_types", _journalTypes)
return nil
}
// GetJournalTypes JournalTypes Getter
func (r TaobaoBillBookBillsGetAPIRequest) GetJournalTypes() []int64 {
return r._journalTypes
}
// SetFields is Fields Setter
// 需要返回的字段:bid,account_id,journal_type,amount,book_time,description,gmt_create,gmt_modified ,如果不是以上字段将自动忽略
func (r *TaobaoBillBookBillsGetAPIRequest) SetFields(_fields string) error {
r._fields = _fields
r.Set("fields", _fields)
return nil
}
// GetFields Fields Getter
func (r TaobaoBillBookBillsGetAPIRequest) GetFields() string {
return r._fields
}
// SetEndTime is EndTime Setter
// 记账结束时间,end_time与start_time相差不能超过30天
func (r *TaobaoBillBookBillsGetAPIRequest) SetEndTime(_endTime string) error {
r._endTime = _endTime
r.Set("end_time", _endTime)
return nil
}
// GetEndTime EndTime Getter
func (r TaobaoBillBookBillsGetAPIRequest) GetEndTime() string {
return r._endTime
}
// SetStartTime is StartTime Setter
// 记账开始时间
func (r *TaobaoBillBookBillsGetAPIRequest) SetStartTime(_startTime string) error {
r._startTime = _startTime
r.Set("start_time", _startTime)
return nil
}
// GetStartTime StartTime Getter
func (r TaobaoBillBookBillsGetAPIRequest) GetStartTime() string {
return r._startTime
}
// SetAccountId is AccountId Setter
// 虚拟账户科目编号
func (r *TaobaoBillBookBillsGetAPIRequest) SetAccountId(_accountId int64) error {
r._accountId = _accountId
r.Set("account_id", _accountId)
return nil
}
// GetAccountId AccountId Getter
func (r TaobaoBillBookBillsGetAPIRequest) GetAccountId() int64 {
return r._accountId
}
// SetPageNo is PageNo Setter
// 页码,传入值为1代表第一页,传入值为2代表第二页,依此类推.默认返回的数据是从第一页开始
func (r *TaobaoBillBookBillsGetAPIRequest) SetPageNo(_pageNo int64) error {
r._pageNo = _pageNo
r.Set("page_no", _pageNo)
return nil
}
// GetPageNo PageNo Getter
func (r TaobaoBillBookBillsGetAPIRequest) GetPageNo() int64 {
return r._pageNo
}
// SetPageSize is PageSize Setter
// 每页大小,建议40~100,不能超过100
func (r *TaobaoBillBookBillsGetAPIRequest) SetPageSize(_pageSize int64) error {
r._pageSize = _pageSize
r.Set("page_size", _pageSize)
return nil
}
// GetPageSize PageSize Getter
func (r TaobaoBillBookBillsGetAPIRequest) GetPageSize() int64 {
return r._pageSize
}
var poolTaobaoBillBookBillsGetAPIRequest = sync.Pool{
New: func() any {
return NewTaobaoBillBookBillsGetRequest()
},
}
// GetTaobaoBillBookBillsGetRequest 从 sync.Pool 获取 TaobaoBillBookBillsGetAPIRequest
func GetTaobaoBillBookBillsGetAPIRequest() *TaobaoBillBookBillsGetAPIRequest {
return poolTaobaoBillBookBillsGetAPIRequest.Get().(*TaobaoBillBookBillsGetAPIRequest)
}
// ReleaseTaobaoBillBookBillsGetAPIRequest 将 TaobaoBillBookBillsGetAPIRequest 放入 sync.Pool
func ReleaseTaobaoBillBookBillsGetAPIRequest(v *TaobaoBillBookBillsGetAPIRequest) {
v.Reset()
poolTaobaoBillBookBillsGetAPIRequest.Put(v)
}