-
Notifications
You must be signed in to change notification settings - Fork 43
/
clue_list.go
54 lines (48 loc) · 1.52 KB
/
clue_list.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
package star
import (
"net/url"
"strconv"
"github.com/bububa/oceanengine/marketing-api/model"
)
// ClueListRequest 获取星图订单投后线索 API Request
type ClueListRequest struct {
// StarID 星图id,星图客户授权后,通过“获取已授权账户”接口,查询到账号角色为”6-星图账号“的账户id,即为星图id
StarID uint64 `json:"star_id,omitempty"`
// DemandID 任务id
DemandID uint64 `json:"demand_id,omitempty"`
// OrderID 订单id
OrderID uint64 `json:"order_id,omitempty"`
// Page 页码,默认为1
Page int `json:"page,omitempty"`
// PageSize 页面大小,默认10,最大值50
PageSize int `json:"page_size,omitempty"`
}
// Encode implement GetRequest interface
func (r ClueListRequest) Encode() string {
values := &url.Values{}
values.Set("star_id", strconv.FormatUint(r.StarID, 10))
if r.DemandID > 0 {
values.Set("demand_id", strconv.FormatUint(r.DemandID, 10))
}
if r.OrderID > 0 {
values.Set("order_id", strconv.FormatUint(r.OrderID, 10))
}
if r.Page > 0 {
values.Set("page", strconv.Itoa(r.Page))
}
if r.PageSize > 0 {
values.Set("page_size", strconv.Itoa(r.PageSize))
}
return values.Encode()
}
// ClueListResponse 获取星图客户任务列表 API Response
type ClueListResponse struct {
model.BaseResponse
// Data json返回值
Data *ClueListResponseData `json:"data,omitempty"`
}
// ClueListResponseData json返回值
type ClueListResponseData struct {
List []Clue `json:"list,omitempty"`
PageInfo model.PageInfo `json:"page_info"`
}