Skip to content

Commit

Permalink
feat(qianchuan/report): 新增支持商品全域账户&素材数据获取
Browse files Browse the repository at this point in the history
  • Loading branch information
bububa committed Oct 21, 2024
1 parent 8cba376 commit 2bd7ec1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
7 changes: 6 additions & 1 deletion marketing-api/model/qianchuan/report/custom_config_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"strconv"

"github.com/bububa/oceanengine/marketing-api/enum/qianchuan"
"github.com/bububa/oceanengine/marketing-api/model"
"github.com/bububa/oceanengine/marketing-api/util"
)
Expand All @@ -16,7 +17,11 @@ type CustomConfigGetRequest struct {
// SITE_PROMOTION_POST_DATA_VIDEO 全域推广-素材-视频
// SITE_PROMOTION_POST_DATA_OTHER 全域推广-素材-其他创意
// SITE_PROMOTION_POST_DATA_TITLE 全域推广-素材-标题
DataTopics []string `json:"data_topics,omitempty"`
// SITE_PROMOTION_PRODUCT_POST_DATA_IMAGE 商品全域推广-素材-图片
// SITE_PROMOTION_PRODUCT_POST_DATA_VIDEO 商品全域推广-素材-视频
// SITE_PROMOTION_PRODUCT_POST_DATA_OTHER 商品全域推广-素材-其他创意
// SITE_PROMOTION_PRODUCT_POST_DATA_TITLE 商品全域推广-素材-标题
DataTopics []qianchuan.DataTopic `json:"data_topics,omitempty"`
// AdvertiserID 广告主id
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
}
Expand Down
9 changes: 7 additions & 2 deletions marketing-api/model/qianchuan/report/custom_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"strconv"

"github.com/bububa/oceanengine/marketing-api/enum/qianchuan"
"github.com/bububa/oceanengine/marketing-api/model"
"github.com/bububa/oceanengine/marketing-api/util"
)
Expand All @@ -20,7 +21,11 @@ type CustomGetRequest struct {
// SITE_PROMOTION_POST_DATA_VIDEO 全域推广-素材-视频
// SITE_PROMOTION_POST_DATA_OTHER 全域推广-素材-其他创意
// SITE_PROMOTION_POST_DATA_TITLE 全域推广-素材-标题
DataTopic string `json:"data_topic,omitempty"`
// SITE_PROMOTION_PRODUCT_POST_DATA_IMAGE 商品全域推广-素材-图片
// SITE_PROMOTION_PRODUCT_POST_DATA_VIDEO 商品全域推广-素材-视频
// SITE_PROMOTION_PRODUCT_POST_DATA_OTHER 商品全域推广-素材-其他创意
// SITE_PROMOTION_PRODUCT_POST_DATA_TITLE 商品全域推广-素材-标题
DataTopic qianchuan.DataTopic `json:"data_topic,omitempty"`
// Dimensions 维度列表。
// 可通过【获取自定义报表可用维度和指标】接口获取不同数据主题下的可用维度和指标
Dimensions []string `json:"dimensions,omitempty"`
Expand Down Expand Up @@ -69,7 +74,7 @@ type CustomGetOrderBy struct {
func (r CustomGetRequest) Encode() string {
values := util.GetUrlValues()
values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10))
values.Set("data_topic", r.DataTopic)
values.Set("data_topic", string(r.DataTopic))
values.Set("dimensions", string(util.JSONMarshal(r.Dimensions)))
values.Set("metrics", string(util.JSONMarshal(r.Metrics)))
if len(r.Filters) > 0 {
Expand Down
4 changes: 3 additions & 1 deletion marketing-api/model/qianchuan/report/uni_promotion_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ type UniPromotionGetRequest struct {
StartDate string `json:"start_date,omitempty"`
// EndDate 结束日期,格式YYYY-MM-DD,只支持查询2016-10-26及以后的日期,时间跨度不能超过30天
EndDate string `json:"end_date,omitempty"`
// MarketingGoal 按营销目标过滤,允许值:LIVE_PROM_GOODS:直播带货
// MarketingGoal 按营销目标过滤,允许值:
// LIVE_PROM_GOODS:直播带货
// VIDEO_PROM_GOODS:商品全域
MarketingGoal enum.MarketingGoal `json:"marketing_goal,omitempty"`
// LabAdType 推广方式,允许值:LAB_AD 托管
LabAdType enum.AdLabType `json:"lab_ad_type,omitempty"`
Expand Down

0 comments on commit 2bd7ec1

Please sign in to comment.