-
Notifications
You must be signed in to change notification settings - Fork 9
/
TaobaoPromotionCouponSellerSearchAPIRequest.go
126 lines (107 loc) · 3.82 KB
/
TaobaoPromotionCouponSellerSearchAPIRequest.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 promotion
import (
"net/url"
"sync"
"github.com/bububa/opentaobao/model"
)
// TaobaoPromotionCouponSellerSearchAPIRequest 查询绑定卖家优惠券相关信息 API请求
// taobao.promotion.coupon.seller.search
//
// 查询绑定卖家相关优惠券信息 如isv 百川 等外部业务方
type TaobaoPromotionCouponSellerSearchAPIRequest struct {
model.Params
// 券id集合
_spreadIds []string
// 卖家昵称
_sellerNick string
// 当前第几页 从第一页开始
_currentPage int64
// 每页数据 最大20左右
_pageSize int64
}
// NewTaobaoPromotionCouponSellerSearchRequest 初始化TaobaoPromotionCouponSellerSearchAPIRequest对象
func NewTaobaoPromotionCouponSellerSearchRequest() *TaobaoPromotionCouponSellerSearchAPIRequest {
return &TaobaoPromotionCouponSellerSearchAPIRequest{
Params: model.NewParams(4),
}
}
// Reset IRequest interface 方法, 清空结构体
func (r *TaobaoPromotionCouponSellerSearchAPIRequest) Reset() {
r._spreadIds = r._spreadIds[:0]
r._sellerNick = ""
r._currentPage = 0
r._pageSize = 0
r.Params.ToZero()
}
// GetApiMethodName IRequest interface 方法, 获取Api method
func (r TaobaoPromotionCouponSellerSearchAPIRequest) GetApiMethodName() string {
return "taobao.promotion.coupon.seller.search"
}
// GetApiParams IRequest interface 方法, 获取API参数
func (r TaobaoPromotionCouponSellerSearchAPIRequest) GetApiParams(params url.Values) {
for k, v := range r.Params {
params.Set(k, v.String())
}
}
// GetRawParams IRequest interface 方法, 获取API原始参数
func (r TaobaoPromotionCouponSellerSearchAPIRequest) GetRawParams() model.Params {
return r.Params
}
// SetSpreadIds is SpreadIds Setter
// 券id集合
func (r *TaobaoPromotionCouponSellerSearchAPIRequest) SetSpreadIds(_spreadIds []string) error {
r._spreadIds = _spreadIds
r.Set("spread_ids", _spreadIds)
return nil
}
// GetSpreadIds SpreadIds Getter
func (r TaobaoPromotionCouponSellerSearchAPIRequest) GetSpreadIds() []string {
return r._spreadIds
}
// SetSellerNick is SellerNick Setter
// 卖家昵称
func (r *TaobaoPromotionCouponSellerSearchAPIRequest) SetSellerNick(_sellerNick string) error {
r._sellerNick = _sellerNick
r.Set("seller_nick", _sellerNick)
return nil
}
// GetSellerNick SellerNick Getter
func (r TaobaoPromotionCouponSellerSearchAPIRequest) GetSellerNick() string {
return r._sellerNick
}
// SetCurrentPage is CurrentPage Setter
// 当前第几页 从第一页开始
func (r *TaobaoPromotionCouponSellerSearchAPIRequest) SetCurrentPage(_currentPage int64) error {
r._currentPage = _currentPage
r.Set("current_page", _currentPage)
return nil
}
// GetCurrentPage CurrentPage Getter
func (r TaobaoPromotionCouponSellerSearchAPIRequest) GetCurrentPage() int64 {
return r._currentPage
}
// SetPageSize is PageSize Setter
// 每页数据 最大20左右
func (r *TaobaoPromotionCouponSellerSearchAPIRequest) SetPageSize(_pageSize int64) error {
r._pageSize = _pageSize
r.Set("page_size", _pageSize)
return nil
}
// GetPageSize PageSize Getter
func (r TaobaoPromotionCouponSellerSearchAPIRequest) GetPageSize() int64 {
return r._pageSize
}
var poolTaobaoPromotionCouponSellerSearchAPIRequest = sync.Pool{
New: func() any {
return NewTaobaoPromotionCouponSellerSearchRequest()
},
}
// GetTaobaoPromotionCouponSellerSearchRequest 从 sync.Pool 获取 TaobaoPromotionCouponSellerSearchAPIRequest
func GetTaobaoPromotionCouponSellerSearchAPIRequest() *TaobaoPromotionCouponSellerSearchAPIRequest {
return poolTaobaoPromotionCouponSellerSearchAPIRequest.Get().(*TaobaoPromotionCouponSellerSearchAPIRequest)
}
// ReleaseTaobaoPromotionCouponSellerSearchAPIRequest 将 TaobaoPromotionCouponSellerSearchAPIRequest 放入 sync.Pool
func ReleaseTaobaoPromotionCouponSellerSearchAPIRequest(v *TaobaoPromotionCouponSellerSearchAPIRequest) {
v.Reset()
poolTaobaoPromotionCouponSellerSearchAPIRequest.Put(v)
}