Skip to content

Commit

Permalink
Merge branch 'release/v1.26.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
bububa committed Aug 1, 2024
2 parents d009fed + 21b5eb0 commit 8f324d9
Show file tree
Hide file tree
Showing 27 changed files with 730 additions and 24 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ go 1.20

require (
github.com/google/go-cmp v0.5.5
google.golang.org/protobuf v1.33.0
google.golang.org/protobuf v1.34.2
)
8 changes: 2 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
7 changes: 7 additions & 0 deletions marketing-api/QIANCHUAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- 账户管理
- 账户关系获取
- 获取千川账户下已授权抖音号 [ aweme.AuthorizedGet(clt *core.SDKClient, accessToken string, req *aweme.AuthorizedGetRequest) (*aweme.AuthorizedGetResponseData, error) ]
- 获取千川账户下抖音号授权列表 [ advertiser.AwemeAuthListGet(clt *core.SDKClient, accessToken string, req *advertiser.AwemeAuthListGetRequest) (*advertiser.AwemeAuthListGetResult, error) ]
- 获取已授权的账户(店铺/代理商)[ oauth.AdvertiserGet(clt \*core.SDKClient, accessToken string) ([]oauth.Advertiser, error) ]
- 获取店铺账户关联的广告账户列表 [ shop.AdvertiserList(clt *core.SDKClient, accessToken string, req *shop.AdvertiserListRequest) (*shop.AdvertiserListResponseData, error) ]
- 获取代理商账户关联的广告账户列表 [ advertiser.AdvertiserSelect(clt *core.SDKClient, accessToken string, req *agent.AdvertiserSelectRequest) (*agent.AdvertiserSelectResponseData, error) ]
Expand Down Expand Up @@ -80,7 +81,13 @@
- 获取否定词列表 [ PrivatewordsGet(clt *core.SDKClient, accessToken string, req *ad.PrivatewordsGetRequest) (*ad.PrivateWords, error) ]
- 全量更新否定词 [ PrivatewordsUpdate(clt *core.SDKClient, accessToken string, req *ad.PrivatewordsUpdateRequest) (*ad.PrivatewordsUpdateResult, error) ]
- 全域推广 (api/qianchuan/uni_promotion)
- 新建全域推广计划 [ Create(clt *core.SDKClient, accessToken string, req *unipromotion.CreateRequest) (uint64, error) ]
- 编辑全域推广计划 [ Update(clt *core.SDKClient, accessToken string, req *unipromotion.UpdateRequest) (*unipromotion.UpdateResult, error) ]
- 更改全域推广计划状态 [ StatusUpdate(clt *core.SDKClient, accessToken string, req *unipromotion.StatusUpdateRequest) ([]unipromotion.StatusUpdateResult, error) ]
- 获取全域推广列表 [ List(clt *core.SDKClient, accessToken string, req *unipromotion.ListRequest) (*unipromotion.ListResult, error) ]
- 获取全域推广计划详情 [ Detail(clt *core.SDKClient, accessToken string, req *unipromotion.DetailRequest) (*unipromotion.AdDetail, error) ]
- 获取全域推广计划下素材 [ MaterialGet(clt *core.SDKClient, accessToken string, req *unipromotion.MaterialGetRequest) (*unipromotion.MaterialGetResult, error) ]
- 删除全域推广计划下素材 [ MaterialDelete(clt *core.SDKClient, accessToken string, req *unipromotion.MaterialDeleteRequest) error ]
- 获取可投全域推广抖音号列表 [ AuthorizedGet(clt *core.SDKClient, accessToken string, req *unipromotion.AuthorizedGetRequest) (*unipromotion.AuthorizedGetResult, error) ]
- 数据报表 (api/qianchuan/report)
- 广告数据报表
Expand Down
16 changes: 16 additions & 0 deletions marketing-api/api/qianchuan/advertiser/aweme_auth_list_get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package advertiser

import (
"github.com/bububa/oceanengine/marketing-api/core"
"github.com/bububa/oceanengine/marketing-api/model/qianchuan/advertiser"
)

// AwemeAuthListGet 获取千川账户下抖音号授权列表
// 获取千川账户下抖音号授权列表,对齐千川PC抖音号授权管理模块
func AwemeAuthListGet(clt *core.SDKClient, accessToken string, req *advertiser.AwemeAuthListGetRequest) (*advertiser.AwemeAuthListGetResult, error) {
var resp advertiser.AwemeAuthListGetResponse
if err := clt.Get("v1.0/qianchuan/aweme_auth_list/get/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data, nil
}
16 changes: 16 additions & 0 deletions marketing-api/api/qianchuan/uni_promotion/create.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package unipromotion

import (
"github.com/bububa/oceanengine/marketing-api/core"
unipromotion "github.com/bububa/oceanengine/marketing-api/model/qianchuan/uni_promotion"
)

// Create 新建全域推广计划
// 新建全域推广计划,当前仅支持「直播全域推广-控成本投放」链路
func Create(clt *core.SDKClient, accessToken string, req *unipromotion.CreateRequest) (uint64, error) {
var resp unipromotion.CreateResponse
if err := clt.Post("v1.0/qianchuan/uni_aweme/ad/create/", req, &resp, accessToken); err != nil {
return 0, err
}
return resp.Data.AdID, nil
}
15 changes: 15 additions & 0 deletions marketing-api/api/qianchuan/uni_promotion/detail.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package unipromotion

import (
"github.com/bububa/oceanengine/marketing-api/core"
unipromotion "github.com/bububa/oceanengine/marketing-api/model/qianchuan/uni_promotion"
)

// Detail 获取全域推广计划详情
func Detail(clt *core.SDKClient, accessToken string, req *unipromotion.DetailRequest) (*unipromotion.AdDetail, error) {
var resp unipromotion.DetailResponse
if err := clt.Get("v1.0/qianchuan/uni_promotion/ad/detail/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data, nil
}
11 changes: 11 additions & 0 deletions marketing-api/api/qianchuan/uni_promotion/material_delete.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package unipromotion

import (
"github.com/bububa/oceanengine/marketing-api/core"
unipromotion "github.com/bububa/oceanengine/marketing-api/model/qianchuan/uni_promotion"
)

// MaterialDelete 删除全域推广计划下素材
func MaterialDelete(clt *core.SDKClient, accessToken string, req *unipromotion.MaterialDeleteRequest) error {
return clt.Post("v1.0/qianchuan/uni_promotion/ad/material/delete/", req, nil, accessToken)
}
15 changes: 15 additions & 0 deletions marketing-api/api/qianchuan/uni_promotion/material_get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package unipromotion

import (
"github.com/bububa/oceanengine/marketing-api/core"
unipromotion "github.com/bububa/oceanengine/marketing-api/model/qianchuan/uni_promotion"
)

// MaterialGet 获取全域推广计划下素材
func MaterialGet(clt *core.SDKClient, accessToken string, req *unipromotion.MaterialGetRequest) (*unipromotion.MaterialGetResult, error) {
var resp unipromotion.MaterialGetResponse
if err := clt.Get("v1.0/qianchuan/uni_promotion/ad/material/get/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data, nil
}
15 changes: 15 additions & 0 deletions marketing-api/api/qianchuan/uni_promotion/status_update.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package unipromotion

import (
"github.com/bububa/oceanengine/marketing-api/core"
unipromotion "github.com/bububa/oceanengine/marketing-api/model/qianchuan/uni_promotion"
)

// StatusUpdate 更改全域推广计划状态
func StatusUpdate(clt *core.SDKClient, accessToken string, req *unipromotion.StatusUpdateRequest) ([]unipromotion.StatusUpdateResult, error) {
var resp unipromotion.StatusUpdateResponse
if err := clt.Post("v1.0/qianchuan/uni_promotion/ad/status/update/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data.Results, nil
}
15 changes: 15 additions & 0 deletions marketing-api/api/qianchuan/uni_promotion/update.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package unipromotion

import (
"github.com/bububa/oceanengine/marketing-api/core"
unipromotion "github.com/bububa/oceanengine/marketing-api/model/qianchuan/uni_promotion"
)

// Update 编辑全域推广计划
func Update(clt *core.SDKClient, accessToken string, req *unipromotion.UpdateRequest) (*unipromotion.UpdateResult, error) {
var resp unipromotion.UpdateResponse
if err := clt.Post("v1.0/qianchuan/uni_aweme/ad/update/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data, nil
}
129 changes: 129 additions & 0 deletions marketing-api/model/qianchuan/advertiser/aweme_auth_list_get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
package advertiser

import (
"strconv"

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

// AwemeAuthListGetRequest 获取千川账户下抖音号授权列表 API Request
type AwemeAuthListGetRequest struct {
// Filtering 过滤条件
Filtering *AwemeAuthListGetFilter `json:"filtering,omitempty"`
// AdvertiserID 广告主id
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
// Page 页码,默认1
Page int `json:"page,omitempty"`
// PageSize 页码大小,可选值:10、20、50、100,默认10
PageSize int `json:"page_size,omitempty"`
}

// AwemeAuthListGetFilter 过滤条件
type AwemeAuthListGetFilter struct {
// AwemeShowID 抖音show_id
// 注意:最多支持100个抖音号
AwemeShowID []string `json:"aweme_show_id,omitempty"`
// AwemeID 抖音id
// 注意:最多支持100个抖音号
AwemeID []uint64 `json:"aweme_id,omitempty"`
// AuthStatus 授权状态筛选 可选值:
// ALL 全部授权状态
// EFFECTIVE 授权生效
// EXPIRED 授权失效
// WAIT_BIND 待达人确认授权
AuthStatus string `json:"auth_status,omitempty"`
// AuthType 授权类型筛选,仅支持传0,1,2,3 可选值:
// ALL 全部授权类型
// AWEME_COOPERATOR 合作达人
// OFFICIAL 官方
// SELF 自运营
AuthType string `json:"auth_type,omitempty"`
// AwemeName 抖音号名称
// 注意:模糊查询
AwemeName string `json:"aweme_name,omitempty"`
// AuthRange 授权范围筛选 可选值:
// ALL 全部授权
// BY_AWEME 抖音号授权
// BY_VIDEO 单视频授权
AuthRange string `json:"auth_range,omitempty"`
// IsCancellationProgress 待处理解除授权申请
// 默认 false
IsCancellationProgress bool `json:"is_cancellation_progress,omitempty"`
}

// Encode implement GetRequest interface
func (r AwemeAuthListGetRequest) Encode() string {
values := util.GetUrlValues()
values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10))
if r.Filtering != nil {
values.Set("filtering", string(util.JSONMarshal(r.Filtering)))
}
if r.Page > 0 {
values.Set("page", strconv.Itoa(r.Page))
}
if r.PageSize > 0 {
values.Set("page_size", strconv.Itoa(r.PageSize))
}
ret := values.Encode()
util.PutUrlValues(values)
return ret
}

// AwemeAuthListGetResponse 获取千川账户下抖音号授权列表 API Response
type AwemeAuthListGetResponse struct {
Data *AwemeAuthListGetResult `json:"data,omitempty"`
model.BaseResponse
}

type AwemeAuthListGetResult struct {
// PageInfo 分页信息
PageInfo *model.PageInfo `json:"page_info,omitempty"`
// AuthorizationInfos 抖音号列表
AuthorizationInfos []AwemeAuthInfo `json:"authorization_infos,omitempty"`
}

// AwemeAuthInfo 抖音号授权信息
type AwemeAuthInfo struct {
// AuthVideoInfo 视频信息
AuthVideoInfo *AwemeAuthVideoInfo `json:"auth_video_info,omitempty"`
// AuthType 抖音号授权类型
AuthType []string `json:"auth_type,omitempty"`
// AwemeShowID 抖音号,即客户在手机端上看到的抖音号,若向客户披露抖音号请使用该字段
AwemeShowID string `json:"aweme_show_id,omitempty"`
// AwemeAvatar 抖音号头像
AwemeAvatar string `json:"aweme_avatar,omitempty"`
// AwemeName 抖音号名称
AwemeName string `json:"aweme_name,omitempty"`
// AuthSource 授权来源
// STAR 星图
// QIANCHUAN 千川PC
// AWEME 随心推
AuthSource string `json:"auth_source,omitempty"`
// StartTime 授权开始时间
StartTime string `json:"start_time,omitempty"`
// EndTime 授权结束时间
EndTime string `json:"end_time,omitempty"`
// CreateTime 授权时间
CreateTime string `json:"create_time,omitempty"`
// AuthStatus 授权状态
AuthStatus string `json:"auth_status,omitempty"`
// AuthRange 授权范围
AuthRange string `json:"auth_range,omitempty"`
// AwemeID 抖音id
AwemeID uint64 `json:"aweme_id,omitempty"`
// IsCancellationProgress 是否有待处理解除授权申请
IsCancellationProgress bool `json:"is_cancellation_progress,omitempty"`
}

// AwemeAuthVideoInfo 视频信息
type AwemeAuthVideoInfo struct {
// VideoID 视频 ID
VideoID string `json:"video_id,omitempty"`
// AwemeItemID 抖音短视频 ID
AwemeItemID string `json:"aweme_item_id,omitempty"`
// Title 抖音中的视频标题
Title string `json:"title,omitempty"`
// VideoCoverURL 视频封面
VideoCoverURL string `json:"video_cover_url,omitempty"`
}
10 changes: 10 additions & 0 deletions marketing-api/model/qianchuan/aweme/aweme.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,14 @@ type Aweme struct {
// false:未创建过计划, 可以新建
// true:已经创建过计划,不支持新建
HasRoi2GroupCreate bool `json:"has_roi2_group_create,omitempty"`
// HasShopPermission 是否有推商品全域推广权限
HasShopPermission bool `json:"has_shop_permission,omitempty"`
// HasLivePermission 是否有直播全域推广权限
HasLivePermission bool `json:"has_live_permission,omitempty"`
// CanControlUniprom 当前账户是该抖音号的官方巨量千川账户,对其他账户解除授权即可正常使用直播全域推广,是否需要解除授权
CanControlUniprom bool `json:"can_control_uniprom,omitempty"`
// CanApplyUniprom 抖音号是否可申请
CanApplyUniprom bool `json:"can_apply_uniprom,omitempty"`
// AnchorForbidden 抖音号是否禁用
AnchorForbidden bool `json:"anchor_forbidden,omitempty"`
}
16 changes: 8 additions & 8 deletions marketing-api/model/qianchuan/live/room.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import "github.com/bububa/oceanengine/marketing-api/enum"

// Room 直播间信息
type Room struct {
// RoomID 直播间id
RoomID uint64 `json:"room_id,omitempty"`
// RoomStatus 直播间状态
RoomStatus enum.LiveRoomStatus `json:"room_status,omitempty"`
// RoomTitle 直播间标题
Expand All @@ -16,18 +14,20 @@ type Room struct {
StartTime string `json:"start_time,omitempty"`
// EndTime 直播结束时间
EndTime string `json:"end_time,omitempty"`
// AwemeID 抖音号id
AwemeID uint64 `json:"aweme_id,omitempty"`
// AwemeName 抖音号名称
AwemeName string `json:"aweme_name,omitempty"`
// AwemeAvatar 抖音号头像url列表
AwemeAvatar string `json:"aweme_avatar,omitempty"`
// RoomDelivery 在投计划数
RoomDelivery int64 `json:"room_delivery,omitempty"`
// AnchorID 主播ID
AnchorID uint64 `json:"anchor_id,omitempty"`
// AnchorName 主播名称
AnchorName string `json:"anchor_name,omitempty"`
// AnchorAvatar 主播头像
AnchorAvatar string `json:"anchor_avatar,omitempty"`
// RoomID 直播间id
RoomID uint64 `json:"room_id,omitempty"`
// AwemeID 抖音号id
AwemeID uint64 `json:"aweme_id,omitempty"`
// RoomDelivery 在投计划数
RoomDelivery int64 `json:"room_delivery,omitempty"`
// AnchorID 主播ID
AnchorID uint64 `json:"anchor_id,omitempty"`
}
Loading

0 comments on commit 8f324d9

Please sign in to comment.