-
Notifications
You must be signed in to change notification settings - Fork 43
/
public_info.go
45 lines (39 loc) · 1.29 KB
/
public_info.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
package advertiser
import (
"encoding/json"
"github.com/bububa/oceanengine/marketing-api/model"
"github.com/bububa/oceanengine/marketing-api/util"
)
// PublicInfoRequest 广告主公开信息 API Request
type PublicInfoRequest struct {
// AdvertiserIDs 广告主ID集合(如果包含没有访问权限的ID,将返回no permission error) 取值范围: 1-100
AdvertiserIDs []uint64 `json:"advertiser_ids,omitempty"`
}
// Encode implement GetRequest interface
func (r PublicInfoRequest) Encode() string {
idsBytes, _ := json.Marshal(r.AdvertiserIDs)
values := util.GetUrlValues()
values.Set("advertiser_ids", string(idsBytes))
ret := values.Encode()
util.PutUrlValues(values)
return ret
}
// PublicInfoResponse 广告主公开信息 API Response
type PublicInfoResponse struct {
model.BaseResponse
// Data json返回值
Data []PublicInfo `json:"data,omitempty"`
}
// PublicInfo 广告主公开信息
type PublicInfo struct {
// ID 广告主ID
ID uint64 `json:"id,omitempty"`
// Name 账户名
Name string `json:"name,omitempty"`
// Company 公司名
Company string `json:"company,omitempty"`
// FirstIndustryName 一级行业名
FirstIndustryName string `json:"first_industry_name,omitempty"`
// SecondIndustryName 二级行业名
SecondIndustryName string `json:"second_industry_name,omitempty"`
}