Skip to content

Commit

Permalink
fix(enum): update some struct fields to use predefined enum
Browse files Browse the repository at this point in the history
  • Loading branch information
bububa committed Dec 12, 2022
1 parent b09ce60 commit 010eda7
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 14 deletions.
4 changes: 4 additions & 0 deletions marketing-api/enum/creative_material_mode.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ const (
CreativeMaterialMode_CUSTOM_CREATIVE CreativeMaterialMode = "CUSTOM_CREATIVE"
// CreativeMaterialMode_PROGRAMMATIC_CREATIVE 程序化创意
CreativeMaterialMode_PROGRAMMATIC_CREATIVE CreativeMaterialMode = "PROGRAMMATIC_CREATIVE"
// CreativeMaterialMode_STATIC_ASSEMBLE 程序化创意
CreativeMaterialMode_STATIC_ASSEMBLE CreativeMaterialMode = "STATIC_ASSEMBLE"
// CreativeMaterialMode_INTERVENE 自定义创意
CreativeMaterialMode_INTERVENE CreativeMaterialMode = "INTERVENE"
)
2 changes: 1 addition & 1 deletion marketing-api/model/audiencepackage/audience_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type AudiencePackage struct {
// Description 定向包描述
Description string `json:"description,omitempty"`
// LandingType 定向包推广类型
LandingType string `json:"landing_type,omitempty"`
LandingType enum.LandingType `json:"landing_type,omitempty"`
// HideIfConverted 过滤已转化用户; 注意点:过滤已转化不支持投放目标为展示、点击计划,不支持受众预估; 过滤已转化用户:选择过滤已转化用户之后,可以避免该广告再次投放给已转化过的用户,可以选择过滤5个广告层级的已转化用户(不限/广告计划/广告组/广告账户/公司账户/APP)
HideIfConverted string `json:"hide_if_converted,omitempty"`
// ConvertedTimeDuration 过滤时间范围,详见, 【附录-过滤时间范围】,当过滤已转化用户类型选择"公司账户"时填写,教育行业专属,非教育行业不会生效
Expand Down
2 changes: 1 addition & 1 deletion marketing-api/model/audiencepackage/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type CreateRequest struct {
// Description 定向包描述
Description string `json:"description,omitempty"`
// LandingType 定向包推广类型
LandingType string `json:"landing_type,omitempty"`
LandingType enum.LandingType `json:"landing_type,omitempty"`
// DeliveryRange 广告投放范围【附录:广告投放范围】
DeliverRange enum.AdDeliveryRange `json:"delivery_range,omitempty"`
// HideIfExists 已安装用户,0表示不限,1表示过滤,2表示定向;过滤表示投放时不给安装客户展示广告,支持应用推广;定向表示投放时给安装客户展示广告;投放时优先获取直达链接,无直达链接时使用应用包名进行投放;如果无直达链接或应用包名,定向安装选项实际不生效;定向仅对Android链接生效。
Expand Down
2 changes: 1 addition & 1 deletion marketing-api/model/audiencepackage/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type GetRequest struct {
// GetFiltering 过滤字段
type GetFiltering struct {
// LandingType 定向包类型
LandingType string `json:"landing_type,omitempty"`
LandingType enum.LandingType `json:"landing_type,omitempty"`
// DeliveryRange 广告投放范围
DeliveryRange enum.AdDeliveryRange `json:"delivery_range,omitempty"`
}
Expand Down
2 changes: 1 addition & 1 deletion marketing-api/model/creative/creative_detail.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type CreativeDetail struct {
// SceneInventory 首选场景广告位,详见【附录-首选场景广告位】,使用首选场景广告位时默认忽略inventory_type字段,与scene_inventory不能同时传 允许值: "VIDEO_SCENE", "FEED_SCENE", "TAIL_SCENE"
SceneInventory string `json:"scene_inventory,omitempty"`
// CreativeMaterialMode 创意类型,该字段为STATIC_ASSEMBLE表示程序化创意,其他情况无该字段
CreativeMaterialMode string `json:"creative_material_mode,omitempty"`
CreativeMaterialMode enum.CreativeMaterialMode `json:"creative_material_mode,omitempty"`
// ProceduralPackageID 程序化创意包ID
ProceduralPackageID uint64 `json:"procedural_package_id,omitempty"`
// ProceduralPackageVersion 程序化创意包版本
Expand Down
2 changes: 1 addition & 1 deletion marketing-api/model/qianchuan/ad/ad.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type Ad struct {
// Audience 定向设置
Audience *Audience `json:"audience,omitempty"`
// CreativeMaterialMode 创意呈现方式
CreativeMaterialMode string `json:"creative_material_mode,omitempty"`
CreativeMaterialMode enum.CreativeMaterialMode `json:"creative_material_mode,omitempty"`
// FirstIndustryID 创意一级行业ID
FirstIndustryID uint64 `json:"first_industry_id,omitempty"`
// SecondIndustryID 创意二级行业ID
Expand Down
6 changes: 3 additions & 3 deletions marketing-api/model/report/dimensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ type Dimensions struct {
// Inventory 投放广告位,分组条件包含STAT_GROUP_BY_INVENTORY时返回
Inventory enum.StatInventoryType `json:"inventory,omitempty"`
// CampaignType 广告组类型。如果分组条件中包括STAT_GROUP_BY_CAMPAIGN_TYPE,此字段有值
CampaignType string `json:"campaign_type,omitempty"`
CampaignType enum.CampaignType `json:"campaign_type,omitempty"`
// CreativeMaterialMode 创意类型,分组条件包含STAT_GROUP_BY_CREATIVE_MATERIAL_MODE时返回,允许值:STATIC_ASSEMBLE(程序化创意)、INTERVENE(自定义创意)
CreativeMaterialMode string `json:"creative_material_mode,omitempty"`
CreativeMaterialMode enum.CreativeMaterialMode `json:"creative_material_mode,omitempty"`
// ExternalAction 转化类型。如果分组条件中包括STAT_GROUP_BY_EXTERNAL_ACTION,此字段有值
ExternalAction string `json:"external_action,omitempty"`
ExternalAction enum.AdConvertType `json:"external_action,omitempty"`
// LandingType 推广目的类型,分组条件包含STAT_GROUP_BY_LANDING_TYPE时返回
LandingType enum.LandingType `json:"landing_type,omitempty"`
// PricingCategory 广告类型。如果分组条件中包括STAT_GROUP_BY_PRICING_CATEGORY,此字段有值
Expand Down
2 changes: 1 addition & 1 deletion marketing-api/model/report/get_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type StatFiltering struct {
// ImageModes 素材类型列表:按照类型过滤
ImageModes []enum.ImageMode `json:"image_modes,omitempty"`
// CreativeMaterialModes 创意类型列表:按照创意类型过滤,STATIC_ASSEMBLE 表示程序化创意,INTERVENE表示自定义创意
CreativeMaterialModes []string `json:"creative_material_modes,omitempty"`
CreativeMaterialModes []enum.CreativeMaterialMode `json:"creative_material_modes,omitempty"`
// LandingTypes 推广目的列表:按照广告组推广目的过滤, 允许值: "LINK","APP","DPA","GOODS","STORE","SHOP","AWEME"
LandingTypes []enum.LandingType `json:"landing_types,omitempty"`
// Status 广告创意状态:按照广告创意状态过滤,默认为返回“所有不包含已删除”,如果要返回所有包含已删除有对应枚举表示
Expand Down
2 changes: 1 addition & 1 deletion marketing-api/model/report/integrated_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type IntegratedFiltering struct {
// ImageModes 素材类型列表:按照类型过滤
ImageModes []enum.ImageMode `json:"image_mode,omitempty"`
// CreativeMaterialModes 创意类型列表:按照创意类型过滤,STATIC_ASSEMBLE 表示程序化创意,INTERVENE表示自定义创意
CreativeMaterialModes []string `json:"creative_material_mode,omitempty"`
CreativeMaterialModes []enum.CreativeMaterialMode `json:"creative_material_mode,omitempty"`
// LandingTypes 推广目的列表:按照广告组推广目的过滤, 允许值: "LINK","APP","DPA","GOODS","STORE","SHOP","AWEME"
LandingTypes []enum.LandingType `json:"landing_type,omitempty"`
// Bidwords 按关键词过滤, 传入关键词,不可传空字符串,最多支持100个。只支持关键词/搜索词报表,关键词可通过【搜索广告-获取关键词】接口进行获取
Expand Down
10 changes: 6 additions & 4 deletions marketing-api/model/report/v3/dimensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package v3

import (
"time"

"github.com/bububa/oceanengine/marketing-api/enum"
)

// Dimensions 维度数据
Expand All @@ -11,9 +13,9 @@ type Dimensions struct {
// PromotionID 广告ID,分组条件包含 STAT_GROUP_BY_APP_PROMOTION_ID 时返回
PromotionID uint64 `json:"promotion_id,omitempty"`
// LandingType 对应项目的推广目的
LandingType string `json:"landing_type,omitempty"`
LandingType enum.LandingType `json:"landing_type,omitempty"`
// ExternalAction 对应项目的转化目标
ExternalAction string `json:"external_action,omitempty"`
ExternalAction enum.AdConvertType `json:"external_action,omitempty"`
// PricingType 对应项目的计费类型
PricingType string `json:"pricing_type,omitempty"`
// AppCode 您所投放的广告数据中,对应的首选广告位
Expand Down Expand Up @@ -50,9 +52,9 @@ type CustomDimensions struct {
// CdpProjectName 项目的名称
CdpProjectName string `json:"cdp_project_name,omitempty"`
// LandingType 对应项目的推广目的
LandingType string `json:"landing_type,omitempty"`
LandingType enum.LandingType `json:"landing_type,omitempty"`
// ExternalAction 对应项目的转化目标
ExternalAction string `json:"external_action,omitempty"`
ExternalAction enum.AdConvertType `json:"external_action,omitempty"`
// Pricing 对应项目的计费类型
Pricing int `json:"pricing,omitempty"`
// DeepExternalAction 对应项目的深度转化目标
Expand Down
2 changes: 2 additions & 0 deletions marketing-api/model/v3/promotion/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ type ListFilter struct {
PromotionModifyTime string `json:"promotion_modify_time,omitempty"`
// RejectReasonType 审核建议类型,允许值:NONE 无建议、REVIEW_REJECT 审核不通过、LOW_MATERAIL 低质素材、DISCOMFORT 引人不适、QUALITY_POOR 素材质量低、EXAGGERATION 夸大宣传、ELSE 其他
RejectReasonType enum.PromotionRejectReasonType `json:"reject_reason_type,omitempty"`
// LearningPhase 学习期状态 允许值:LEARNING(学习期中)、LEARNED(学习期结束)、LEARN_FAILED(学习期失败)
LearningPhase []enum.LearningPhase `json:"learning_phase,omitempty"`
}

// Encode implement GetRequest interface
Expand Down
2 changes: 2 additions & 0 deletions marketing-api/model/v3/promotion/promotion.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ type Promotion struct {
PromotionModifyTime string `json:"promotion_modify_time,omitempty"`
// AdCreateTime 广告创建时间,格式yyyy-MM-dd HH:mm:ss
PromotionCreateTime string `json:"promotion_create_time,omitempty"`
// LearningPhase 学习期状态,枚举值:DEFAULT(默认,不在学习期中)、LEARNING(学习中)、LEARNED(学习成功)、LEARN_FAILED(学习失败)
LearningPhase enum.LearningPhase `json:"learning_phase,omitempty"`
// Status 广告状态,枚举值:NOT_DELETED 不限 、ALL 不限(包含已删除)、OK 投放中、DELETED 已删除、PROJECT_OFFLINE_BUDGET 项目超出预算、PROJECT_PREOFFLINE_BUDGET 项目接近预算、TIME_NO_REACH 未到达投放时间、TIME_DONE 已完成、NO_SCHEDULE 不在投放时段、AUDIT 新建审核中、REAUDIT 修改审核中、FROZEN 已终止、AUDIT_DENY 审核不通过、OFFLINE_BUDGET 广告超出预算、OFFLINE_BALANCE 账户余额不足、PREOFFLINE_BUDGET 广告接近预算、DISABLED 已暂停、PROJECT_DISABLED 已被项目暂停、LIVE_ROOM_OFF 关联直播间不可投、PRODUCT_OFFLINE 关联商品不可投,、AWEME_ACCOUNT_DISABLED 关联抖音账号不可投、AWEME_ANCHOR_DISABLED 锚点不可投、DISABLE_BY_QUOTA 已暂停(配额达限)、CREATE 新建、ADVERTISER_OFFLINE_BUDGET 账号超出预算、ADVERTISER_PREOFFLINE_BUDGET 账号接近预算
Status enum.PromotionStatus `json:"status,omitempty"`
// OptStatus 操作状态
Expand Down

0 comments on commit 010eda7

Please sign in to comment.