Skip to content

Commit

Permalink
Merge branch 'release/v1.30.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
bububa committed Dec 24, 2024
2 parents 7da87aa + c45a81c commit 1076733
Show file tree
Hide file tree
Showing 7 changed files with 163 additions and 7 deletions.
2 changes: 2 additions & 0 deletions marketing-api/OCEANENGINE.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,10 @@
- 获取 DPA 商品库视频模板 [ VideoGet(clt *core.SDKClient, accessToken string, req *dpa.VideoGetRequest) (*dpa.VideoGetResponseData, error) ]
- 创建DPA商品(已有商品id)/修改DPA商品 [ ProductUpdate(clt *core.SDKClient, accessToken string, req *dpa.ProductUpdateRequest) (uint64, error) ]
- 创建DPA商品(无商品id) [ ProductCreate(clt *core.SDKClient, accessToken string, req *dpa.ProductCreateRequest) (uint64, error) ]
- 创建/编辑升级版商品 [ ClueProductSave(ctx context.Context, clt *core.SDKClient, accessToken string, req *dpa.ClueProductSaveRequest) (*dpa.ClueProductSaveResult, error) ]
- 批量修改DPA商品状态 [ ProductStatusBatchUpdate(clt *core.SDKClient, accessToken string, req *dpa.ProductStatusBatchUpdateRequest) (*dpa.ProductStatusBatchUpdateResponseData, error) ]
- 删除DPA商品 [ ProductDelete(clt *core.SDKClient, accessToken string, req *dpa.ProductDeleteRequest) error ]
- 删除升级版商品 [ ClueProductDelete(ctx context.Context, clt *core.SDKClient, accessToken string, req *dpa.ClueProductDeleteRequest) (*dpa.ClueProductDeleteResult, error) ]
- 查询短剧商品原片授权申请状态 [ PlayletAuthGet(clt *core.SDKClient, accessToken string, req *dpa.PlayletAuthGetRequest) (*dpa.PlayletAuthGetResult, error) ]
- 素材管理 (api/file)
- 上传广告主图片 [ ImageAdvertiser(clt *core.SDKClient, accessToken string, req *file.ImageAdvertiserRequest) (*file.Image, error) ]
Expand Down
18 changes: 18 additions & 0 deletions marketing-api/api/dpa/clue_product_delete.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package dpa

import (
"context"

"github.com/bububa/oceanengine/marketing-api/core"
"github.com/bububa/oceanengine/marketing-api/model/dpa"
)

// ClueProductDelete 删除升级版商品
// 【使用场景】对广告主创建的「升级版」商品进行删除操作,注意已经关联计划的商品不允许进行删除,支持批量,一次性调用最大个数为100,服务为部分成功部分失败。
func ClueProductDelete(ctx context.Context, clt *core.SDKClient, accessToken string, req *dpa.ClueProductDeleteRequest) (*dpa.ClueProductDeleteResult, error) {
var resp dpa.ClueProductDeleteResponse
if err := clt.PostAPI(ctx, "2/dpa/clue_product/delete/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data, nil
}
1 change: 1 addition & 0 deletions marketing-api/api/dpa/clue_product_save.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/bububa/oceanengine/marketing-api/model/dpa"
)

// ClueProductSave 创建/编辑升级版商品
func ClueProductSave(ctx context.Context, clt *core.SDKClient, accessToken string, req *dpa.ClueProductSaveRequest) (*dpa.ClueProductSaveResult, error) {
var resp dpa.ClueProductSaveResponse
if err := clt.PostAPI(ctx, "2/dpa/clue_product/save/", req, &resp, accessToken); err != nil {
Expand Down
13 changes: 13 additions & 0 deletions marketing-api/enum/aweme_auth_share_type.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package enum

// AwemeAuthShareType 授权共享类型
type AwemeAuthShareType = string

const (
// AwemeAuthShareType_SHARE_BY_ONESELF 广告账户自主授权
AwemeAuthShareType_SHARE_BY_ONESELF AwemeAuthShareType = "SHARE_BY_ONESELF"
// AwemeAuthShareType_SHARE_BY_SAME_ENTITY 客户共享授权
AwemeAuthShareType_SHARE_BY_SAME_ENTITY AwemeAuthShareType = "SHARE_BY_SAME_ENTITY"
// AwemeAuthShareType_SHARE_FROM_BP 组织共享授权
AwemeAuthShareType_SHARE_FROM_BP AwemeAuthShareType = "SHARE_FROM_BP"
)
23 changes: 17 additions & 6 deletions marketing-api/enum/aweme_auth_sub_status.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
package enum

// AwemeAuthSubStatus 授权子状态
type AwemeAuthSubStatus string

const (
// AwemeAuthSubStatus_RENEWING 续期待确认
AwemeAuthSubStatus_RENEWING AwemeAuthSubStatus = "RENEWING"
// AwemeAuthSubStatus_RENEW_FAIL 续期申请失效
AwemeAuthSubStatus_RENEW_FAIL AwemeAuthSubStatus = "RENEW_FAIL"
// AwemeAuthSubStatus_RENEW_SUCCESS 续期成功
AwemeAuthSubStatus_RENEW_SUCCESS AwemeAuthSubStatus = "RENEW_SUCCESS"
// AwemeAuthSubStatus_RENEW_FAILED_BY_AWEME 授权续期申请失败
AwemeAuthSubStatus_RENEW_FAILED_BY_AWEME AwemeAuthSubStatus = "RENEW_FAILED_BY_AWEME"
// AwemeAuthSubStatus_INVALID_CANCEL 主动操作解除授权
AwemeAuthSubStatus_INVALID_CANCEL AwemeAuthSubStatus = "INVALID_CANCEL"
// AwemeAuthSubStatus_INVALID_EXPIRED 授权期限已到
Expand All @@ -11,10 +20,12 @@ const (
AwemeAuthSubStatus_INVALID_REJECT AwemeAuthSubStatus = "INVALID_REJECT"
// AwemeAuthSubStatus_INVALID_TIME_OUT 超时未确认
AwemeAuthSubStatus_INVALID_TIME_OUT AwemeAuthSubStatus = "INVALID_TIME_OUT"
// AwemeAuthSubStatus_RENEWING 续期待确认
AwemeAuthSubStatus_RENEWING AwemeAuthSubStatus = "RENEWING"
// AwemeAuthSubStatus_RENEW_FAIL 续期申请失效
AwemeAuthSubStatus_RENEW_FAIL AwemeAuthSubStatus = "RENEW_FAIL"
// AwemeAuthSubStatus_RENEW_SUCCESS 续期成功
AwemeAuthSubStatus_RENEW_SUCCESS AwemeAuthSubStatus = "RENEW_SUCCESS"
// AwemeAuthSubStatus_INVALID_FAILED_BY_AWEME 授权申请失败
AwemeAuthSubStatus_INVALID_FAILED_BY_AWEME AwemeAuthSubStatus = "INVALID_FAILED_BY_AWEME"
// AwemeAuthSubStatus_INVALID_PROCESS_TIME_OUT 超时未处理自动解除
AwemeAuthSubStatus_INVALID_PROCESS_TIME_OUT AwemeAuthSubStatus = "INVALID_PROCESS_TIME_OUT"
// AwemeAuthSubStatus_AWEME_REVOKE_REQUEST 创作者发起解除申请
AwemeAuthSubStatus_AWEME_REVOKE_REQUEST AwemeAuthSubStatus = "AWEME_REVOKE_REQUEST"
// AwemeAuthSubStatus_CONFIRM_REVOKE_REQUEST 同意解除授权申请
AwemeAuthSubStatus_CONFIRM_REVOKE_REQUEST AwemeAuthSubStatus = "CONFIRM_REVOKE_REQUEST"
)
56 changes: 56 additions & 0 deletions marketing-api/model/dpa/clue_product_delete.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package dpa

import (
"strconv"

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

// ClueProductDeleteRequest 删除升级版商品 API Request
type ClueProductDeleteRequest struct {
// AdvertiserID 广告主ID
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
// ProductIDs 通过巨量商品id删除,支持批量,一次请求最多允许传入100
ProductIDs uint64 `json:"product_ids,omitempty"`
// StoreIDAndOuterID 电商店铺商品(category_id为140000000时)支持按照店铺id+外部商品id删除,其他类目商品不需要传
StoreIDAndOuterID *StoreIDAndOuterID `json:"store_id_and_outer_id,omitempty"`
}

// StoreIDAndOuterID 电商店铺商品
type StoreIDAndOuterID struct {
// StoreID 店铺ID,传入时必须与商品外部ID同时传入
StoreID string `json:"store_id,omitempty"`
// OuterID 商品外部ID
OuterID string `json:"outer_id,omitempty"`
}

// Encode implements PostRequest interface
func (r ClueProductDeleteRequest) Encode() []byte {
return util.JSONMarshal(r)
}

// ClueProductDeleteResponse 删除升级版商品 API Request
type ClueProductDeleteResponse struct {
model.BaseResponse
Data *ClueProductDeleteResult `json:"data,omitempty"`
}

type ClueProductDeleteResult struct {
// ProductIDs 删除成功的商品ID集合
ProductIDs []uint64 `json:"product_ids,omitempty"`
// Errors 删除失败的商品ID集合及错误信息
Errors []ClueProductDeleteError `json:"errors,omitempty"`
}

// Error 删除失败的商品ID集合及错误信息
type ClueProductDeleteError struct {
// ProductID 商品ID
ProductID uint64 `json:"product_id,omitempty"`
// ErrorMessage 错误信息(主要的可能错误为商品关联了在投计划)
ErrorMessage string `json:"error_message,omitempty"`
}

func (r ClueProductDeleteError) Error() string {
return util.StringsJoin(r.ErrorMessage, "(", strconv.FormatUint(r.ProductID, 10), ")")
}
57 changes: 56 additions & 1 deletion marketing-api/model/tools/aweme_auth_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,49 @@ type AwemeAuthItem struct {
// AuthStatus 授权状态
AuthStatus enum.AwemeAuthStatus `json:"auth_status,omitempty"`
// SubStatus 授权子状态,返回值
// INVALID_CANCEL: 主动操作解除授权、INVALID_EXPIRED: 授权期限已到、INVALID_REJECT: C端拒绝授权、INVALID_TIME_OUT: 超时未确认、RENEWING: 续期待确认、RENEW_FAIL: 续期申请失效、RENEW_SUCCESS: 续期成功
// RENEWING 续期待确认
// RENEW_FAIL 续期失效
// RENEW_SUCCESS 续期成功
// INVALID_TIME_OUT 超时未确认
// INVALID_EXPIRED 授权期限已到
// INVALID_CANCEL 主动操作解除授权
// INVALID_REJECT 抖音号作者拒绝授权
// INVALID_FAILED_BY_AWEME 授权申请失败
// RENEW_FAILED_BY_AWEME 授权续期申请失败
// AWEME_REVOKE_REQUEST 创作者发起解除申请
// INVALID_PROCESS_TIME_OUT 超时未处理自动解除
// CONFIRM_REVOKE_REQUEST 同意解除授权申请
SubStatus enum.AwemeAuthSubStatus `json:"sub_status,omitempty"`
// StartTime 授权开始时间,格式为yyyy-MM-dd HH:mm:ss
StartTime string `json:"start_time,omitempty"`
// EndTime 授权结束时间,格式为yyyy-MM-dd HH:mm:ss
EndTime string `json:"end_time,omitempty"`
// VideoInfo 授权视频信息,若为单视频授权会返回
VideoInfo *AwemeAuthVideo `json:"video_info,omitempty"`
// Note 备注信息,发起抖音授权申请时填写的希望展示给抖音号创作者的备注,创作者可在授权邀请页&授权详情页查看
Note string `json:"note,omitempty"`
// AwemeCancelReason 抖音号作者发起解除授权的原因,仅当抖音号作者发起解除授权时有值,100字以内,可能包括:
// 不知道该授权是怎么建立的,申请解除授权
// 联系不到对方,无法进行合作沟通,申请解除授权
// 与对方合作到期或者有纠纷,申请解除授权
// 其他情况(作者会填写其他文案给到)
AwemeCancelReason string `json:"aweme_cancel_reason,omitempty"`
// AwemeCancelImageList 抖音号作者发起解除授权时上传的凭证信息(选填项,抖音号作者可能不填,此时该参数返回为null)
AwemeCancelImageList []string `json:"aweme_cancel_image_list,omitempty"`
// AwemeCancelNote 抖音号作者发起解除授权时填写的联系方式(选填项,抖音号作者可能不填,此时该参数返回为null)
AwemeCancelNote string `json:"aweme_cancel_note,omitempty"`
// WarningContent 抖音授权关系警告信息,您可根据该信息及时处理,可能返回
// 不达门槛:表示发起授权的抖音号未达到要求,详细未达门槛信息可通过auth_threshold_info获取
// 即将解除:表示抖音号作者已发起解除授权申请,您需要及时联系作者或同意解除
WarningContent []string `json:"warning_content,omitempty"`
// AuthThresholdInfo 当抖音号不达授权门槛时,您可通过此结构体获取具体不达门槛的原因并及时处理
// 当抖音号正常时,该结构体下信息会返回为空
AuthThresholdInfo *AwemeAuthThresholdInfo `json:"auth_threshold_info,omitempty"`
// HasVideoHpVisibilityLimit 发布新视频素材到该抖音号下时,视频主页可见性只能设置「仅单次展示可见」,枚举值:
// true:是
// false:否,表示无此限制
// 当值返回true时,代表在创建广告时添加新视频素材到该抖音号下推广,视频的主页可见性设置只允许HIDE_VIDEO_ON_HP「仅单次展示可见」
HasVideoHpVisibilityLimit bool `json:"has_video_hp_visibility_limit,omitempty"`
}

// AwemeAuthVideo 授权视频信息,若为单视频授权会返回
Expand All @@ -117,3 +152,23 @@ type AwemeAuthVideo struct {
// (仅抖音视频会有此字段,抖音图文素材没有此字段)
Mid string `json:"mid,omitempty"`
}

// AwemeAuthThresholdInfo 当抖音号不达授权门槛时,您可通过此结构体获取具体不达门槛的原因并及时处理
type AwemeAuthThresholdInfo struct {
// IsAudit 是否已成年
// true表示 是
// false 表示 否,表示未成年,会导致不达门槛A
IsAudit bool `json:"is_audit,omitempty"`
// IsRealNameCert 是否已实名
// true表示 是
// false 表示 否,表示未实名,会导致不达门槛
IsRealNameCert bool `json:"is_real_name_cert,omitempty"`
// IsSeriousViolation 是否严重违规,
// true表示 严重违规,会导致不达门槛
// false 表示 没有严重违规
IsSeriousViolation bool `json:"is_serious_violation,omitempty"`
// IsReachedRiseFansCount 有效涨粉数是否达到1000
// true表示 达到
// false 表示 否,表示没有达到1000,会导致不达门槛
IsReachedRiseFansCount bool `json:"is_reached_rise_fans_count,omitempty"`
}

0 comments on commit 1076733

Please sign in to comment.