Skip to content

Commit 2502173

Browse files
committed
Merge branch 'release/v1.34.1'
2 parents c1995ec + c778bdd commit 2502173

13 files changed

Lines changed: 305 additions & 8 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package report
2+
3+
import (
4+
"context"
5+
6+
"github.com/bububa/oceanengine/marketing-api/core"
7+
"github.com/bububa/oceanengine/marketing-api/model/local/report"
8+
)
9+
10+
// AccountGet 查询账户数据
11+
// 查询本地推账户维度数据
12+
func AccountGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *report.AccountGetRequest) (*report.AccountGetResult, error) {
13+
var resp report.AccountGetResponse
14+
if err := clt.GetAPI(ctx, "v3.0/local/report/account/get/", req, &resp, accessToken); err != nil {
15+
return nil, err
16+
}
17+
return resp.Data, nil
18+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package project
2+
3+
import (
4+
"context"
5+
6+
"github.com/bububa/oceanengine/marketing-api/core"
7+
"github.com/bububa/oceanengine/marketing-api/model/v3/project"
8+
)
9+
10+
// CPABidUpdate 批量更新项目出价
11+
func CPABidUpdate(ctx context.Context, clt *core.SDKClient, accessToken string, req *project.CPABidUpdateRequest) (*project.UpdateResponseData, error) {
12+
var resp project.UpdateResponse
13+
if err := clt.PostAPI(ctx, "v3.0/project/cpa_bid/update/", req, &resp, accessToken); err != nil {
14+
return nil, err
15+
}
16+
return resp.Data, nil
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package project
2+
3+
import (
4+
"context"
5+
6+
"github.com/bububa/oceanengine/marketing-api/core"
7+
"github.com/bububa/oceanengine/marketing-api/model/v3/project"
8+
)
9+
10+
// DeepCPABidUpdate 批量更新深层项目出价
11+
func DeepCPABidUpdate(ctx context.Context, clt *core.SDKClient, accessToken string, req *project.DeepCPABidUpdateRequest) (*project.UpdateResponseData, error) {
12+
var resp project.UpdateResponse
13+
if err := clt.PostAPI(ctx, "v3.0/project/deep_cpa_bid/update/", req, &resp, accessToken); err != nil {
14+
return nil, err
15+
}
16+
return resp.Data, nil
17+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package local
2+
3+
// DeliveryMode 投放模式
4+
type DeliveryMode string
5+
6+
const (
7+
// DeliveryMode_CDP_AUTO_MODE 自动投放
8+
DeliveryMode_CDP_AUTO_MODE DeliveryMode = "CDP_AUTO_MODE"
9+
// DeliveryMode_MANUAL_MODE 手动投放
10+
DeliveryMode_MANUAL_MODE DeliveryMode = "MANUAL_MODE"
11+
)

marketing-api/model/dpa/product.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ type Product struct {
116116
Profession *Profession `json:"profession,omitempty"`
117117
}
118118

119-
// Category 商品类目信息
119+
// ProductCategory 商品类目信息
120120
type ProductCategory struct {
121121
// FirstCategoryName 商品所处一级行业
122122
FirstCategoryName string `json:"first_category_name,omitempty"`
@@ -237,6 +237,16 @@ type Profession struct {
237237
AlbumID string `json:"album_id,omitempty"`
238238
// Platform 平台信息,枚举值:淘宝 天猫 京东 其他
239239
Platform string `json:"platform,omitempty"`
240+
// PlatformV2 平台信息,枚举值:淘宝拼多多京东唯品会阿里健康微信小程序其他,请填写数组json序列化后的字符串,支持多选,示例:[\"阿里健康\",\"淘宝\"]
241+
// 调整内容:
242+
// 【字段名】由platform更新为platform_v2
243+
// 新增支持多选,填写枚举格式调整,需要填写数组json序列化后的字符串
244+
PlatformV2 string `json:"platform_v2,omitempty"`
245+
// BrandTypeChoose 品牌类型选择,可选枚举:
246+
// 标准品牌:被品牌库收录的品牌,可通过品牌查询列表接口获取
247+
// 自定义品牌:实际有品牌,但在「标准品牌」接口范围中无法搜索到,可入参此选项
248+
// 无品牌:实际经营商品无品牌,入参当前枚举可不填写品牌名称(非实际情况不建议)
249+
BrandTypeChoose string `json:"brand_type_choose,omitempty"`
240250
// StoreName 店铺名称
241251
StoreName string `json:"store_name,omitempty"`
242252
// StoreID 店铺ID
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
package report
2+
3+
import (
4+
"strconv"
5+
6+
"github.com/bububa/oceanengine/marketing-api/enum"
7+
"github.com/bububa/oceanengine/marketing-api/enum/local"
8+
"github.com/bububa/oceanengine/marketing-api/model"
9+
"github.com/bububa/oceanengine/marketing-api/util"
10+
)
11+
12+
// AccountGetRequest 查询账户数据 API Request
13+
type AccountGetRequest struct {
14+
// LocalAccountID 本地推投放账户ID
15+
LocalAccountID uint64 `json:"local_account_id,omitempty"`
16+
// TimeGranularity 时间粒度,如果不传,返回查询日期内的聚合数据,允许值:
17+
// TIME_GRANULARITY_DAILY(按天维度),会返回账户每天的数据
18+
// TIME_GRANULARITY_HOURLY(按小时维度),会返回账户每小时的数
19+
// TIME_GRANULARITY_TOTAL(汇总),会返回账户汇总的数据
20+
TimeGranularity enum.TimeGranularity `json:"time_granularity,omitempty"`
21+
// StartDate 投放开始时间,格式 2021-04-05,开始时间不得早于今日-365天
22+
StartDate string `json:"start_date,omitempty"`
23+
// EndDate 投放结束时间,格式 2021-04-05
24+
// 若不传time_granularity,则时间跨度不能超过365天;
25+
// 若传time_granularity为TIME_GRANULARITY_DAILY时,则时间跨度不能超过365天;
26+
// 若传time_granularity为TIME_GRANULARITY_TOTAL时,则时间跨度不能超过365天;
27+
// 若传time_granularity为TIME_GRANULARITY_HOURLY时,则时间跨度不能超过7天
28+
EndDate string `json:"end_date,omitempty"`
29+
// Metrics 指标集,允许值可参考应答返回数据指标
30+
Metrics []string `json:"metrics,omitempty"`
31+
// OrderType 排序方式,允许值:
32+
// ASC:升序
33+
// DESC:降序(默认)
34+
OrderType enum.OrderType `json:"order_type,omitempty"`
35+
// OrderField 排序字段,允许值参考数据指标,默认根据时间排序
36+
// 注意:如果根据指标排序,order_field必须在metrics范围内
37+
OrderField string `json:"order_field,omitempty"`
38+
// Filtering 过滤条件
39+
Filtering *AccountGetFilter `json:"filtering,omitempty"`
40+
// Page 页码,默认值:1
41+
Page int `json:"page,omitempty"`
42+
// PageSize 页面大小,允许值:10(默认值)、20、50、100
43+
PageSize int `json:"page_size,omitempty"`
44+
}
45+
46+
type AccountGetFilter struct {
47+
// MarketingGoal 营销场景,允许值:
48+
// LIVE 直播
49+
// VIDEO_IMAGE 短视频/图文
50+
MarketingGoal local.MarketingGoal `json:"marketing_goal,omitempty"`
51+
// LocalDeliveryScene 营销目的,不传,默认查询全部,可选值:
52+
// CLUE 获取线索
53+
// CONTENT_HEATING 线上互动
54+
// POI_CUSTOMER 线下到店
55+
// PURCHASE 团购成交
56+
LocalDeliveryScene local.LocalDeliveryScene `json:"local_delivery_scene,omitempty"`
57+
// CampaignType 单元类型,不传,默认查询全部,可选值:
58+
// GENERAL 通投
59+
// SEARCHING 搜索
60+
CampaignType local.AdType `json:"campaign_type,omitempty"`
61+
// ExternalAction 优化目标,不传,默认查询全部,可选值:
62+
// CLUE_ACQUISITION 获取线索
63+
// FOLLOW_ACTION 粉丝增长
64+
// CLUE_CONFIRM确认意向
65+
// LIVE_ENGAGEMENT 直播加热
66+
// LIVE_ENTER_ACTION 直播间观看
67+
// LIVE_OTO_CLICK 直播间团购点击
68+
// LIVE_OTO_GROUP_BUYING 直播间团购购买
69+
// LIVE_STAY_TIME 直播间停留
70+
// NATIVE_ACTION 用户互动
71+
// OTO_PAY 团购成交
72+
// POI_RECOMMEND 门店浏览
73+
// PRIVATE_MESSAGE 私信消息
74+
// SHOW 展示量
75+
ExternalAction local.ExternalAction `json:"external_action,omitempty"`
76+
// DeliveryMode 投放模式,不传,默认查询全部,可选值:
77+
// CDP_AUTO_MODE 自动投放
78+
// MANUAL_MODE 手动投放
79+
DeliveryMode local.DeliveryMode `json:"devlivery_mode,omitempty"`
80+
}
81+
82+
// Encode implements GetRequest interface
83+
func (r AccountGetRequest) Encode() string {
84+
values := util.GetUrlValues()
85+
values.Set("local_account_id", strconv.FormatUint(r.LocalAccountID, 10))
86+
if r.TimeGranularity != "" {
87+
values.Set("time_granularity", string(r.TimeGranularity))
88+
}
89+
values.Set("start_date", r.StartDate)
90+
values.Set("end_date", r.EndDate)
91+
if r.OrderType != "" {
92+
values.Set("order_type", string(r.OrderType))
93+
}
94+
if r.OrderField != "" {
95+
values.Set("order_field", r.OrderField)
96+
}
97+
values.Set("metrics", string(util.JSONMarshal(r.Metrics)))
98+
if r.Filtering != nil {
99+
values.Set("filtering", string(util.JSONMarshal(r.Filtering)))
100+
}
101+
if r.Page > 0 {
102+
values.Set("page", strconv.Itoa(r.Page))
103+
}
104+
if r.PageSize > 0 {
105+
values.Set("page_size", strconv.Itoa(r.PageSize))
106+
}
107+
ret := values.Encode()
108+
util.PutUrlValues(values)
109+
return ret
110+
}
111+
112+
// AccountGetResponse 查询账户数据 API Response
113+
type AccountGetResponse struct {
114+
model.BaseResponse
115+
Data *AccountGetResult `json:"data,omitempty"`
116+
}
117+
118+
type AccountGetResult struct {
119+
// PageInfo 分页信息
120+
PageInfo *model.PageInfo `json:"page_info,omitempty"`
121+
// DataList
122+
DataList []Report `json:"project_list,omitempty"`
123+
}

marketing-api/model/local/report/material_get.go

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,43 @@ type MaterialGetRequest struct {
4141
}
4242

4343
type MaterialGetFilter struct {
44-
// MaterialIDs 素材ID
45-
MaterialIDs []uint64 `json:"material_ids,omitempty"`
46-
// MaterialType 素材类型,允许值:
47-
// CASURAL 图文
48-
// VIDEO 视频
49-
MaterialType enum.MaterialMode `json:"material_type,omitempty"`
44+
// MaterialIDs 素材ID
45+
MaterialIDs []uint64 `json:"material_ids,omitempty"`
46+
// MaterialType 素材类型,允许值:
47+
// CASURAL 图文
48+
// VIDEO 视频
49+
MaterialType enum.MaterialMode `json:"material_type,omitempty"`
5050
// CampaignType 广告类型,允许值:
5151
// GENERAL 通投广告
5252
// SEARCHING 线索广告
5353
CampaignType local.AdType `json:"campaign_type,omitempty"`
54+
// PromotionIDs 单元ID
55+
PromotionIDs []uint64 `json:"promotion_ids,omitempty"`
56+
// LocalDeliveryScene 营销目的,不传,默认查询全部,可选值:
57+
// CLUE 获取线索
58+
// CONTENT_HEATING 线上互动
59+
// POI_CUSTOMER 线下到店
60+
// PURCHASE 团购成交
61+
LocalDeliveryScene local.LocalDeliveryScene `json:"local_delivery_scene,omitempty"`
62+
// ExternalAction 优化目标,不传,默认查询全部,可选值:
63+
// CLUE_ACQUISITION 获取线索
64+
// FOLLOW_ACTION 粉丝增长
65+
// CLUE_CONFIRM确认意向
66+
// LIVE_ENGAGEMENT 直播加热
67+
// LIVE_ENTER_ACTION 直播间观看
68+
// LIVE_OTO_CLICK 直播间团购点击
69+
// LIVE_OTO_GROUP_BUYING 直播间团购购买
70+
// LIVE_STAY_TIME 直播间停留
71+
// NATIVE_ACTION 用户互动
72+
// OTO_PAY 团购成交
73+
// POI_RECOMMEND 门店浏览
74+
// PRIVATE_MESSAGE 私信消息
75+
// SHOW 展示量
76+
ExternalAction local.ExternalAction `json:"external_action,omitempty"`
77+
// DeliveryMode 投放模式,不传,默认查询全部,可选值:
78+
// CDP_AUTO_MODE 自动投放
79+
// MANUAL_MODE 手动投放
80+
DeliveryMode local.DeliveryMode `json:"devlivery_mode,omitempty"`
5481
}
5582

5683
// Encode implements GetRequest interface
@@ -92,6 +119,6 @@ type MaterialGetResponse struct {
92119
type MaterialGetResult struct {
93120
// PageInfo 分页信息
94121
PageInfo *model.PageInfo `json:"page_info,omitempty"`
95-
// MaterialList
122+
// MaterialList
96123
MaterialList []Report `json:"material_list,omitempty"`
97124
}

marketing-api/model/local/report/project_get.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ type ProjectGetFilter struct {
5959
CampaignType local.AdType `json:"campaign_type,omitempty"`
6060
// ExternalAction 优化目标
6161
ExternalAction local.ExternalAction `json:"external_action,omitempty"`
62+
// DeliveryMode 投放模式,不传,默认查询全部,可选值:
63+
// CDP_AUTO_MODE 自动投放
64+
// MANUAL_MODE 手动投放
65+
DeliveryMode local.DeliveryMode `json:"devlivery_mode,omitempty"`
6266
}
6367

6468
// Encode implements GetRequest interface

marketing-api/model/local/report/promotion_get.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ type PromotionGetFilter struct {
5959
CampaignType local.AdType `json:"campaign_type,omitempty"`
6060
// ExternalAction 优化目标
6161
ExternalAction local.ExternalAction `json:"external_action,omitempty"`
62+
// DeliveryMode 投放模式,不传,默认查询全部,可选值:
63+
// CDP_AUTO_MODE 自动投放
64+
// MANUAL_MODE 手动投放
65+
DeliveryMode local.DeliveryMode `json:"devlivery_mode,omitempty"`
6266
}
6367

6468
// Encode implements GetRequest interface

marketing-api/model/local/report/report.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package report
22

33
// Report 报表
44
type Report struct {
5+
// LocalAccountID 本地推投放账户id
6+
LocalAccountID uint64 `json:"local_account_id,omitempty"`
57
// ProjectID 项目ID
68
ProjectID uint64 `json:"project_id,omitempty"`
79
// ProjectName 项目名称

0 commit comments

Comments
 (0)