-
Notifications
You must be signed in to change notification settings - Fork 42
/
estimated_price_get.go
40 lines (34 loc) · 1.13 KB
/
estimated_price_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
package tools
import (
"strconv"
"github.com/bububa/oceanengine/marketing-api/model"
"github.com/bububa/oceanengine/marketing-api/util"
)
// EstimatedPriceGetRequest 获取预估点击成本 API Request
type EstimatedPriceGetRequest struct {
// AdvertiserID 广告主ID
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
}
// Encode implement GetRequest interface
func (r EstimatedPriceGetRequest) Encode() string {
values := util.GetUrlValues()
values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10))
ret := values.Encode()
util.PutUrlValues(values)
return ret
}
// EstimatedPriceGetResponse 获取预估点击成本 API Response
type EstimatedPriceGetResponse struct {
model.BaseResponse
// Data json返回值
Data *EstimatedPrice `json:"data,omitempty"`
}
// EstimatedPrice 预估点击成本
type EstimatedPrice struct {
// UpperBound 建议出价上界,单位为元
UpperBound float64 `json:"upper_bound,omitempty"`
// LowerBound 建议出价下界,单位为元
LowerBound float64 `json:"lower_bound,omitempty"`
// CpcPrice 回填建议出价,单位为元
CpcPrice float64 `json:"cpc_price,omitempty"`
}