-
Notifications
You must be signed in to change notification settings - Fork 42
/
ad_qualitity_get.go
52 lines (45 loc) · 1.38 KB
/
ad_qualitity_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
48
49
50
51
52
package tools
import (
"encoding/json"
"net/url"
"strconv"
"github.com/bububa/oceanengine/marketing-api/model"
)
// AdQualityGetRequest 查询广告质量度 API Request
type AdQualityGetRequest struct {
// AdvertiserID 广告主id
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
// AdIDs 广告id列表
AdIDs []uint64 `json:"ad_ids,omitempty"`
}
// Encode implement GetRequest interface
func (r AdQualityGetRequest) Encode() string {
values := &url.Values{}
values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10))
buf, _ := json.Marshal(r.AdIDs)
values.Set("ad_ids", string(buf))
return values.Encode()
}
// AdQualityGetResponse 查询广告质量度 API Response
type AdQualityGetResponse struct {
model.BaseResponse
// Data json返回值
Data *AdQualityGetResponseData `json:"data,omitempty"`
}
// AdQualityGetResponseData json返回值
type AdQualityGetResponseData struct {
List []AdQuality `json:"list,omitempty"`
}
// AdQuality 广告质量度
type AdQuality struct {
// AdID 计划ID
AdID uint64 `json:"ad_id,omitempty"`
// QualityScore 计划综合质量得分
QualityScore float64 `json:"quality_score,omitempty"`
// CtrScore 创意质量得分
CtrScore float64 `json:"ctr_score,omitempty"`
// WebScore 落地页响应得分
WebScore float64 `json:"web_score,omitempty"`
// CvrScore 落地页素材得分
CvrScore float64 `json:"cvr_score,omitempty"`
}