-
Notifications
You must be signed in to change notification settings - Fork 12
/
TaobaoSellercenterSubusersPageAPIRequest.go
126 lines (107 loc) · 3.88 KB
/
TaobaoSellercenterSubusersPageAPIRequest.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
package subuser
import (
"net/url"
"sync"
"github.com/bububa/opentaobao/model"
)
// TaobaoSellercenterSubusersPageAPIRequest 通过主账号登陆态分页查询子账号列表 API请求
// taobao.sellercenter.subusers.page
//
// 通过主账号登陆态分页查询子账号列表
type TaobaoSellercenterSubusersPageAPIRequest struct {
model.Params
// 主账号登陆nick
_nick string
// 可以不传,不传的话和老接口返回数据一样。如果传则根据子账号当前状态筛选 1正常 2冻结 3处罚,如果不传默认都返回
_accountStatus int64
// 页大小,大于1小于200
_pageSize int64
// 页码,大于等于1
_pageNum int64
}
// NewTaobaoSellercenterSubusersPageRequest 初始化TaobaoSellercenterSubusersPageAPIRequest对象
func NewTaobaoSellercenterSubusersPageRequest() *TaobaoSellercenterSubusersPageAPIRequest {
return &TaobaoSellercenterSubusersPageAPIRequest{
Params: model.NewParams(4),
}
}
// Reset IRequest interface 方法, 清空结构体
func (r *TaobaoSellercenterSubusersPageAPIRequest) Reset() {
r._nick = ""
r._accountStatus = 0
r._pageSize = 0
r._pageNum = 0
r.Params.ToZero()
}
// GetApiMethodName IRequest interface 方法, 获取Api method
func (r TaobaoSellercenterSubusersPageAPIRequest) GetApiMethodName() string {
return "taobao.sellercenter.subusers.page"
}
// GetApiParams IRequest interface 方法, 获取API参数
func (r TaobaoSellercenterSubusersPageAPIRequest) GetApiParams(params url.Values) {
for k, v := range r.Params {
params.Set(k, v.String())
}
}
// GetRawParams IRequest interface 方法, 获取API原始参数
func (r TaobaoSellercenterSubusersPageAPIRequest) GetRawParams() model.Params {
return r.Params
}
// SetNick is Nick Setter
// 主账号登陆nick
func (r *TaobaoSellercenterSubusersPageAPIRequest) SetNick(_nick string) error {
r._nick = _nick
r.Set("nick", _nick)
return nil
}
// GetNick Nick Getter
func (r TaobaoSellercenterSubusersPageAPIRequest) GetNick() string {
return r._nick
}
// SetAccountStatus is AccountStatus Setter
// 可以不传,不传的话和老接口返回数据一样。如果传则根据子账号当前状态筛选 1正常 2冻结 3处罚,如果不传默认都返回
func (r *TaobaoSellercenterSubusersPageAPIRequest) SetAccountStatus(_accountStatus int64) error {
r._accountStatus = _accountStatus
r.Set("account_status", _accountStatus)
return nil
}
// GetAccountStatus AccountStatus Getter
func (r TaobaoSellercenterSubusersPageAPIRequest) GetAccountStatus() int64 {
return r._accountStatus
}
// SetPageSize is PageSize Setter
// 页大小,大于1小于200
func (r *TaobaoSellercenterSubusersPageAPIRequest) SetPageSize(_pageSize int64) error {
r._pageSize = _pageSize
r.Set("page_size", _pageSize)
return nil
}
// GetPageSize PageSize Getter
func (r TaobaoSellercenterSubusersPageAPIRequest) GetPageSize() int64 {
return r._pageSize
}
// SetPageNum is PageNum Setter
// 页码,大于等于1
func (r *TaobaoSellercenterSubusersPageAPIRequest) SetPageNum(_pageNum int64) error {
r._pageNum = _pageNum
r.Set("page_num", _pageNum)
return nil
}
// GetPageNum PageNum Getter
func (r TaobaoSellercenterSubusersPageAPIRequest) GetPageNum() int64 {
return r._pageNum
}
var poolTaobaoSellercenterSubusersPageAPIRequest = sync.Pool{
New: func() any {
return NewTaobaoSellercenterSubusersPageRequest()
},
}
// GetTaobaoSellercenterSubusersPageRequest 从 sync.Pool 获取 TaobaoSellercenterSubusersPageAPIRequest
func GetTaobaoSellercenterSubusersPageAPIRequest() *TaobaoSellercenterSubusersPageAPIRequest {
return poolTaobaoSellercenterSubusersPageAPIRequest.Get().(*TaobaoSellercenterSubusersPageAPIRequest)
}
// ReleaseTaobaoSellercenterSubusersPageAPIRequest 将 TaobaoSellercenterSubusersPageAPIRequest 放入 sync.Pool
func ReleaseTaobaoSellercenterSubusersPageAPIRequest(v *TaobaoSellercenterSubusersPageAPIRequest) {
v.Reset()
poolTaobaoSellercenterSubusersPageAPIRequest.Put(v)
}