Skip to content

Commit

Permalink
Merge branch 'release/v1.28.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
bububa committed Oct 11, 2024
2 parents 29b5c04 + aadb555 commit 876d50e
Show file tree
Hide file tree
Showing 105 changed files with 3,305 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
- [巨量引擎开放平台SDK](https://github.com/bububa/oceanengine/blob/master/marketing-api/OCEANENGINE.md)
- [巨量千川开放平台SDK](https://github.com/bububa/oceanengine/blob/master/marketing-api/QIANCHUAN.md)
- [巨量星图开放平台SDK](https://github.com/bububa/oceanengine/blob/master/marketing-api/STAR.md)
- [巨量本地推开放平台SDK](https://github.com/bububa/oceanengine/blob/master/marketing-api/LOCAL.md)
- [企业号开放平台SDK](https://github.com/bububa/oceanengine/blob/master/marketing-api/ENTERPRISE.md)
- [巨量应用市场SDK](https://github.com/bububa/oceanengine/blob/master/marketing-api/SERVE_MARKET.md)
29 changes: 29 additions & 0 deletions marketing-api/LOCAL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 本地推 Golang SDK

- 项目管理模块 (local/project)
- 创建项目 [ Create(ctx context.Context, clt *core.SDKClient, accessToken string, req *project.CreateRequest) (uint64, error) ]
- 更新项目 [ Update(ctx context.Context, clt *core.SDKClient, accessToken string, req *project.UpdateRequest) error ]
- 获取项目列表 [ List(ctx context.Context, clt *core.SDKClient, accessToken string, req *project.ListRequest) (*project.ListResult, error) ]
- 获取项目详情 [ Detail(ctx context.Context, clt *core.SDKClient, accessToken string, req *project.DetailRequest) (*project.ProjectDetail, error) ]
- 批量更新项目状态 [ StatusUpdate(ctx context.Context, clt *core.SDKClient, accessToken string, req *project.StatusUpdateRequest) (*project.UpdateResult, error) ]
- 获取可投商品列表 [ product.Get(ctx context.Context, clt *core.SDKClient, accessToken string, req *product.GetRequest) (*product.GetResult, error) ]
- 获取本地推创编可用抖音号 [ aweme.AuthorizedGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *aweme.AuthorizedGetRequest) (*aweme.AuthorizedGetResult, error) ]
- 查询本地推创编可用人群包 [ customaudience.Get(ctx context.Context, clt *core.SDKClient, accessToken string, req *customaudience.GetRequest) (*customaudience.GetResult, error) ]
- 根据多门店ID拉取门店ID [ poi.MultiPoiIDsGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *poi.MultiPoiIDsGetRequest) (*poi.MultiPoiIDsGetResult, error) ]
- 广告管理模块 (local/promotion)
- 创建广告 [ Create(ctx context.Context, clt *core.SDKClient, accessToken string, req *promotion.CreateRequest) (uint64, error) ]
- 更新广告 [ Update(ctx context.Context, clt *core.SDKClient, accessToken string, req *promotion.UpdateRequest) error ]
- 获取广告列表 [ List(ctx context.Context, clt *core.SDKClient, accessToken string, req *promotion.ListRequest) (*promotion.ListResult, error) ]
- 获取广告详情 [ Detail(ctx context.Context, clt *core.SDKClient, accessToken string, req *promotion.DetailRequest) (*promotion.PromotionDetail, error) ]
- 批量更新广告状态 [ StatusUpdate(ctx context.Context, clt *core.SDKClient, accessToken string, req *promotion.StatusUpdateRequest) (*promotion.UpdateResult, error) ]
- 根据门店ID查询门店下商品ID [ product.GetByPoiIDs(ctx context.Context, clt *core.SDKClient, accessToken string, req *product.GetByPoiIDsRequest) ([]uint64, error) ]
- 本地推数据报表 (local/report)
- 获取项目数据 [ ProjectGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *report.ProjectGetRequest) (*report.ProjectGetResult, error) ]
- 获取广告数据 [ PromotionGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *report.PromotionGetRequest) (*report.PromotionGetResult, error) ]
- 获取素材数据 [ MaterialGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *report.MaterialGetRequest) (*report.MaterialGetResult, error) ]
- 本地推素材管理 (local/file)
- 异步上传本地推视频 [ UploadTaskCreate(ctx context.Context, clt *core.SDKClient, accessToken string, req *file.UploadTaskCreateRequest) (uint64, error) ]
- 查询异步上传本地推视频结果 [ VideoUploadTaskList(ctx context.Context, clt *core.SDKClient, accessToken string, req *file.VideoUploadTaskListRequest) ([]file.UploadTask, error) ]
- 上传视频 [ VideoUpload(ctx context.Context, clt *core.SDKClient, accessToken string, req *file.VideoUploadRequest) (*file.Video, error) ]
- 获取素材库视频 [ VideoGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *file.VideoGetRequest) (*file.VideoGetResult, error) ]
- 获取抖音主页视频 [ VideoAwemeGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *file.VideoAwemeGetRequest) (*file.VideoAwemeGetResult, error) ]
17 changes: 17 additions & 0 deletions marketing-api/api/local/aweme/authorized_get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package aweme

import (
"context"

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

// AuthorizedGet 获取本地推创编可用抖音号
func AuthorizedGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *aweme.AuthorizedGetRequest) (*aweme.AuthorizedGetResult, error) {
var resp aweme.AuthorizedGetResponse
if err := clt.GetAPI(ctx, "v3.0/local/aweme/authorized/get/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data, nil
}
2 changes: 2 additions & 0 deletions marketing-api/api/local/aweme/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package aweme 抖音号相关
package aweme
2 changes: 2 additions & 0 deletions marketing-api/api/local/customaudience/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package customaudience 人群包相关
package customaudience
17 changes: 17 additions & 0 deletions marketing-api/api/local/customaudience/get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package customaudience

import (
"context"

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

// Get 查询本地推创编可用人群包
func Get(ctx context.Context, clt *core.SDKClient, accessToken string, req *customaudience.GetRequest) (*customaudience.GetResult, error) {
var resp customaudience.GetResponse
if err := clt.GetAPI(ctx, "v3.0/local/custom_audience/get/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data, nil
}
2 changes: 2 additions & 0 deletions marketing-api/api/local/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package local 本地推相关
package local
2 changes: 2 additions & 0 deletions marketing-api/api/local/file/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package file 本地推素材管理相关
package file
19 changes: 19 additions & 0 deletions marketing-api/api/local/file/upload_task_create.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package file

import (
"context"

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

// UploadTaskCreate 异步上传本地推视频
// 将视频文件通过连山云素材服务上传后获取到视频文件链接,再将获取到的连山云视频文件url作为入参的video_url通过素材库提供的视频上传接口进行文件上传
// 仅支持开发者购置连山云素材服务上传生成的tos链接上传,不支持其他三方链接地址
func UploadTaskCreate(ctx context.Context, clt *core.SDKClient, accessToken string, req *file.UploadTaskCreateRequest) (uint64, error) {
var resp file.UploadTaskCreateResponse
if err := clt.PostAPI(ctx, "v3.0/local/file/upload_task/create/", req, &resp, accessToken); err != nil {
return 0, err
}
return resp.Data.TaskID, nil
}
17 changes: 17 additions & 0 deletions marketing-api/api/local/file/video_aweme_get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package file

import (
"context"

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

// VideoAwemeGet 获取素材库视频
func VideoAwemeGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *file.VideoAwemeGetRequest) (*file.VideoAwemeGetResult, error) {
var resp file.VideoAwemeGetResponse
if err := clt.GetAPI(ctx, "v3.0/local/file/video/aweme/get/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data, nil
}
17 changes: 17 additions & 0 deletions marketing-api/api/local/file/video_get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package file

import (
"context"

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

// VideoGet 获取素材库视频
func VideoGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *file.VideoGetRequest) (*file.VideoGetResult, error) {
var resp file.VideoGetResponse
if err := clt.GetAPI(ctx, "v3.0/local/file/video/get/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data, nil
}
17 changes: 17 additions & 0 deletions marketing-api/api/local/file/video_upload.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package file

import (
"context"

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

// VideoUpload 上传视频
func VideoUpload(ctx context.Context, clt *core.SDKClient, accessToken string, req *file.VideoUploadRequest) (*file.Video, error) {
var resp file.VideoUploadResponse
if err := clt.Upload(ctx, "v3.0/local/file/video/upload/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data, nil
}
17 changes: 17 additions & 0 deletions marketing-api/api/local/file/video_upload_task_list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package file

import (
"context"

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

// VideoUploadTaskList 查询异步上传本地推视频结果
func VideoUploadTaskList(ctx context.Context, clt *core.SDKClient, accessToken string, req *file.VideoUploadTaskListRequest) ([]file.UploadTask, error) {
var resp file.VideoUploadTaskListResponse
if err := clt.GetAPI(ctx, "v3.0/local/file/video/upload_task/list/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data.List, nil
}
2 changes: 2 additions & 0 deletions marketing-api/api/local/poi/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package poi 门店相关
package poi
17 changes: 17 additions & 0 deletions marketing-api/api/local/poi/multi_poi_ids_get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package poi

import (
"context"

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

// MultiPoiIDsGet 根据多门店ID拉取门店ID
func MultiPoiIDsGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *poi.MultiPoiIDsGetRequest) (*poi.MultiPoiIDsGetResult, error) {
var resp poi.MultiPoiIDsGetResponse
if err := clt.GetAPI(ctx, "v3.0/local/multi_poi_id/poi_ids/get/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data, nil
}
2 changes: 2 additions & 0 deletions marketing-api/api/local/product/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package product 产品相关
package product
17 changes: 17 additions & 0 deletions marketing-api/api/local/product/get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package product

import (
"context"

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

// Get 获取可投商品列表
func Get(ctx context.Context, clt *core.SDKClient, accessToken string, req *product.GetRequest) (*product.GetResult, error) {
var resp product.GetResponse
if err := clt.GetAPI(ctx, "v3.0/local/product/get/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data, nil
}
20 changes: 20 additions & 0 deletions marketing-api/api/local/product/get_by_poiids.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package product

import (
"context"

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

// GetByPoiIDs 根据门店ID查询门店下商品ID
// 该接口使用场景说明:
// 通过【获取抖音主页视频】接口拉取挂载了商品锚点的视频时,需要传入商品ids。如果为推门店场景,可以通过该接口获取所推广门店下的商品ID,进而拉取到挂载了门店下商品锚点的抖音主页视频进行投放。
// 仅创编推广目的=团购成交/门店引流/内容加热的计划时,可能涉及该接口的使用;推广目的=获取线索的计划不涉及。
func GetByPoiIDs(ctx context.Context, clt *core.SDKClient, accessToken string, req *product.GetByPoiIDsRequest) ([]uint64, error) {
var resp product.GetByPoiIDsResponse
if err := clt.GetAPI(ctx, "v3.0/local/product/get_by_poiids/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data.ProductIDs, nil
}
19 changes: 19 additions & 0 deletions marketing-api/api/local/project/create.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package project

import (
"context"

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

// Create 创建项目
// 创建 巨量引擎体验版 项目 广告主下可创建项目数:200
// 项目创建成功后,默认为启用状态
func Create(ctx context.Context, clt *core.SDKClient, accessToken string, req *project.CreateRequest) (uint64, error) {
var resp project.CreateResponse
if err := clt.PostAPI(ctx, "v3.0/local/project/create/", req, &resp, accessToken); err != nil {
return 0, err
}
return resp.Data.ProjectID, nil
}
18 changes: 18 additions & 0 deletions marketing-api/api/local/project/detail.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package project

import (
"context"

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

// Detail 获取项目详情
// 该接口暂不支持拉取推广目的为获取线索的项目
func Detail(ctx context.Context, clt *core.SDKClient, accessToken string, req *project.DetailRequest) (*project.ProjectDetail, error) {
var resp project.DetailResponse
if err := clt.GetAPI(ctx, "v3.0/local/project/detail/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data, nil
}
2 changes: 2 additions & 0 deletions marketing-api/api/local/project/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package project 项目管理模块
package project
18 changes: 18 additions & 0 deletions marketing-api/api/local/project/list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package project

import (
"context"

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

// List 获取项目列表
// 注意:该接口暂不支持拉取推广目的为获取线索的项目
func List(ctx context.Context, clt *core.SDKClient, accessToken string, req *project.ListRequest) (*project.ListResult, error) {
var resp project.ListResponse
if err := clt.GetAPI(ctx, "v3.0/local/project/list/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data, nil
}
17 changes: 17 additions & 0 deletions marketing-api/api/local/project/status_update.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package project

import (
"context"

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

// StatusUpdate 批量更新项目状态
func StatusUpdate(ctx context.Context, clt *core.SDKClient, accessToken string, req *project.StatusUpdateRequest) (*project.UpdateResult, error) {
var resp project.StatusUpdateResponse
if err := clt.PostAPI(ctx, "v3.0/local/project/status/update/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data, nil
}
16 changes: 16 additions & 0 deletions marketing-api/api/local/project/update.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package project

import (
"context"

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

// Update 更新项目
// 接口的更新逻辑为增量更新
// 定向参数如需设置对应受众为不限:string类型受众设置无限统一传入不限枚举,list类型的受众设置无限统一传入空数组,即[]
// 对于不打算更新的字段,不要传“”或者null,传了会校验
func Update(ctx context.Context, clt *core.SDKClient, accessToken string, req *project.UpdateRequest) error {
return clt.PostAPI(ctx, "v3.0/local/project/update/", req, nil, accessToken)
}
18 changes: 18 additions & 0 deletions marketing-api/api/local/promotion/create.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package promotion

import (
"context"

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

// Create 创建广告
// 广告创建成功后,默认为启用状态
func Create(ctx context.Context, clt *core.SDKClient, accessToken string, req *promotion.CreateRequest) (uint64, error) {
var resp promotion.CreateResponse
if err := clt.PostAPI(ctx, "v3.0/local/promotion/create/", req, &resp, accessToken); err != nil {
return 0, err
}
return resp.Data.PromotionID, nil
}
18 changes: 18 additions & 0 deletions marketing-api/api/local/promotion/detail.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package promotion

import (
"context"

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

// Detail 获取广告详情
// 暂不支持拉取推广目的为获取线索的广告
func Detail(ctx context.Context, clt *core.SDKClient, accessToken string, req *promotion.DetailRequest) (*promotion.PromotionDetail, error) {
var resp promotion.DetailResponse
if err := clt.GetAPI(ctx, "v3.0/local/promotion/detail/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data, nil
}
2 changes: 2 additions & 0 deletions marketing-api/api/local/promotion/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package promotion 广告管理模块
package promotion
18 changes: 18 additions & 0 deletions marketing-api/api/local/promotion/list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package promotion

import (
"context"

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

// List 获取广告列表
// 该接口暂不支持拉取 推广目的为获取线索的项目下的广告
func List(ctx context.Context, clt *core.SDKClient, accessToken string, req *promotion.ListRequest) (*promotion.ListResult, error) {
var resp promotion.ListResponse
if err := clt.GetAPI(ctx, "v3.0/local/promotion/list/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data, nil
}
Loading

0 comments on commit 876d50e

Please sign in to comment.