-
Notifications
You must be signed in to change notification settings - Fork 42
/
preview.go
35 lines (30 loc) · 1.02 KB
/
preview.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
package sitetemplate
import (
"strconv"
"github.com/bububa/oceanengine/marketing-api/model"
"github.com/bububa/oceanengine/marketing-api/util"
)
// PreviewRequest 获取模版预览链接 API Request
type PreviewRequest struct {
// AdvertiserID 广告主ID
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
// TemplateID 模板ID,可通过【获取站点模版列表】查询模板ID
TemplateID uint64 `json:"template_id,omitempty"`
}
// Encode implement GetRequest interface
func (r PreviewRequest) Encode() string {
values := util.GetUrlValues()
values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10))
values.Set("template_id", strconv.FormatUint(r.TemplateID, 10))
ret := values.Encode()
util.PutUrlValues(values)
return ret
}
// PreviewResponse 获取模版预览链接 API Response
type PreviewResponse struct {
model.BaseResponse
Data struct {
// PreviewURL 预览URL,模板的预览地址,有效期:20分钟
PreviewURL string `json:"preview_url,omitempty"`
} `json:"data,omitempty"`
}