-
Notifications
You must be signed in to change notification settings - Fork 42
/
action_text_get.go
43 lines (38 loc) · 1.35 KB
/
action_text_get.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
package tools
import (
"net/url"
"strconv"
"github.com/bububa/oceanengine/marketing-api/enum"
"github.com/bububa/oceanengine/marketing-api/model"
)
// ActionTextGetRequest 行动号召字段内容获取 API Request
type ActionTextGetRequest struct {
// AdvertiserID 广告主ID
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
// LandingType 推广类型
// 允许值:APP,SHOP,LINK
LandingType enum.LandingType `json:"landing_type,omitempty"`
// AdvanceCreativeType 附加创意类型,详见枚举
AdvancedCreativeType enum.AdvancedCreativeType `json:"advanced_creative_type,omitempty"`
// Industry 广告主行业id,可以从获取行业接口进行获取
Industry uint64 `json:"industry,omitempty"`
}
// Encode implement GetRequest interface
func (r ActionTextGetRequest) Encode() string {
values := &url.Values{}
values.Add("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10))
values.Add("landing_type", string(r.LandingType))
if r.AdvancedCreativeType != "" {
values.Add("advanced_creative_type", string(r.AdvancedCreativeType))
}
if r.Industry > 0 {
values.Add("industry", strconv.FormatUint(r.Industry, 10))
}
return values.Encode()
}
// ActionTextGetResponse 行动号召字段内容获取 API Response
type ActionTextGetResponse struct {
model.BaseResponse
// Data json返回值
Data []string `json:"data,omitempty"`
}