-
Notifications
You must be signed in to change notification settings - Fork 42
/
lq_ad_get.go
47 lines (41 loc) · 1.27 KB
/
lq_ad_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
44
45
46
47
package ad
import (
"strconv"
"github.com/bububa/oceanengine/marketing-api/enum/qianchuan"
"github.com/bububa/oceanengine/marketing-api/model"
"github.com/bububa/oceanengine/marketing-api/util"
)
// LqAdGetRequest 获取低效计划列表 API Request
type LqAdGetRequest struct {
// AdvertiserID 千川广告主账户ID
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
// Filtering 过滤条件
Filtering *LqAdGetFilter `json:"filtering,omitempty"`
}
type LqAdGetFilter struct {
// MarketingScene 按广告类型过滤,允许值:
// ALL 全部
// FEED 通投广告,默认为FEED
// SEARCH 搜索广告
// SHOPPING_MALL商城广告
MarketingScene qianchuan.MarketingScene `json:"marketing_scene,omitempty"`
}
// Encode implement GetRequest interface
func (r LqAdGetRequest) Encode() string {
values := util.GetUrlValues()
values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10))
if r.Filtering != nil {
values.Set("filtering", string(util.JSONMarshal(r.Filtering)))
}
ret := values.Encode()
util.PutUrlValues(values)
return ret
}
// LqAdGetResponse 获取低效计划列表 API Response
type LqAdGetResponse struct {
model.BaseResponse
Data struct {
// AdIDs 低效计划ID列表
AdIDs []uint64 `json:"ad_ids,omitempty"`
} `json:"data,omitempty"`
}