-
Notifications
You must be signed in to change notification settings - Fork 43
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
105 changed files
with
3,305 additions
and
3 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 |
---|---|---|
@@ -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) ] |
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,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 | ||
} |
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,2 @@ | ||
// Package aweme 抖音号相关 | ||
package aweme |
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,2 @@ | ||
// Package customaudience 人群包相关 | ||
package customaudience |
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,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 | ||
} |
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,2 @@ | ||
// Package local 本地推相关 | ||
package local |
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,2 @@ | ||
// Package file 本地推素材管理相关 | ||
package file |
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,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 | ||
} |
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,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 | ||
} |
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,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 | ||
} |
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,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 | ||
} |
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,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 | ||
} |
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,2 @@ | ||
// Package poi 门店相关 | ||
package poi |
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,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 | ||
} |
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,2 @@ | ||
// Package product 产品相关 | ||
package product |
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,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 | ||
} |
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,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 | ||
} |
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,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 | ||
} |
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,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 | ||
} |
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,2 @@ | ||
// Package project 项目管理模块 | ||
package project |
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,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 | ||
} |
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,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 | ||
} |
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 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) | ||
} |
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,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 | ||
} |
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,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 | ||
} |
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,2 @@ | ||
// Package promotion 广告管理模块 | ||
package promotion |
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,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 | ||
} |
Oops, something went wrong.