-
Notifications
You must be signed in to change notification settings - Fork 43
/
suggest.go
50 lines (43 loc) · 1.39 KB
/
suggest.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
package keyword
import (
"strconv"
"github.com/bububa/oceanengine/marketing-api/enum"
"github.com/bububa/oceanengine/marketing-api/model"
"github.com/bububa/oceanengine/marketing-api/util"
)
// SuggestRequest 搜索快投关键词推荐 API Request
type SuggestRequest struct {
// AdvertiserID 广告主id
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
// AdID 广告计划id,此参数用于获取与当前计划更为相关的关键词推荐
AdID uint64 `json:"ad_id,omitempty"`
}
// Encode implement GetRequest interface
func (r SuggestRequest) Encode() string {
values := util.GetUrlValues()
values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10))
values.Set("ad_id", strconv.FormatUint(r.AdID, 10))
ret := values.Encode()
util.PutUrlValues(values)
return ret
}
// SuggestResponse 搜索快投关键词推荐 API Response
type SuggestResponse struct {
model.BaseResponse
// Data json返回值
Data *SuggestResponseData `json:"data,omitempty"`
}
// SuggestResponseData json返回值
type SuggestResponseData struct {
// List 推荐关键词列表
List []SuggestKeyword `json:"list,omitempty"`
}
// SuggestKeyword 推荐关键词
type SuggestKeyword struct {
// Keyword 推荐关键词
Keyword string `json:"keyword,omitempty"`
// MatchType 匹配类型
MatchType enum.KeywordMatchType `json:"match_type,omitempty"`
// Msv 月搜索量
Msg int64 `json:"msv,omitempty"`
}