-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
730 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
marketing-api/api/qianchuan/advertiser/aweme_auth_list_get.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
11
marketing-api/api/qianchuan/uni_promotion/material_delete.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
15
marketing-api/api/qianchuan/uni_promotion/status_update.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
129
marketing-api/model/qianchuan/advertiser/aweme_auth_list_get.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.