Skip to content

Commit

Permalink
Merge branch 'release/v1.21.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
bububa committed Nov 24, 2023
2 parents e1b65c3 + 4ebd8b4 commit 1f62488
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 5 deletions.
8 changes: 6 additions & 2 deletions marketing-api/api/advertiser/delivery_qualification_submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import (
// - 对于一份完整资质的多张图片请上传至一个资质id中,例如一份经销授权书的3张图片内容
// 1. 错误方式:分3次调用接口,会导致资质接收不全而被拒绝
// 2. 正确方式:将一份完整的资质调一次接口上传至一个资质中,保证审核平台能够一次收到完整的资质内容
func DeliveryQualificationSubmit(clt *core.SDKClient, accessToken string, req *advertiser.DeliveryQualificationSubmitRequest) error {
return clt.Post("v3.0/advertiser/delivery_qualification/submit/", req, nil, accessToken)
func DeliveryQualificationSubmit(clt *core.SDKClient, accessToken string, req *advertiser.DeliveryQualificationSubmitRequest) ([]uint64, error) {
var resp advertiser.DeliveryQualificationSubmitResponse
if err := clt.Post("v3.0/advertiser/delivery_qualification/submit/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data.QualificationIDs, nil
}
26 changes: 26 additions & 0 deletions marketing-api/enum/image_mode.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package enum

import "strconv"

// ImageMode 素材类型
// 不符合下列素材类型尺寸比例,投放后台不显示
type ImageMode string
Expand Down Expand Up @@ -39,3 +41,27 @@ const (
// SEARCH_DISPLAY_WINDOW_IMAGE 搜索橱窗橱窗
SEARCH_DISPLAY_WINDOW_IMAGE ImageMode = "SEARCH_DISPLAY_WINDOW_IMAGE"
)

// UnmarshalJSON implement json Unmarshal interface
func (im *ImageMode) UnmarshalJSON(b []byte) (err error) {
if b[0] == '"' && b[len(b)-1] == '"' {
b = b[1 : len(b)-1]
}
str := string(b)
if i, err := strconv.ParseUint(str, 10, 64); err != nil {
*im = ImageMode(str)
return nil
} else {
switch i {
case 1:
*im = INFORMATION_FLOW_IMAGE
case 2:
*im = TOUTIAO_SEARCH_AD_IMAGE
case 3:
*im = SEARCH_DISPLAY_WINDOW_IMAGE
default:
*im = ImageMode(str)
}
}
return
}
6 changes: 6 additions & 0 deletions marketing-api/enum/material_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ const (
MaterialSource_BP MaterialSource = "BP"
// MaterialSource_E_COMMERCE 巨量千川
MaterialSource_E_COMMERCE MaterialSource = "E_COMMERCE"
// MaterialSource_DPA_MERSCHANT_CENTER 行业产品中心
MaterialSource_DPA_MERSCHANT_CENTER MaterialSource = "DPA_MERSCHANT_CENTER"
// MaterialSource_QF_FUWU 群峰服务市场
MaterialSource_QF_FUWU MaterialSource = "QF_FUWU"
// MaterialSource_AIC 即创
MaterialSource_AIC MaterialSource = "AIC"
// MaterialSource_OTHERS 其他来源
MaterialSource_OTHERS MaterialSource = "OTHERS"
)
10 changes: 10 additions & 0 deletions marketing-api/model/advertiser/delivery_qualification_submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package advertiser

import (
"github.com/bububa/oceanengine/marketing-api/enum"
"github.com/bububa/oceanengine/marketing-api/model"
"github.com/bububa/oceanengine/marketing-api/util"
)

Expand All @@ -25,3 +26,12 @@ type DeliverySubmitQualification struct {
func (r DeliveryQualificationSubmitRequest) Encode() []byte {
return util.JSONMarshal(r)
}

// DeliveryQualificationSubmitResponse 提交投放资质(新版)API Response
type DeliveryQualificationSubmitResponse struct {
model.BaseResponse
Data struct {
// QualificationIDs 资质id列表
QualificationIDs []uint64 `json:"qualification_ids,omitempty"`
} `json:"data,omitempty"`
}
6 changes: 6 additions & 0 deletions marketing-api/model/file/video_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"
"github.com/bububa/oceanengine/marketing-api/model"
"github.com/bububa/oceanengine/marketing-api/util"
)
Expand Down Expand Up @@ -44,6 +45,11 @@ type VideoGetFilter struct {
StartTime string `json:"start_time,omitempty"`
// EndTime 根据视频上传时间进行过滤的截止时间,与start_time搭配使用,格式:yyyy-mm-dd
EndTime string `json:"end_time,omitempty"`
// Labels 视频标签
Labels []string `json:"labels,omitempty"`
// Source 素材来源,详见【附录-素材来源】
// 枚举值大小写敏感,请严格按照定义的名称传参
Source []enum.MaterialSource `json:"source,omitempty"`
}

// Encode implement GetRequest interface
Expand Down
2 changes: 1 addition & 1 deletion marketing-api/model/tools/diagnosis/suggest.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type AdSuggestion struct {

// SuggestScene 计划对应的场景
type SuggestScene struct {
// Scene 场景名称,允许值:CLEAN清理低质计划场景、POTENTIAL获取潜力计划场景
// Scene 场景名称,允许值:CLEAN清理低质计划场景、POTENTIAL获取潜力计划场景, ZOMBIE 活跃度低广告(暂为白名单功能,如需获取请联系运营或销售)
Scene string `json:"scene,omitempty"`
// Suggestions 建议列表
Suggestions []Suggestion `json:"suggestions,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion marketing-api/model/tools/diagnosis/v3/suggestion_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type SuggestionGetRequest struct {
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
// PromotionIDs 广告计划ID列表,最多100个
PromotionIDs []uint64 `json:"ad_ids,omitempty"`
// Scenes 希望获取建议的场景,允许值:CLEAN 清理低质计划场景、POTENTIAL 获取潜力计划场景
// Scenes 希望获取建议的场景,允许值:CLEAN 清理低质计划场景、POTENTIAL 获取潜力计划场景, ZOMBIE 活跃度低广告(暂为白名单功能,如需获取请联系运营或销售)
Scenes []string `json:"scenes,omitempty"`
}

Expand Down
2 changes: 1 addition & 1 deletion marketing-api/model/v3/promotion/promotion.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ type CarouselMaterial struct {
// MaterialStatus 素材审核状态
MaterialStatus string `json:"material_status,omitempty"`
// CarouselType 图集素材类型
CarouselType int `json:"carousel_type,omitempty"`
CarouselType enum.ImageMode `json:"carousel_type,omitempty"`
// ImageSubject 图片主题
ImageSubject []file.ImageSubject `json:"image_subject,omitempty"`
}

0 comments on commit 1f62488

Please sign in to comment.