From 223ef729e782945e8bb2cd5f6898193c92e5279d Mon Sep 17 00:00:00 2001 From: Syd Xu Date: Fri, 23 Aug 2024 12:27:32 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(dpa):=20=E5=AE=8C=E5=96=84dpa=E7=9B=B8?= =?UTF-8?q?=E5=85=B3API,=20fix=20issue=20#71?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- marketing-api/OCEANENGINE.md | 32 ++++---- .../api/advertiser/account_fund_get.go | 2 +- .../api/advertiser/delivery_pkg_get.go | 2 +- marketing-api/api/agent/create_transfer.go | 2 +- .../api/agent/query_can_tranfser_balance.go | 2 +- .../businessplatform/company_account_get.go | 2 +- .../api/businessplatform/company_info_get.go | 2 +- .../partner_organization_list.go | 2 +- marketing-api/api/dpa/assets_list_v2.go | 15 ++++ marketing-api/api/dpa/clue_product_detail.go | 15 ++++ marketing-api/api/dpa/clue_product_list.go | 15 ++++ marketing-api/api/dpa/playlet_auth_get.go | 15 ++++ marketing-api/api/duoplus/order_list.go | 2 +- marketing-api/api/duoplus/order_report.go | 2 +- .../api/eventmanager/share_cancel.go | 2 +- marketing-api/api/eventmanager/share_get.go | 2 +- .../api/eventmanager/v3/deep_bid_type_get.go | 2 +- .../api/eventmanager/v3/optimized_goal_get.go | 2 +- marketing-api/api/file/v3/image_delete.go | 4 +- marketing-api/api/file/v3/quality_get.go | 2 +- marketing-api/api/file/v3/quality_submit.go | 2 +- marketing-api/api/keyword/v3/create.go | 2 +- marketing-api/api/keyword/v3/delete.go | 2 +- marketing-api/api/keyword/v3/list.go | 2 +- marketing-api/api/keyword/v3/suggest.go | 2 +- marketing-api/api/keyword/v3/update.go | 2 +- marketing-api/api/privativeword/v3/get.go | 2 +- .../api/privativeword/v3/project_add.go | 2 +- .../api/privativeword/v3/project_update.go | 2 +- .../api/report/v3/custom_config.get.go | 2 +- marketing-api/api/report/v3/custom_get.go | 2 +- .../api/tools/adpreview/v3/qrcode_get.go | 2 +- marketing-api/api/tools/asset_link_list.go | 2 +- .../tools/diagnosis/v3/suggestion_accept.go | 2 +- .../api/tools/diagnosis/v3/suggestion_get.go | 2 +- marketing-api/api/v3/cdp_brand_get.go | 2 +- .../api/v3/project/budget_group_create.go | 2 +- .../api/v3/project/budget_group_delete.go | 2 +- .../api/v3/project/budget_group_list.go | 2 +- .../api/v3/project/budget_group_update.go | 2 +- marketing-api/api/v3/project/budget_update.go | 2 +- .../api/v3/project/cost_protect_status_get.go | 2 +- marketing-api/api/v3/project/create.go | 2 +- marketing-api/api/v3/project/delete.go | 2 +- marketing-api/api/v3/project/list.go | 2 +- .../api/v3/project/roigoal_update.go | 2 +- .../api/v3/project/schedule_time_update.go | 2 +- marketing-api/api/v3/project/status_update.go | 2 +- marketing-api/api/v3/project/update.go | 2 +- .../api/v3/project/week_schedule_update.go | 2 +- marketing-api/api/v3/promotion/bid_update.go | 2 +- .../api/v3/promotion/budget_update.go | 2 +- .../v3/promotion/cost_protect_status_get.go | 2 +- marketing-api/api/v3/promotion/create.go | 2 +- .../api/v3/promotion/deepbid_update.go | 2 +- marketing-api/api/v3/promotion/delete.go | 2 +- marketing-api/api/v3/promotion/list.go | 2 +- .../v3/promotion/material_status_update.go | 2 +- .../api/v3/promotion/reject_reason.go | 2 +- .../api/v3/promotion/schedule_time_update.go | 2 +- .../api/v3/promotion/status_update.go | 2 +- marketing-api/api/v3/promotion/update.go | 2 +- marketing-api/enum/product_audit_status.go | 13 ++++ .../enum/product_completion_status.go | 15 ++++ marketing-api/enum/product_status.go | 42 ++++++++++ marketing-api/model/dpa/asset.go | 10 ++- marketing-api/model/dpa/assets_list_v2.go | 65 ++++++++++++++++ marketing-api/model/dpa/category.go | 8 +- .../model/dpa/clue_product_detail.go | 35 +++++++++ marketing-api/model/dpa/clue_product_list.go | 78 +++++++++++++++++++ marketing-api/model/dpa/playlet_auth_get.go | 52 +++++++++++++ marketing-api/model/dpa/product.go | 58 ++++++++++++-- marketing-api/model/dpa/product_for_update.go | 8 +- 73 files changed, 504 insertions(+), 88 deletions(-) create mode 100644 marketing-api/api/dpa/assets_list_v2.go create mode 100644 marketing-api/api/dpa/clue_product_detail.go create mode 100644 marketing-api/api/dpa/clue_product_list.go create mode 100644 marketing-api/api/dpa/playlet_auth_get.go create mode 100644 marketing-api/enum/product_audit_status.go create mode 100644 marketing-api/enum/product_completion_status.go create mode 100644 marketing-api/enum/product_status.go create mode 100644 marketing-api/model/dpa/assets_list_v2.go create mode 100644 marketing-api/model/dpa/clue_product_detail.go create mode 100644 marketing-api/model/dpa/clue_product_list.go create mode 100644 marketing-api/model/dpa/playlet_auth_get.go diff --git a/marketing-api/OCEANENGINE.md b/marketing-api/OCEANENGINE.md index f001c9e3..e927c999 100644 --- a/marketing-api/OCEANENGINE.md +++ b/marketing-api/OCEANENGINE.md @@ -14,7 +14,7 @@ - 获取广告主账户头像ID [ AvatarUpload(clt *core.SDKClient, accessToken string, req *advertiser.AvatarUploadRequest) (string, error) ] - 更新广告主账户头像 [ AvatarSubmit(clt *core.SDKClient, accessToken string, req *advertiser.AvatarSubmitRequest) error ] - 获取广告主头像信息 [ AvatarGet(clt *core.SDK, accessToken string, advertiserID uint64) (*advertiser.AvatarGetResponseData, error) ] - - 获取投放资质信息(新版)[ QualificationSelect(clt *core.SDKClient, accessToken string, advertiserID uint64) ([]advertiser.Qualification, error) ] + - 获取投放资质信息(新版)[ QualificationSelect(clt \*core.SDKClient, accessToken string, advertiserID uint64) ([]advertiser.Qualification, error) ] - 批量上传投放资质 [ QualificationCreate(clt *core.SDKClient, accessToken string, req *advertiser.QualificationCreateRequest) error ] - 获取广告主资质(新版)[ QualificationGet(clt *core.SDKClient, accessToken string, advertiserID uint64) (*advertiser.Qualification, error) ] - 提交广告主资质(新版)[ QualificationSubmit(clt *core.SDKClient, accessToken string, req *advertiser.QualificationSubmitRequest) error ] @@ -33,7 +33,7 @@ - 纵横组织账户管理 - 获取纵横组织下资产账户列表 [ majordomo.AdvertiserSelect(clt *core.SDKClient, accessToken string, req *majordomo.AdvertiserSelectRequest) ([]majordomo.Advertiser, error) ] - [获取纵横组织下资产账户列表(分页)[ customercenter.AdvertiserList(clt *core.SDKClient, accessToken string, req *customercenter.AdvertiserListRequest) (*customercenter.AdvertiserListData, error) ] - - 查询合作组织 [ businessplatform.PartnerOrganizationList(clt *core.SDKClient, accessToken string, req *businessplatform.PartnerOrganizationListRequest) (*businessplatform.PartnerOrganizationListData, error) ] + - 查询合作组织 [ businessplatform.PartnerOrganizationList(clt *core.SDKClient, accessToken string, req *businessplatform.PartnerOrganizationListRequest) (*businessplatform.PartnerOrganizationListData, error) ] - 获取纵横组织下所有主体信息 [ businessplatform.CompanyInfoGet(clt *core.SDKClient, accessToken string, req *businessplatform.CompanyInfoGetRequest) (*businessplatform.CompanyInfoGetData, error) ] - 获取主体下的账户列表 [ businessplatform.CompanyAccountGet(clt *core.SDKClient, accessToken string, req *businessplatform.CompanyAccountGetRequest) (*businessplatform.CompanyAccountGetData, error) ] - 资金和流水管理 (api) @@ -44,7 +44,7 @@ - 查询账号流水明细 [ advertiser.FundTransactionGet(clt *core.SDKClient, accessToken string, req *advertiser.FundTransactionGetRequest) ([]advertiser.FundTransactionGetResponseList, error) ] - 代理商转账 [ agent.AdvertiserRecharge(clt *core.SDKClient, accessToken string, req *agent.AdvertiserRechargeRequest) (string, error) ] - 代理商退款 [ agent.AdvertiserRefund(clt *core.SDKClient, accessToken string, req *agent.AdvertiserRefundRequest) (string, error) ] - - 获取共享钱包余额 [ fund.SharedWalletFundGet(clt *core.SDKClient, accessToken string, advertiserIDs []uint64) ([]fund.SharedWalletBalance, error) ] + - 获取共享钱包余额 [ fund.SharedWalletFundGet(clt \*core.SDKClient, accessToken string, advertiserIDs []uint64) ([]fund.SharedWalletBalance, error) ] - 查询账户可转余额 [ advertiser.TransferableFundGet(clt *core.SDKClient, accessToken string, advertiserID uint64) (*advertiser.TransferableFund, error) ] - 获取可转账户列表(客户中心&广告主) [ customercenter.AdvertiserTransferableList(clt *core.SDKClient, accessToken string, req *customercenter.AdvertiserTransferableListRequest) (*customercenter.AdvertiserTransferableListData, error) ] - 创建转账交易号 [ customercenter.FundTransferSeqCreate(clt *core.SDKClient, accessToken string, req *customercenter.FundTransferSeqCreateRequest) (uint64, error) ] @@ -153,9 +153,9 @@ - 获取异步任务列表 [ Get(clt *core.SDKClient, accessToken string, req *asynctask.GetRequest) (*asynctask.GetResponseData, error) ] - 下载任务结果 [ Download(clt *core.SDKClient, accessToken string, req *asynctask.DownloadRequest) ([]byte, error) ] - 体验版(api/report/asynctask/v3) - - 自定义报表—创建异步任务 [ Create(clt *core.SDKClient, accessToken string, req *v3.CreateRequest) (*asynctask.Task, error) ] - - 获取任务列表 [ Get(clt *core.SDKClient, accessToken string, req *v3.GetRequest) (*asynctask.GetResponseData, error) ] - - 自定义报表—获取下载结果 [ Download(clt *core.SDKClient, accessToken string, req *v3.DownloadRequest) ([]byte, error) ] + - 自定义报表—创建异步任务 [ Create(clt *core.SDKClient, accessToken string, req *v3.CreateRequest) (*asynctask.Task, error) ] + - 获取任务列表 [ Get(clt *core.SDKClient, accessToken string, req *v3.GetRequest) (*asynctask.GetResponseData, error) ] + - 自定义报表—获取下载结果 [ Download(clt *core.SDKClient, accessToken string, req *v3.DownloadRequest) ([]byte, error) ] - 广告体验版数据报表 (api/report/v3) - 项目数据报表 [ ProjectGet(clt *core.SDKClient, accessToken string, req *v3.ProjectGetRequest) (*v3.ProjectGetResult, error) ] - 广告数据报表 [ PromotionGet(clt *core.SDKClient, accessToken string, req *v3.PromotionGetRequest) (*v3.PromotionGetResult, error) ] @@ -173,7 +173,7 @@ - 推送人群包 [ customaudience.Push(clt *core.SDKClient, accessToken string, req *customaudience.PushRequest) error ] - 删除人群包 [ customaudience.Delete(clt *core.SDKClient, accessToken string, req *customaudience.DeleteRequest) error ] - 云图相关接口 - - 获取广告账户关联云图账户信息 [ BrandGet(clt *core.SDKClient, accessToken string, advertiserID uint64) ([]dmp.BrandInfo, error) ] + - 获取广告账户关联云图账户信息 [ BrandGet(clt \*core.SDKClient, accessToken string, advertiserID uint64) ([]dmp.BrandInfo, error) ] - 推送dmp人群包到云图账户 [ Copy(clt *core.SDKClient, accessToken string, req *customaudience.CopyRequest) error ] - 搜索广告 - 广告组 [ campaign.Create(clt *core.SDKClient, accessToken string, req *campaign.CreateRequest) (uint64, error) ] @@ -202,8 +202,11 @@ - 获取商品库元信息 [ MetaGet(clt *core.SDKClient, accessToken string, req *dpa.MetaGetRequest) ([]dpa.Meta, error) ] - 获取商品列表 [ DetailGet(clt *core.SDKClient, accessToken string, req *dpa.DetailGetRequest) (*dpa.DetailGetResponseData, error) ] - 获取商品详情 [ ProductDetailGet(clt *core.SDKClient, accessToken string, req *dpa.ProductDetailGetRequest) (*dpa.DetailGetResponseData, error) ] + - 获取升级版商品列表 [ ClueProductList(clt *core.SDKClient, accessToken string, req *dpa.ClueProductListRequest) (*dpa.ClueProductListResult, error) ] + - 获取升级版商品详情 [ ClueProductDetail(clt *core.SDKClient, accessToken string, req *dpa.ClueProductDetailRequest) ([]dpa.Product, error) ] - 获取投放条件列表 [ AssetsList(clt *core.SDKClient, accessToken string, req *dpa.AssetsListRequest) (*dpa.AssetsListResponseData, error) ] - 获取投放条件详情 [ AssetsDetailRead(clt *core.SDKClient, accessToken string, req *dpa.AssetsDetailReadRequest) ([]dpa.Asset, error) ] + - 获取商品投放条件列表(线索版) [ AssetsListV2(clt *core.SDKClient, accessToken string, req *dpa.AssetsListV2Request) (*dpa.AssetsListV2Result, error) ] - 获取DPA分类 [ CategoryGet(clt *core.SDKClient, accessToken string, req *dpa.CategoryGetRequest) ([]dpa.Category, error) ] - 获取DPA词包 [ DictGet(clt *core.SDKClient, accessToken string, req *dpa.DictGetRequest) ([]dpa.Dict, error) ] - 获取DPA可用行为 [ BehaviourAvailables(clt *core.SDKClient, accessToken string, req *dpa.BehaviourAvailablesRequest) ([]dpa.Behaviour, error) ] @@ -213,6 +216,7 @@ - 创建DPA商品(无商品id) [ ProductCreate(clt *core.SDKClient, accessToken string, req *dpa.ProductCreateRequest) (uint64, 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 ] + - 查询短剧商品原片授权申请状态 [ 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) ] - 上传广告图片 [ ImageAd(clt *core.SDKClient, accessToken string, req *file.ImageAdRequest) (*file.Image, error) ] @@ -229,7 +233,7 @@ - 获取素材标签列表 [ MaterialList(clt *core.SDKClient, accessToken string, req *file.MaterialListRequest) (*file.MaterialListData, error) ] - 查询素材标签信息 [ MaterialDetail(clt *core.SDKClient, accessToken string, req *file.MaterialDetailRequest) ([]file.Material, error) ] - 获取视频素材评估标签(新版) [ MaterialAttributesList(clt *core.SDKClient, accessToken string, req *file.MaterialAttributesListRequest) (*file.MaterialAttributesListResult, error) ] - - 获取低效素材 [ VideoEffeciencyGet(clt *core.SDKClient, accessToken string, req *file.VideoEffeciencyGetRequest) ([]string, error) ] + - 获取低效素材 [ VideoEffeciencyGet(clt *core.SDKClient, accessToken string, req *file.VideoEffeciencyGetRequest) ([]string, error) ] - 批量删除图片素材 [ v3.ImageDelete(clt *core.SDKClient, accessToken string, req *v3.ImageDeleteRequest) ([]string, error) ] - 获取低效素材List [ RebateMaterialSearch(clt *core.SDKClient, accessToken string, req *file.RebateMaterialSearchRequest) (*file.RebateMaterialSearchResult, error) ] - 创建素材清理任务 [ VideoMaterialClearTaskCreate(clt *core.SDKClient, accessToken string, req *file.VideoMaterialClearTaskCreateRequest) (uint64, error) ] @@ -255,7 +259,7 @@ - 获取橙子建站站点预览地址 [ Preview(clt *core.SDKClient, accessToken string, req *site.PreviewRequest) (string, error) ] - 获取橙子建站站点详细信息 [ Read(clt *core.SDKClient, accessToken string, req *site.ReadRequest) (*site.SiteDetail, error) ] - 获取橙子建站站点列表 [ Get(clt *core.SDKClient, accessToken string, req *site.GetRequest) (*site.GetResponseData, error) ] - - 建站工具——查询已有智能电话 [ tools/clue.SmartPhoneGet(clt *core.SDKClient, accessToken string, req *clue.SmartPhoneGetRequest) (*clue.SmartPhoneGetResponseData, error) ] + - 建站工具——查询已有智能电话 [ tools/clue.SmartPhoneGet(clt *core.SDKClient, accessToken string, req *clue.SmartPhoneGetRequest) (*clue.SmartPhoneGetResponseData, error) ] - 建站工具——查询已有表单列表 [ tools/clue.FormGet(clt *core.SDKClient, accessToken string, req *clue.FormGetRequest) (*clue.FormGetResponseData, error) ] - 建站工具——查询表单详情 [ tools/clue.FormDetail(clt *core.SDKClient, accessToken string, req *clue.FormDetailRequest) (*clue.FormDetail, error) ] - 获取落地页预约表单信息 [ FormsList(clt *core.SDKClient, accessToken string, req *site.FormsListRequest) ([]site.Form, error) ] @@ -327,11 +331,11 @@ - 事件资产下创建监测链接组 [ TrackURLCreate(clt *core.SDKClient, accessToken string, req *eventmanager.TrackURLCreateRequest) error ] - 事件资产下更新监测链接组 [ TrackURLUpdate(clt *core.SDKClient, accessToken string, req *eventmanager.TrackURLUpdateRequest) error ] - 获取事件资产下的监测链接组 [ TrackURLGet(clt *core.SDKClient, accessToken string, req *eventmanager.TrackURLGetRequest) (*eventmanager.TrackURLGetData, error) ] - - 事件管理资产查看共享范围 [ ShareGet(clt *core.SDKClient, accessToken string, req *eventmanager.ShareGetRequest) (*eventmanager.ShareGetData, error) ] + - 事件管理资产查看共享范围 [ ShareGet(clt *core.SDKClient, accessToken string, req *eventmanager.ShareGetRequest) (*eventmanager.ShareGetData, error) ] - 事件管理资产共享 [ Share(clt *core.SDKClient, accessToken string, req *eventmanager.ShareRequest) ([]eventmanager.ShareError, error) ] - 事件管理资产取消共享 [ ShareCancel(clt *core.SDKClient, accessToken string, req *eventmanager.ShareRequest) ([]eventmanager.ShareError, error) ] - 获取可用优化目标(体验版)[ v3.OptimizedGoalGet(clt *core.SDKClient, accessToken string, req *v3.OptimizedGoalGetRequest) (*v3.OptimizedGoalGetResponseData, error) ] - - 获取可用深度优化方式体验版 [ v3.DeepBidTypeGet(clt *core.SDKClient, accessToken string, req *v3.DeepBidTypeGetRequest) ([]enum.DeepBidType, error) ] + - 获取可用深度优化方式体验版 [ v3.DeepBidTypeGet(clt *core.SDKClient, accessToken string, req *v3.DeepBidTypeGetRequest) ([]enum.DeepBidType, error) ] - 转化回传鉴权管理 (api/eventmanager/auth) - 新增公钥 [ AddPublicKey(clt *core.SDKClient, accessToken string, req *auth.AddPublicKeyRequest) (*auth.PublicKey, error) ] - 删除公钥 [ DelPublicKey(clt *core.SDKClient, accessToken string, req *auth.DelPublicKeyRequest) error ] @@ -382,7 +386,7 @@ - 设置应用共享 [ BpShare(clt *core.SDKClient, accessToken string, req *appmanagement.BpShareRequest) (*appmanagement.BpShareData, error) ] - 取消应用共享关系 [ BpShareCancel(clt *core.SDKClient, accessToken string, req *appmanagement.BpShareRequest) (*appmanagement.BpShareData, error) ] - 更新应用共享关系 [ UpdateAuthorization(clt *core.SDKClient, accessToken string, req *appmanagement.UpdateAuthorizationRequest) error ] - - 获取账户下原生锚点 [ tools.NativeAnchorGet(clt *core.SDKClient, accessToken string, req *tools.NativeAnchorGetRequest) (*tools.NativeAnchorGetResponseData, error) ] + - 获取账户下原生锚点 [ tools.NativeAnchorGet(clt *core.SDKClient, accessToken string, req *tools.NativeAnchorGetRequest) (*tools.NativeAnchorGetResponseData, error) ] - 抖音达人 (tools/aweme) - 查询抖音帐号和类目信息 [ AwemeInfoSearch(clt *core.SDKClient, accessToken string, req *aweme.AwemeInfoSearchRequest) (*aweme.AwemeInfoSearchResult, error) ] - 查询抖音类似帐号 [ AwemeSimilarAuthorSearch(clt *core.SDKClient, accessToken string, req *aweme.AwemeSimilarAuthorSearchRequest) ([]aweme.Author, error) ] @@ -440,7 +444,7 @@ - 获取一键起量报告 [ Report(clt *core.SDKClient, accessToken string, req *adraise.ReportRequest) (*adraise.ReportResponseData, error) ] - 获取起量版本信息 [ Version(clt *core.SDKClient, accessToken string, req *adraise.VersionRequest) (*adraise.VersionResponseData, error) ] - 获取广告建议起量预算 [ SuggestBudgetGet(clt *core.SDKClient, accessToken string, req *adraise.SuggestBudgetGetRequest) ([]adraise.SuggestBudget, error) ] - - 一键起量(巨量广告升级版) + - 一键起量(巨量广告升级版) - 获取广告建议起量预算 [ SuggestBudgetGet(clt *core.SDKClient, accessToken string, req *v3.SuggestBudgetGetRequest) ([]v3.SuggestBudget, error) ] - 开启/更新一键起量 [ Set(clt *core.SDKClient, accessToken string, req *v3.SetRequest) error ] - 获取一键起量方案列表 [ StatusGet(clt *core.SDKClient, accessToken string, req *v3.StatusGetRequest) ([]v3.PromotionRaiseStatus, error) ] @@ -474,7 +478,7 @@ - 发布安卓应用母包 [ AndroidBasicPackagePublish(clt *core.SDKClient, accessToken string, req *appmanagement.AndroidBasicPackagePublishRequest) error ] - RTA策略管理 (tools/rta) - 获取RTA策略数据 [ GetInfo(clt *core.SDKClient, accessToken string, req *rta.GetInfoRequest) (*rta.GetInfoData, error) ] - - 获取可用的RTA策略 [ Get(clt *core.SDKClient, accessToken string, req *rta.GetRequest) ([]rta.RtaInfo, error) ] + - 获取可用的RTA策略 [ Get(clt *core.SDKClient, accessToken string, req *rta.GetRequest) ([]rta.RtaInfo, error) ] - 批量启停账户下RTA策略 [ StatusUpdate(clt *core.SDKClient, accessToken string, req *rta.StatusUpdateRequest) error ] - 设置账户下RTA策略生效范围 [ SetScope(clt *core.SDKClient, accessToken string, req *rta.SetScopeRequest) error ] - 获取穿山甲渠道RTA联合实验数据 [ RtaExpGet(clt *core.SDKClient, accessToken string, req *rta.RtaExpGetRequest) ([]rta.Report, error) ] diff --git a/marketing-api/api/advertiser/account_fund_get.go b/marketing-api/api/advertiser/account_fund_get.go index b2cd2a33..3f34355c 100644 --- a/marketing-api/api/advertiser/account_fund_get.go +++ b/marketing-api/api/advertiser/account_fund_get.go @@ -9,7 +9,7 @@ import ( // 批量查询账号余额,支持AD、星图、本地推账户 func AccountFundGet(clt *core.SDKClient, accessToken string, req *advertiser.AccountFundGetRequest) ([]advertiser.AccountFund, error) { var resp advertiser.AccountFundGetResponse - if err := clt.Get("v3.0/account/fund/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/account/fund/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.List, nil diff --git a/marketing-api/api/advertiser/delivery_pkg_get.go b/marketing-api/api/advertiser/delivery_pkg_get.go index d6d3ec7c..6fcb3867 100644 --- a/marketing-api/api/advertiser/delivery_pkg_get.go +++ b/marketing-api/api/advertiser/delivery_pkg_get.go @@ -9,7 +9,7 @@ import ( // 用于查询广告主以推广产品形式提交的投放资质,可以获取到资质审核状态等信息 func DeliveryPkgGet(clt *core.SDKClient, accessToken string, req *advertiser.DeliveryPkgGetRequest) (*advertiser.DeliveryPkg, error) { var resp advertiser.DeliveryPkgGetResponse - if err := clt.Get("v3.0/advertiser/delivery_pkg/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/advertiser/delivery_pkg/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.DeliveryPkg, nil diff --git a/marketing-api/api/agent/create_transfer.go b/marketing-api/api/agent/create_transfer.go index 9c6e8024..257553be 100644 --- a/marketing-api/api/agent/create_transfer.go +++ b/marketing-api/api/agent/create_transfer.go @@ -9,7 +9,7 @@ import ( // 发起转账,支持1:N转账、不停投转账、虚客互转 func CreateTransfer(clt *core.SDKClient, accessToken string, req *agent.CreateTransferRequest) (string, error) { var resp agent.CreateTransferResponse - if err := clt.Post("v3.0/cg_transfer/create_transfer/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/cg_transfer/create_transfer/", req, &resp, accessToken); err != nil { return "", err } return resp.Data.TransferSerial, nil diff --git a/marketing-api/api/agent/query_can_tranfser_balance.go b/marketing-api/api/agent/query_can_tranfser_balance.go index d82101f1..8dfae97d 100644 --- a/marketing-api/api/agent/query_can_tranfser_balance.go +++ b/marketing-api/api/agent/query_can_tranfser_balance.go @@ -9,7 +9,7 @@ import ( // 查询减款方与加款方之间最大可转金额,接口内已自动扣除需要预留的竞价消耗保证金,支持查询1:N转账的最大可转金额 func QueryCanTransferBalance(clt *core.SDKClient, accessToken string, req *agent.QueryCanTransferBalanceRequest) ([]agent.CanTransferDetail, error) { var resp agent.QueryCanTransferBalanceResponse - if err := clt.Get("v3.0/cg_transfer/query_can_transfer_balance/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/cg_transfer/query_can_transfer_balance/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.CanTransferDetailList, nil diff --git a/marketing-api/api/businessplatform/company_account_get.go b/marketing-api/api/businessplatform/company_account_get.go index 405c8f28..c4ed157c 100644 --- a/marketing-api/api/businessplatform/company_account_get.go +++ b/marketing-api/api/businessplatform/company_account_get.go @@ -8,7 +8,7 @@ import ( // CompanyAccountGet 获取主体下的账户列表 func CompanyAccountGet(clt *core.SDKClient, accessToken string, req *businessplatform.CompanyAccountGetRequest) (*businessplatform.CompanyAccountGetData, error) { var resp businessplatform.CompanyAccountGetResponse - if err := clt.Get("v3.0/business_platform/company_account/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/business_platform/company_account/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/businessplatform/company_info_get.go b/marketing-api/api/businessplatform/company_info_get.go index 1cc19bdb..02728840 100644 --- a/marketing-api/api/businessplatform/company_info_get.go +++ b/marketing-api/api/businessplatform/company_info_get.go @@ -8,7 +8,7 @@ import ( // CompanyInfoGet 获取纵横组织下所有主体信息 func CompanyInfoGet(clt *core.SDKClient, accessToken string, req *businessplatform.CompanyInfoGetRequest) (*businessplatform.CompanyInfoGetData, error) { var resp businessplatform.CompanyInfoGetResponse - if err := clt.Get("v3.0/business_platform/company_info/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/business_platform/company_info/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/businessplatform/partner_organization_list.go b/marketing-api/api/businessplatform/partner_organization_list.go index b128f43a..944efe16 100644 --- a/marketing-api/api/businessplatform/partner_organization_list.go +++ b/marketing-api/api/businessplatform/partner_organization_list.go @@ -8,7 +8,7 @@ import ( // PartnerOrganizationList 查询合作组织 func PartnerOrganizationList(clt *core.SDKClient, accessToken string, req *businessplatform.PartnerOrganizationListRequest) (*businessplatform.PartnerOrganizationListData, error) { var resp businessplatform.PartnerOrganizationListResponse - if err := clt.Get("v3.0/business_platform/partner_organization/list/", req, &resp, accessToken); err != nil { + if err := clt.Get("2/business_platform/partner_organization/list/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/dpa/assets_list_v2.go b/marketing-api/api/dpa/assets_list_v2.go new file mode 100644 index 00000000..77e3db08 --- /dev/null +++ b/marketing-api/api/dpa/assets_list_v2.go @@ -0,0 +1,15 @@ +package dpa + +import ( + "github.com/bububa/oceanengine/marketing-api/core" + "github.com/bububa/oceanengine/marketing-api/model/dpa" +) + +// AssetsListV2 获取投放条件列表 +func AssetsListV2(clt *core.SDKClient, accessToken string, req *dpa.AssetsListV2Request) (*dpa.AssetsListV2Result, error) { + var resp dpa.AssetsListV2Response + if err := clt.GetAPI("2/dpa/assets_v2/list/", req, &resp, accessToken); err != nil { + return nil, err + } + return resp.Data, nil +} diff --git a/marketing-api/api/dpa/clue_product_detail.go b/marketing-api/api/dpa/clue_product_detail.go new file mode 100644 index 00000000..4ed4a8fe --- /dev/null +++ b/marketing-api/api/dpa/clue_product_detail.go @@ -0,0 +1,15 @@ +package dpa + +import ( + "github.com/bububa/oceanengine/marketing-api/core" + "github.com/bububa/oceanengine/marketing-api/model/dpa" +) + +// ClueProductDetail 获取升级版商品详情 +func ClueProductDetail(clt *core.SDKClient, accessToken string, req *dpa.ClueProductDetailRequest) ([]dpa.Product, error) { + var resp dpa.ClueProductDetailResponse + if err := clt.GetAPI("2/dpa/clue_product/detail/", req, &resp, accessToken); err != nil { + return nil, err + } + return resp.Data.Products, nil +} diff --git a/marketing-api/api/dpa/clue_product_list.go b/marketing-api/api/dpa/clue_product_list.go new file mode 100644 index 00000000..982ce254 --- /dev/null +++ b/marketing-api/api/dpa/clue_product_list.go @@ -0,0 +1,15 @@ +package dpa + +import ( + "github.com/bububa/oceanengine/marketing-api/core" + "github.com/bububa/oceanengine/marketing-api/model/dpa" +) + +// ClueProductList 获取升级版商品列表 +func ClueProductList(clt *core.SDKClient, accessToken string, req *dpa.ClueProductListRequest) (*dpa.ClueProductListResult, error) { + var resp dpa.ClueProductListResponse + if err := clt.GetAPI("2/dpa/clue_product/list/", req, &resp, accessToken); err != nil { + return nil, err + } + return resp.Data, nil +} diff --git a/marketing-api/api/dpa/playlet_auth_get.go b/marketing-api/api/dpa/playlet_auth_get.go new file mode 100644 index 00000000..92fd2166 --- /dev/null +++ b/marketing-api/api/dpa/playlet_auth_get.go @@ -0,0 +1,15 @@ +package dpa + +import ( + "github.com/bububa/oceanengine/marketing-api/core" + "github.com/bububa/oceanengine/marketing-api/model/dpa" +) + +// PlayletAuthGet 查询短剧商品原片授权申请状态 +func PlayletAuthGet(clt *core.SDKClient, accessToken string, req *dpa.PlayletAuthGetRequest) (*dpa.PlayletAuthGetResult, error) { + var resp dpa.PlayletAuthGetResponse + if err := clt.GetAPI("2/dpa/playlet/auth/get/", req, &resp, accessToken); err != nil { + return nil, err + } + return resp.Data, nil +} diff --git a/marketing-api/api/duoplus/order_list.go b/marketing-api/api/duoplus/order_list.go index 716971bd..e70cd1c8 100644 --- a/marketing-api/api/duoplus/order_list.go +++ b/marketing-api/api/duoplus/order_list.go @@ -9,7 +9,7 @@ import ( // 查询DOU+订单属性,支持过滤 func OrderList(clt *core.SDKClient, accessToken string, req *duoplus.OrderListRequest) (*duoplus.OrderListResult, error) { var resp duoplus.OrderListResponse - if err := clt.Get("v3.0/duoplus/order/list/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/duoplus/order/list/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/duoplus/order_report.go b/marketing-api/api/duoplus/order_report.go index b1e48937..39c02aec 100644 --- a/marketing-api/api/duoplus/order_report.go +++ b/marketing-api/api/duoplus/order_report.go @@ -9,7 +9,7 @@ import ( // 获取DOU+订单指标数据 func OrderReport(clt *core.SDKClient, accessToken string, req *duoplus.OrderReportRequest) (*duoplus.OrderReportResult, error) { var resp duoplus.OrderReportResponse - if err := clt.Get("v3.0/duoplus/order/report/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/duoplus/order/report/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/eventmanager/share_cancel.go b/marketing-api/api/eventmanager/share_cancel.go index 663de9a8..3b7b1691 100644 --- a/marketing-api/api/eventmanager/share_cancel.go +++ b/marketing-api/api/eventmanager/share_cancel.go @@ -8,7 +8,7 @@ import ( // ShareCancel 事件管理资产取消共享 func ShareCancel(clt *core.SDKClient, accessToken string, req *eventmanager.ShareRequest) ([]eventmanager.ShareError, error) { var resp eventmanager.ShareResponse - if err := clt.Post("v3.0/event_manager/share/cancel/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/event_manager/share/cancel/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.ErrorList, nil diff --git a/marketing-api/api/eventmanager/share_get.go b/marketing-api/api/eventmanager/share_get.go index a4e4bf7d..049a1ae3 100644 --- a/marketing-api/api/eventmanager/share_get.go +++ b/marketing-api/api/eventmanager/share_get.go @@ -8,7 +8,7 @@ import ( // ShareGet 事件管理资产查看共享范围 func ShareGet(clt *core.SDKClient, accessToken string, req *eventmanager.ShareGetRequest) (*eventmanager.ShareGetData, error) { var resp eventmanager.ShareGetResponse - err := clt.Get("v3.0/event_manager/share/get/", req, &resp, accessToken) + err := clt.GetAPI("v3.0/event_manager/share/get/", req, &resp, accessToken) if err != nil { return nil, err } diff --git a/marketing-api/api/eventmanager/v3/deep_bid_type_get.go b/marketing-api/api/eventmanager/v3/deep_bid_type_get.go index b3f315fc..b51827cc 100644 --- a/marketing-api/api/eventmanager/v3/deep_bid_type_get.go +++ b/marketing-api/api/eventmanager/v3/deep_bid_type_get.go @@ -9,7 +9,7 @@ import ( // DeepBidTypeGet 获取可用深度优化方式体验版 func DeepBidTypeGet(clt *core.SDKClient, accessToken string, req *v3.DeepBidTypeGetRequest) ([]enum.DeepBidType, error) { var resp v3.DeepBidTypeGetResponse - if err := clt.Get("v3.0/event_manager/deep_bid_type/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/event_manager/deep_bid_type/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.DeepBidType, nil diff --git a/marketing-api/api/eventmanager/v3/optimized_goal_get.go b/marketing-api/api/eventmanager/v3/optimized_goal_get.go index 283c71c9..7f79a14f 100644 --- a/marketing-api/api/eventmanager/v3/optimized_goal_get.go +++ b/marketing-api/api/eventmanager/v3/optimized_goal_get.go @@ -9,7 +9,7 @@ import ( // 查询事件管理下资产的优化目标 func OptimizedGoalGet(clt *core.SDKClient, accessToken string, req *v3.OptimizedGoalGetRequest) (*v3.OptimizedGoalGetResponseData, error) { var resp v3.OptimizedGoalGetResponse - if err := clt.Get("v3.0/event_manager/optimized_goal/get_v2/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/event_manager/optimized_goal/get_v2/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/file/v3/image_delete.go b/marketing-api/api/file/v3/image_delete.go index 5de6294d..3b7d5721 100644 --- a/marketing-api/api/file/v3/image_delete.go +++ b/marketing-api/api/file/v3/image_delete.go @@ -2,14 +2,14 @@ package v3 import ( "github.com/bububa/oceanengine/marketing-api/core" - "github.com/bububa/oceanengine/marketing-api/model/file/v3" + v3 "github.com/bububa/oceanengine/marketing-api/model/file/v3" ) // ImageDelete 批量删除图片素材 // 通过此接口,用户可以批量删除广告主下创意素材库的图片。 func ImageDelete(clt *core.SDKClient, accessToken string, req *v3.ImageDeleteRequest) ([]string, error) { var resp v3.ImageDeleteResponse - err := clt.Post("v3.0/file/image/delete/", req, &resp, accessToken) + err := clt.PostAPI("v3.0/file/image/delete/", req, &resp, accessToken) if err != nil { return nil, err } diff --git a/marketing-api/api/file/v3/quality_get.go b/marketing-api/api/file/v3/quality_get.go index fbe225d1..3504ba49 100644 --- a/marketing-api/api/file/v3/quality_get.go +++ b/marketing-api/api/file/v3/quality_get.go @@ -9,7 +9,7 @@ import ( // 素材属性结果查询 func QualityGet(clt *core.SDKClient, accessToken string, req *v3.QualityGetRequest) ([]v3.MaterialQuality, error) { var resp v3.QualityGetResponse - if err := clt.Get("v3.0/file/quality/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/file/quality/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.List, nil diff --git a/marketing-api/api/file/v3/quality_submit.go b/marketing-api/api/file/v3/quality_submit.go index 236e476d..2dc071ad 100644 --- a/marketing-api/api/file/v3/quality_submit.go +++ b/marketing-api/api/file/v3/quality_submit.go @@ -9,7 +9,7 @@ import ( // 素材属性提交分析 func QualitySubmit(clt *core.SDKClient, accessToken string, req *v3.QualitySubmitRequest) (uint64, error) { var resp v3.QualitySubmitResponse - if err := clt.Post("v3.0/file/quality/submit/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/file/quality/submit/", req, &resp, accessToken); err != nil { return 0, err } return resp.Data.MaterialID, nil diff --git a/marketing-api/api/keyword/v3/create.go b/marketing-api/api/keyword/v3/create.go index 73e26090..4887b3a3 100644 --- a/marketing-api/api/keyword/v3/create.go +++ b/marketing-api/api/keyword/v3/create.go @@ -12,7 +12,7 @@ import ( // 创建关键词时会自动将优词添加为关键词,请您知悉 func Create(clt *core.SDKClient, accessToken string, req *v3.CreateRequest) (*keyword.ResponseData, error) { var resp keyword.Response - if err := clt.Post("v3.0/keyword/create/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/keyword/create/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/keyword/v3/delete.go b/marketing-api/api/keyword/v3/delete.go index e8bc903f..01196004 100644 --- a/marketing-api/api/keyword/v3/delete.go +++ b/marketing-api/api/keyword/v3/delete.go @@ -10,7 +10,7 @@ import ( // 删除指定keyword_id的搜索词,可批量删除。 func Delete(clt *core.SDKClient, accessToken string, req *v3.DeleteRequest) (*keyword.DeleteResponseData, error) { var resp keyword.DeleteResponse - if err := clt.Post("v3.0/keyword/delete/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/keyword/delete/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/keyword/v3/list.go b/marketing-api/api/keyword/v3/list.go index f0a6cf67..58b76b17 100644 --- a/marketing-api/api/keyword/v3/list.go +++ b/marketing-api/api/keyword/v3/list.go @@ -11,7 +11,7 @@ import ( // 目前仅支持根据ad_id获取该计划下的关键词。 func List(clt *core.SDKClient, accessToken string, req *v3.ListRequest) ([]keyword.Keyword, error) { var resp keyword.GetResponse - if err := clt.Get("v3.0/keyword/list/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/keyword/list/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.List, nil diff --git a/marketing-api/api/keyword/v3/suggest.go b/marketing-api/api/keyword/v3/suggest.go index 7021292f..07dc7def 100644 --- a/marketing-api/api/keyword/v3/suggest.go +++ b/marketing-api/api/keyword/v3/suggest.go @@ -10,7 +10,7 @@ import ( // 快投2.0获取推荐关键词 func Suggest(clt *core.SDKClient, accessToken string, req *v3.SuggestRequest) ([]keyword.SuggestKeyword, error) { var resp keyword.SuggestResponse - if err := clt.Post("v3.0/sugg_words/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/sugg_words/", req, &resp, accessToken); err != nil { return nil, err } if resp.Data == nil { diff --git a/marketing-api/api/keyword/v3/update.go b/marketing-api/api/keyword/v3/update.go index 95253413..a4d99e1f 100644 --- a/marketing-api/api/keyword/v3/update.go +++ b/marketing-api/api/keyword/v3/update.go @@ -9,7 +9,7 @@ import ( // Update 更新关键词 func Update(clt *core.SDKClient, accessToken string, req *v3.UpdateRequest) (*keyword.ResponseData, error) { var resp keyword.Response - if err := clt.Post("v3.0/keyword/update/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/keyword/update/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/privativeword/v3/get.go b/marketing-api/api/privativeword/v3/get.go index 3412b4be..2a680648 100644 --- a/marketing-api/api/privativeword/v3/get.go +++ b/marketing-api/api/privativeword/v3/get.go @@ -9,7 +9,7 @@ import ( // 2.0项目批量获取否定词 func Get(clt *core.SDKClient, accessToken string, req *v3.GetRequest) ([]v3.Word, error) { var resp v3.GetResponse - if err := clt.Get("v3.0/tools/privative_word/project/batch_get", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/privative_word/project/batch_get", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.List, nil diff --git a/marketing-api/api/privativeword/v3/project_add.go b/marketing-api/api/privativeword/v3/project_add.go index f0cd534c..c1c6a45e 100644 --- a/marketing-api/api/privativeword/v3/project_add.go +++ b/marketing-api/api/privativeword/v3/project_add.go @@ -9,7 +9,7 @@ import ( // 2.0批量添加否定词 func Add(clt *core.SDKClient, accessToken string, req *v3.AddRequest) (*v3.AddResponseData, error) { var resp v3.AddResponse - if err := clt.Post("v3.0/tools/privative_word/project/add", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/tools/privative_word/project/add", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/privativeword/v3/project_update.go b/marketing-api/api/privativeword/v3/project_update.go index e6afbad3..dfc160b3 100644 --- a/marketing-api/api/privativeword/v3/project_update.go +++ b/marketing-api/api/privativeword/v3/project_update.go @@ -9,7 +9,7 @@ import ( // 2.0项目批量更新否定词(全量更新) func Update(clt *core.SDKClient, accessToken string, req *v3.AddRequest) (*v3.AddResponseData, error) { var resp v3.AddResponse - if err := clt.Post("v3.0/tools/privative_word/project/update", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/tools/privative_word/project/update", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/report/v3/custom_config.get.go b/marketing-api/api/report/v3/custom_config.get.go index ec185c2a..d56d7e53 100644 --- a/marketing-api/api/report/v3/custom_config.get.go +++ b/marketing-api/api/report/v3/custom_config.get.go @@ -8,7 +8,7 @@ import ( // CustomConfigGet 获取自定义报表可用指标和维度 func CustomConfigGet(clt *core.SDKClient, accessToken string, req *v3.CustomConfigGetRequest) ([]v3.CustomConfig, error) { var resp v3.CustomConfigGetResponse - if err := clt.Get("v3.0/report/custom/config/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/report/custom/config/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.List, nil diff --git a/marketing-api/api/report/v3/custom_get.go b/marketing-api/api/report/v3/custom_get.go index 92856d8b..d491b698 100644 --- a/marketing-api/api/report/v3/custom_get.go +++ b/marketing-api/api/report/v3/custom_get.go @@ -8,7 +8,7 @@ import ( // CustomGet 自定义数据报表 func CustomGet(clt *core.SDKClient, accessToken string, req *v3.CustomGetRequest) (*v3.CustomGetResult, error) { var resp v3.CustomGetResponse - if err := clt.Get("v3.0/report/custom/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/report/custom/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/adpreview/v3/qrcode_get.go b/marketing-api/api/tools/adpreview/v3/qrcode_get.go index 98af0221..ed9cbc9e 100644 --- a/marketing-api/api/tools/adpreview/v3/qrcode_get.go +++ b/marketing-api/api/tools/adpreview/v3/qrcode_get.go @@ -8,7 +8,7 @@ import ( // QrcodeGet 获取广告预览二维码 func QrcodeGet(clt *core.SDKClient, accessToken string, req *v3.QrcodeGetRequest) (*v3.QrcodeGetResponseData, error) { var resp v3.QrcodeGetResponse - err := clt.Get("v3.0/tools/ad_preview/qrcode_get/", req, &resp, accessToken) + err := clt.GetAPI("v3.0/tools/ad_preview/qrcode_get/", req, &resp, accessToken) if err != nil { return nil, err } diff --git a/marketing-api/api/tools/asset_link_list.go b/marketing-api/api/tools/asset_link_list.go index ff510b08..5f7676cb 100644 --- a/marketing-api/api/tools/asset_link_list.go +++ b/marketing-api/api/tools/asset_link_list.go @@ -9,7 +9,7 @@ import ( // 获取字节小程序/小游戏详情内容 func AssetLinkList(clt *core.SDKClient, accessToken string, req *tools.AssetLinkListRequest) (*tools.AssetLinkListResult, error) { var resp tools.AssetLinkListResponse - if err := clt.Get("v3.0/tools/asset_link/list/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/asset_link/list/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/diagnosis/v3/suggestion_accept.go b/marketing-api/api/tools/diagnosis/v3/suggestion_accept.go index be4ca7dd..de06c386 100644 --- a/marketing-api/api/tools/diagnosis/v3/suggestion_accept.go +++ b/marketing-api/api/tools/diagnosis/v3/suggestion_accept.go @@ -9,7 +9,7 @@ import ( // 通过采纳诊断建议接口,广告主可以采纳【获取诊断建议】接口所获得的所有建议 func SuggestionAccept(clt *core.SDKClient, accessToken string, req *diagnosis.SuggestionAcceptRequest) (*diagnosis.SuggestionAcceptResponseData, error) { var resp diagnosis.SuggestionAcceptResponse - err := clt.Post("v3.0/tools/promotion_diagnosis/suggestion/accept/", req, &resp, accessToken) + err := clt.PostAPI("v3.0/tools/promotion_diagnosis/suggestion/accept/", req, &resp, accessToken) if err != nil { return nil, err } diff --git a/marketing-api/api/tools/diagnosis/v3/suggestion_get.go b/marketing-api/api/tools/diagnosis/v3/suggestion_get.go index 00da61d2..d7aa3fc0 100644 --- a/marketing-api/api/tools/diagnosis/v3/suggestion_get.go +++ b/marketing-api/api/tools/diagnosis/v3/suggestion_get.go @@ -10,7 +10,7 @@ import ( // 通过获取计划诊断建议接口,广告主可指定计划ID和场景类型获取相应的诊断建议,针对每一计划ID,本接口可返回计划对应场景下的所有建议,以及建议对应下的所有工具。广告主可通过【采纳诊断建议】接口采纳本接口获得的所有建议,对广告计划进行优化。 func SuggestionGet(clt *core.SDKClient, accessToken string, req *diagnosis.SuggestionGetRequest) (*diagnosis.SuggestionGetResponseData, error) { var resp diagnosis.SuggestionGetResponse - err := clt.Get("v3.0/tools/promotion_diagnosis/suggestion/get/", req, &resp, accessToken) + err := clt.GetAPI("v3.0/tools/promotion_diagnosis/suggestion/get/", req, &resp, accessToken) if err != nil { return nil, err } diff --git a/marketing-api/api/v3/cdp_brand_get.go b/marketing-api/api/v3/cdp_brand_get.go index f591afac..1db32646 100644 --- a/marketing-api/api/v3/cdp_brand_get.go +++ b/marketing-api/api/v3/cdp_brand_get.go @@ -9,7 +9,7 @@ import ( // 仅能查询到关联云图和cdp的广告主品牌及类别信息 func CdpBrandGet(clt *core.SDKClient, accessToken string, req *v3.CdpBrandGetRequest) (*v3.CdpBrandGetResult, error) { var resp v3.CdpBrandGetResponse - if err := clt.Get("v3.0/cdp/brand/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/cdp/brand/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/v3/project/budget_group_create.go b/marketing-api/api/v3/project/budget_group_create.go index 6b0bcad6..15dcb2c3 100644 --- a/marketing-api/api/v3/project/budget_group_create.go +++ b/marketing-api/api/v3/project/budget_group_create.go @@ -9,7 +9,7 @@ import ( // 新建预算组,预算组可设置多个项目的预算(日预算) func BudgetGroupCreate(clt *core.SDKClient, accessToken string, req *project.BudgetGroupCreateRequest) (uint64, error) { var resp project.BudgetGroupCreateResponse - if err := clt.Post("v3.0/budget_group/create/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/budget_group/create/", req, &resp, accessToken); err != nil { return 0, err } return resp.Data.BudgetGroupID, nil diff --git a/marketing-api/api/v3/project/budget_group_delete.go b/marketing-api/api/v3/project/budget_group_delete.go index 5e5b64e8..c16bd655 100644 --- a/marketing-api/api/v3/project/budget_group_delete.go +++ b/marketing-api/api/v3/project/budget_group_delete.go @@ -8,7 +8,7 @@ import ( // BudgetGroupDelete 批量删除预算组 func BudgetGroupDelete(clt *core.SDKClient, accessToken string, req *project.BudgetGroupDeleteRequest) (*project.BudgetGroupDeleteResult, error) { var resp project.BudgetGroupDeleteResponse - if err := clt.Post("v3.0/budget_group/delete/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/budget_group/delete/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/v3/project/budget_group_list.go b/marketing-api/api/v3/project/budget_group_list.go index dcf34769..c64a1c57 100644 --- a/marketing-api/api/v3/project/budget_group_list.go +++ b/marketing-api/api/v3/project/budget_group_list.go @@ -8,7 +8,7 @@ import ( // BudgetGroupList 获取预算组列表 func BudgetGroupList(clt *core.SDKClient, accessToken string, req *project.BudgetGroupListRequest) (*project.BudgetGroupListResult, error) { var resp project.BudgetGroupListResponse - if err := clt.Get("v3.0/budget_group/list/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/budget_group/list/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/v3/project/budget_group_update.go b/marketing-api/api/v3/project/budget_group_update.go index 4b8e334a..418b5fef 100644 --- a/marketing-api/api/v3/project/budget_group_update.go +++ b/marketing-api/api/v3/project/budget_group_update.go @@ -9,7 +9,7 @@ import ( // 新建预算组,预算组可设置多个项目的预算(日预算) func BudgetGroupUpdate(clt *core.SDKClient, accessToken string, req *project.BudgetGroupUpdateRequest) (uint64, error) { var resp project.BudgetGroupUpdateResponse - if err := clt.Post("v3.0/budget_group/update/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/budget_group/update/", req, &resp, accessToken); err != nil { return 0, err } return resp.Data.BudgetGroupID, nil diff --git a/marketing-api/api/v3/project/budget_update.go b/marketing-api/api/v3/project/budget_update.go index 583aea32..e3850a7f 100644 --- a/marketing-api/api/v3/project/budget_update.go +++ b/marketing-api/api/v3/project/budget_update.go @@ -8,7 +8,7 @@ import ( // BudgetUpdate 更新项目预算 func BudgetUpdate(clt *core.SDKClient, accessToken string, req *project.BudgetUpdateRequest) (*project.UpdateResponseData, error) { var resp project.UpdateResponse - if err := clt.Post("v3.0/project/budget/update/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/project/budget/update/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/v3/project/cost_protect_status_get.go b/marketing-api/api/v3/project/cost_protect_status_get.go index 9cf6ef3d..88737ed7 100644 --- a/marketing-api/api/v3/project/cost_protect_status_get.go +++ b/marketing-api/api/v3/project/cost_protect_status_get.go @@ -9,7 +9,7 @@ import ( // 本接口支持批量查询项目的成本保障状态及相关赔付信息(接口能力仅对齐巨量广告升级版),对应平台能力如下图所示 func CostProtectStatusGet(clt *core.SDKClient, accessToken string, req *project.CostProtectStatusGetRequest) (*project.CostProtectStatusGetResult, error) { var resp project.CostProtectStatusGetResponse - if err := clt.Get("v3.0/project/cost_protect_status/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/project/cost_protect_status/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/v3/project/create.go b/marketing-api/api/v3/project/create.go index 5338e120..37e76e80 100644 --- a/marketing-api/api/v3/project/create.go +++ b/marketing-api/api/v3/project/create.go @@ -8,7 +8,7 @@ import ( // Create 创建项目 func Create(clt *core.SDKClient, accessToken string, req *project.CreateRequest) (uint64, error) { var resp project.CreateResponse - if err := clt.Post("v3.0/project/create/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/project/create/", req, &resp, accessToken); err != nil { return 0, err } return resp.Data.ProjectID, nil diff --git a/marketing-api/api/v3/project/delete.go b/marketing-api/api/v3/project/delete.go index 87eda7d6..2bf8a0d5 100644 --- a/marketing-api/api/v3/project/delete.go +++ b/marketing-api/api/v3/project/delete.go @@ -8,7 +8,7 @@ import ( // Delete 批量删除项目 func Delete(clt *core.SDKClient, accessToken string, req *project.DeleteRequest) (*project.UpdateResponseData, error) { var resp project.UpdateResponse - if err := clt.Post("v3.0/project/delete/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/project/delete/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/v3/project/list.go b/marketing-api/api/v3/project/list.go index ff29ff68..b4cb6fe1 100644 --- a/marketing-api/api/v3/project/list.go +++ b/marketing-api/api/v3/project/list.go @@ -8,7 +8,7 @@ import ( // List 获取广告项目列表 func List(clt *core.SDKClient, accessToken string, req *project.ListRequest) (*project.ListResponseData, error) { var resp project.ListResponse - if err := clt.Get("v3.0/project/list/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/project/list/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/v3/project/roigoal_update.go b/marketing-api/api/v3/project/roigoal_update.go index 5f939887..ed3d3e16 100644 --- a/marketing-api/api/v3/project/roigoal_update.go +++ b/marketing-api/api/v3/project/roigoal_update.go @@ -12,7 +12,7 @@ import ( // 电商推广、自动投放、周期稳投项目 func RoiGoalUpdate(clt *core.SDKClient, accessToken string, req *project.RoiGoalUpdateRequest) (*project.UpdateResponseData, error) { var resp project.UpdateResponse - if err := clt.Post("v3.0/project/roigoal/update/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/project/roigoal/update/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/v3/project/schedule_time_update.go b/marketing-api/api/v3/project/schedule_time_update.go index 7cf64b82..251f8291 100644 --- a/marketing-api/api/v3/project/schedule_time_update.go +++ b/marketing-api/api/v3/project/schedule_time_update.go @@ -8,7 +8,7 @@ import ( // ScheduleTimeUpdate 批量更新项目投放时间 func ScheduleTimeUpdate(clt *core.SDKClient, accessToken string, req *project.ScheduleTimeUpdateRequest) (*project.UpdateResponseData, error) { var resp project.UpdateResponse - if err := clt.Post("v3.0/project/schedule_time/update/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/project/schedule_time/update/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/v3/project/status_update.go b/marketing-api/api/v3/project/status_update.go index 62497904..75efd44d 100644 --- a/marketing-api/api/v3/project/status_update.go +++ b/marketing-api/api/v3/project/status_update.go @@ -8,7 +8,7 @@ import ( // StatusUpdate 更新项目状态 func StatusUpdate(clt *core.SDKClient, accessToken string, req *project.StatusUpdateRequest) (*project.UpdateResponseData, error) { var resp project.UpdateResponse - if err := clt.Post("v3.0/project/status/update/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/project/status/update/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/v3/project/update.go b/marketing-api/api/v3/project/update.go index 41806f37..e2bc1eff 100644 --- a/marketing-api/api/v3/project/update.go +++ b/marketing-api/api/v3/project/update.go @@ -8,7 +8,7 @@ import ( // Update 修改项目 func Update(clt *core.SDKClient, accessToken string, req *project.UpdateRequest) (*project.UpdateResponseData, error) { var resp project.UpdateResponse - if err := clt.Post("v3.0/project/update/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/project/update/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/v3/project/week_schedule_update.go b/marketing-api/api/v3/project/week_schedule_update.go index b91308e2..0aa9656d 100644 --- a/marketing-api/api/v3/project/week_schedule_update.go +++ b/marketing-api/api/v3/project/week_schedule_update.go @@ -8,7 +8,7 @@ import ( // WeekScheduleUpdate 批量更新项目投放时段 func WeekScheduleUpdate(clt *core.SDKClient, accessToken string, req *project.WeekScheduleUpdateRequest) (*project.UpdateResponseData, error) { var resp project.UpdateResponse - if err := clt.Post("v3.0/project/week_schedule/update/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/project/week_schedule/update/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/v3/promotion/bid_update.go b/marketing-api/api/v3/promotion/bid_update.go index 551f4cd6..087233b6 100644 --- a/marketing-api/api/v3/promotion/bid_update.go +++ b/marketing-api/api/v3/promotion/bid_update.go @@ -8,7 +8,7 @@ import ( // BidUpdate 更新出价 func BidUpdate(clt *core.SDKClient, accessToken string, req *promotion.BidUpdateRequest) (*promotion.UpdateResponseData, error) { var resp promotion.UpdateResponse - err := clt.Post("v3.0/promotion/bid/update/", req, &resp, accessToken) + err := clt.PostAPI("v3.0/promotion/bid/update/", req, &resp, accessToken) if err != nil { return nil, err } diff --git a/marketing-api/api/v3/promotion/budget_update.go b/marketing-api/api/v3/promotion/budget_update.go index 890bf43d..ddc84edd 100644 --- a/marketing-api/api/v3/promotion/budget_update.go +++ b/marketing-api/api/v3/promotion/budget_update.go @@ -8,7 +8,7 @@ import ( // BudgetUpdate 更新广告预算 func BudgetUpdate(clt *core.SDKClient, accessToken string, req *promotion.BudgetUpdateRequest) (*promotion.UpdateResponseData, error) { var resp promotion.UpdateResponse - err := clt.Post("v3.0/promotion/budget/update/", req, &resp, accessToken) + err := clt.PostAPI("v3.0/promotion/budget/update/", req, &resp, accessToken) if err != nil { return nil, err } diff --git a/marketing-api/api/v3/promotion/cost_protect_status_get.go b/marketing-api/api/v3/promotion/cost_protect_status_get.go index 4a52f648..cabe4a27 100644 --- a/marketing-api/api/v3/promotion/cost_protect_status_get.go +++ b/marketing-api/api/v3/promotion/cost_protect_status_get.go @@ -8,7 +8,7 @@ import ( // CostProtectStatusGet 批量获取计划成本保障状态 func CostProtectStatusGet(clt *core.SDKClient, accessToken string, req *promotion.CostProtectStatusGetRequest) ([]promotion.CostProtectStatus, error) { var resp promotion.CostProtectStatusGetResponse - if err := clt.Get("v3.0/promotion/cost_protect_status/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/promotion/cost_protect_status/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.List, nil diff --git a/marketing-api/api/v3/promotion/create.go b/marketing-api/api/v3/promotion/create.go index da1a2eca..c7611fde 100644 --- a/marketing-api/api/v3/promotion/create.go +++ b/marketing-api/api/v3/promotion/create.go @@ -8,7 +8,7 @@ import ( // Create 创建广告 func Create(clt *core.SDKClient, accessToken string, req *promotion.CreateRequest) (uint64, error) { var resp promotion.CreateResponse - if err := clt.Post("v3.0/promotion/create/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/promotion/create/", req, &resp, accessToken); err != nil { return 0, err } return resp.Data.PromotionID, nil diff --git a/marketing-api/api/v3/promotion/deepbid_update.go b/marketing-api/api/v3/promotion/deepbid_update.go index b5029686..6fea185a 100644 --- a/marketing-api/api/v3/promotion/deepbid_update.go +++ b/marketing-api/api/v3/promotion/deepbid_update.go @@ -8,7 +8,7 @@ import ( // DeepBidUpdate 更新深度出价 func DeepBidUpdate(clt *core.SDKClient, accessToken string, req *promotion.DeepBidUpdateRequest) (*promotion.UpdateResponseData, error) { var resp promotion.UpdateResponse - err := clt.Post("v3.0/promotion/deepbid/update/", req, &resp, accessToken) + err := clt.PostAPI("v3.0/promotion/deepbid/update/", req, &resp, accessToken) if err != nil { return nil, err } diff --git a/marketing-api/api/v3/promotion/delete.go b/marketing-api/api/v3/promotion/delete.go index dd6069e4..f0874541 100644 --- a/marketing-api/api/v3/promotion/delete.go +++ b/marketing-api/api/v3/promotion/delete.go @@ -8,7 +8,7 @@ import ( // Delete 批量删除广告 func Delete(clt *core.SDKClient, accessToken string, req *promotion.DeleteRequest) (*promotion.UpdateResponseData, error) { var resp promotion.UpdateResponse - err := clt.Post("v3.0/promotion/delete/", req, &resp, accessToken) + err := clt.PostAPI("v3.0/promotion/delete/", req, &resp, accessToken) if err != nil { return nil, err } diff --git a/marketing-api/api/v3/promotion/list.go b/marketing-api/api/v3/promotion/list.go index 2fcf1e74..68ad2b1f 100644 --- a/marketing-api/api/v3/promotion/list.go +++ b/marketing-api/api/v3/promotion/list.go @@ -8,7 +8,7 @@ import ( // List 获取广告列表 func List(clt *core.SDKClient, accessToken string, req *promotion.ListRequest) (*promotion.ListResponseData, error) { var resp promotion.ListResponse - if err := clt.Get("v3.0/promotion/list/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/promotion/list/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/v3/promotion/material_status_update.go b/marketing-api/api/v3/promotion/material_status_update.go index 520e19c7..35c86562 100644 --- a/marketing-api/api/v3/promotion/material_status_update.go +++ b/marketing-api/api/v3/promotion/material_status_update.go @@ -8,7 +8,7 @@ import ( // MaterialStatusUpdate 批量更新广告素材启用状态 func MaterialStatusUpdate(clt *core.SDKClient, accessToken string, req *promotion.MaterialStatusUpdateRequest) (*promotion.MaterialStatusUpdateResult, error) { var resp promotion.MaterialStatusUpdateResponse - err := clt.Post("v3.0/promotion/material/status/update/", req, &resp, accessToken) + err := clt.PostAPI("v3.0/promotion/material/status/update/", req, &resp, accessToken) if err != nil { return nil, err } diff --git a/marketing-api/api/v3/promotion/reject_reason.go b/marketing-api/api/v3/promotion/reject_reason.go index 653e5fcd..7c61c574 100644 --- a/marketing-api/api/v3/promotion/reject_reason.go +++ b/marketing-api/api/v3/promotion/reject_reason.go @@ -8,7 +8,7 @@ import ( // RejectReason 获取计划审核建议 func RejectReason(clt *core.SDKClient, accessToken string, req *promotion.RejectReasonRequest) ([]promotion.RejectReason, error) { var resp promotion.RejectReasonResponse - if err := clt.Get("v3.0/promotion/reject_reason/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/promotion/reject_reason/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.List, nil diff --git a/marketing-api/api/v3/promotion/schedule_time_update.go b/marketing-api/api/v3/promotion/schedule_time_update.go index aa2288cd..150950d4 100644 --- a/marketing-api/api/v3/promotion/schedule_time_update.go +++ b/marketing-api/api/v3/promotion/schedule_time_update.go @@ -10,7 +10,7 @@ import ( // 仅支持手动投放的广告 func ScheduleTimeUpdate(clt *core.SDKClient, accessToken string, req *promotion.ScheduleTimeUpdateRequest) (*promotion.UpdateResponseData, error) { var resp promotion.UpdateResponse - if err := clt.Post("v3.0/promotion/schedule_time/update/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/promotion/schedule_time/update/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/v3/promotion/status_update.go b/marketing-api/api/v3/promotion/status_update.go index 5bdc5668..b1ef609f 100644 --- a/marketing-api/api/v3/promotion/status_update.go +++ b/marketing-api/api/v3/promotion/status_update.go @@ -8,7 +8,7 @@ import ( // StatusUpdate 更新广告状态 func StatusUpdate(clt *core.SDKClient, accessToken string, req *promotion.StatusUpdateRequest) (*promotion.UpdateResponseData, error) { var resp promotion.UpdateResponse - err := clt.Post("v3.0/promotion/status/update/", req, &resp, accessToken) + err := clt.PostAPI("v3.0/promotion/status/update/", req, &resp, accessToken) if err != nil { return nil, err } diff --git a/marketing-api/api/v3/promotion/update.go b/marketing-api/api/v3/promotion/update.go index dd590a86..2daeddb4 100644 --- a/marketing-api/api/v3/promotion/update.go +++ b/marketing-api/api/v3/promotion/update.go @@ -8,7 +8,7 @@ import ( // Update 修改广告 func Update(clt *core.SDKClient, accessToken string, req *promotion.UpdateRequest) (*promotion.UpdateResponseData, error) { var resp promotion.UpdateResponse - if err := clt.Post("v3.0/promotion/update/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/promotion/update/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/enum/product_audit_status.go b/marketing-api/enum/product_audit_status.go new file mode 100644 index 00000000..a17be6f2 --- /dev/null +++ b/marketing-api/enum/product_audit_status.go @@ -0,0 +1,13 @@ +package enum + +// ProductAuditStatus 商品审核状态 +type ProductAuditStatus string + +const ( + // ProductAuditStatus_AUDIT_STATUS_APPROVE 审核通过 + ProductAuditStatus_AUDIT_STATUS_APPROVE ProductAuditStatus = "AUDIT_STATUS_APPROVE" + // ProductAuditStatus_AUDIT_STATUS_INIT 审核中 + ProductAuditStatus_AUDIT_STATUS_INIT ProductAuditStatus = "AUDIT_STATUS_INIT" + // ProductAuditStatus_AUDIT_STATUS_REJECT 审核未通过 + ProductAuditStatus_AUDIT_STATUS_REJECT ProductAuditStatus = "AUDIT_STATUS_REJECT" +) diff --git a/marketing-api/enum/product_completion_status.go b/marketing-api/enum/product_completion_status.go new file mode 100644 index 00000000..0d746c08 --- /dev/null +++ b/marketing-api/enum/product_completion_status.go @@ -0,0 +1,15 @@ +package enum + +// ProductCompletionStatus 字段填充状态 +type ProductCompletionStatus string + +const ( + // ProductCompletionStatus_AD_COMPLETED 广告场景已完善 + ProductCompletionStatus_AD_COMPLETED ProductCompletionStatus = "AD_COMPLETED" + // ProductCompletionStatus_ALL_COMPLETED 必填字段已完善 + ProductCompletionStatus_ALL_COMPLETED ProductCompletionStatus = "ALL_COMPLETED" + // ProductCompletionStatus_LEADS_COMPLETED 经营场景已完善 + ProductCompletionStatus_LEADS_COMPLETED ProductCompletionStatus = "LEADS_COMPLETED" + // ProductCompletionStatus_TO_BE_COMPLETED 必填字段待完善 + ProductCompletionStatus_TO_BE_COMPLETED ProductCompletionStatus = "TO_BE_COMPLETED" +) diff --git a/marketing-api/enum/product_status.go b/marketing-api/enum/product_status.go new file mode 100644 index 00000000..6d40c3e3 --- /dev/null +++ b/marketing-api/enum/product_status.go @@ -0,0 +1,42 @@ +package enum + +import "strconv" + +// ProductStatus 商品状态,可选值: +type ProductStatus int + +const ( + // ProductStatus_STATUS_OFFLINE 线下不可投放状态 + ProductStatus_STATUS_OFFLINE ProductStatus = 0 + // ProductStatus_STATUS_ONLINE 线上可投放状态 + ProductStatus_STATUS_ONLINE ProductStatus = 1 +) + +func (status *ProductStatus) UnmarshalJSON(b []byte) (err error) { + if b[0] == '"' && b[len(b)-1] == '"' { + b = b[1 : len(b)-1] + } + str := string(b) + var i int + switch str { + case "STATUS_OFFLINE": + i = 0 + case "STATUS_ONLINE": + i = 1 + default: + i, _ = strconv.Atoi(str) + } + *status = ProductStatus(i) + return nil +} + +func (i ProductStatus) Value() int { + return int(i) +} + +func (i ProductStatus) String() string { + if i == 1 { + return "STATUS_ONLINE" + } + return "STATUS_OFFLINE" +} diff --git a/marketing-api/model/dpa/asset.go b/marketing-api/model/dpa/asset.go index 007d0bf1..77f4421e 100644 --- a/marketing-api/model/dpa/asset.go +++ b/marketing-api/model/dpa/asset.go @@ -1,6 +1,6 @@ package dpa -// Asset 物件 +// Asset 投放条件 type Asset struct { // AdvertiserID 广告主id AdvertiserID uint64 `json:"advertiser_id,omitempty"` @@ -12,8 +12,16 @@ type Asset struct { AssetType string `json:"asset_type,omitempty"` // ProductID 商品id ProductID uint64 `json:"product_id,omitempty"` + // UniqueProductID 线索商品id + UniqueProductID uint64 `json:"unique_product_id,omitempty"` // Status 物件状态,DISABLE代表暂停, ENABLE代表启用 Status string `json:"status,omitempty"` + // AuditStatus 投放条件状态 可选值: + // REVIEW_FAIL 审核失败 + // REVIEW_SUCCESS 审核成功 + // UNDER_REVIEW 审核中 + // UNREVIEWED 未送审 + AuditStatus string `json:"audit_status,omitempty"` // Source 来源,MANUAL为用户操作,AUTO为系统生成 Source string `json:"source,omitempty"` // AssetCreateTime 物件创建时间,格式: yyyy-MM-DD diff --git a/marketing-api/model/dpa/assets_list_v2.go b/marketing-api/model/dpa/assets_list_v2.go new file mode 100644 index 00000000..162edc45 --- /dev/null +++ b/marketing-api/model/dpa/assets_list_v2.go @@ -0,0 +1,65 @@ +package dpa + +import ( + "encoding/json" + "strconv" + + "github.com/bububa/oceanengine/marketing-api/model" + "github.com/bububa/oceanengine/marketing-api/util" +) + +// AssetsListV2Request 获取投放条件列表(线索版) API Request +type AssetsListV2Request struct { + // AdvertiserID 广告主ID + AdvertiserID uint64 `json:"advertiser_id,omitempty"` + // UniqueProductIDs 新线索商品ID列表,最多传入100个 + UniqueProductIDs []uint64 `json:"unique_product_ids,omitempty"` + // Filtering 过滤条件 + Filtering *AssetsListV2Filter `json:"filtering,omitempty"` + // Page 页码, 默认值: 1 + Page int `json:"page,omitempty"` + // PageSize 页面数据量, 默认值: 10,最大 100 + PageSize int `json:"page_size,omitempty"` +} + +// AssetsListV2Filter 过滤条件 +type AssetsListV2Filter struct { + // Status 物件状态, + // DISABLE 暂停 + // ENABLE 启用 + Status string `json:"status"` +} + +// Encode implement GetRequest interface +func (r AssetsListV2Request) Encode() string { + values := util.GetUrlValues() + values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10)) + values.Set("unique_product_ids", string(util.JSONMarshal(r.UniqueProductIDs))) + if r.Filtering != nil { + bs, _ := json.Marshal(r.Filtering) + values.Set("filtering", string(bs)) + } + if r.Page > 1 { + 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 +} + +// AssetsListV2Response 获取投放条件列表 API Response +type AssetsListV2Response struct { + Data *AssetsListV2Result `json:"data,omitempty"` + model.BaseResponse +} + +// AssetsListV2Result +type AssetsListV2Result struct { + // PageInfo 分页信息 + PageInfo *model.PageInfo `json:"page_info,omitempty"` + // AssetList 商品库商品列表 + AssetList []Asset `json:"asset_list,omitempty"` +} diff --git a/marketing-api/model/dpa/category.go b/marketing-api/model/dpa/category.go index 9f5b4943..1c0a7266 100644 --- a/marketing-api/model/dpa/category.go +++ b/marketing-api/model/dpa/category.go @@ -4,12 +4,12 @@ import "github.com/bububa/oceanengine/marketing-api/model" // Category DPA分类 type Category struct { - // ID 分类id - ID model.Uint64 `json:"id,omitempty"` // Name 分类名称 Name string `json:"name,omitempty"` - // Parent 父级分类id,没有父级则为-1 - Parent model.Uint64 `json:"parent,omitempty"` // Subs 子级分类,嵌套递归 Subs []Category `json:"subs,omitempty"` + // ID 分类id + ID model.Uint64 `json:"id,omitempty"` + // Parent 父级分类id,没有父级则为-1 + Parent model.Uint64 `json:"parent,omitempty"` } diff --git a/marketing-api/model/dpa/clue_product_detail.go b/marketing-api/model/dpa/clue_product_detail.go new file mode 100644 index 00000000..ca51434d --- /dev/null +++ b/marketing-api/model/dpa/clue_product_detail.go @@ -0,0 +1,35 @@ +package dpa + +import ( + "strconv" + + "github.com/bububa/oceanengine/marketing-api/model" + "github.com/bububa/oceanengine/marketing-api/util" +) + +// ClueProductDetailRequest 获取升级版商品详情 API Request +type ClueProductDetailRequest struct { + // ProductIDs 线索商品ID + ProductIDs []uint64 `json:"product_ids,omitempty"` + // AdvertiserID 广告主ID + AdvertiserID uint64 `json:"advertiser_id,omitempty"` +} + +// Encode implements GetRequest interface +func (r ClueProductDetailRequest) Encode() string { + values := util.GetUrlValues() + values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10)) + values.Set("product_ids", string(util.JSONMarshal(r.ProductIDs))) + ret := values.Encode() + util.PutUrlValues(values) + return ret +} + +// ClueProductDetailResponse 获取升级版商品详情 API Response +type ClueProductDetailResponse struct { + model.BaseResponse + Data struct { + // Products 商品信息 + Products []Product `json:"products,omitempty"` + } `json:"data,omitempty"` +} diff --git a/marketing-api/model/dpa/clue_product_list.go b/marketing-api/model/dpa/clue_product_list.go new file mode 100644 index 00000000..ac474817 --- /dev/null +++ b/marketing-api/model/dpa/clue_product_list.go @@ -0,0 +1,78 @@ +package dpa + +import ( + "strconv" + + "github.com/bububa/oceanengine/marketing-api/enum" + "github.com/bububa/oceanengine/marketing-api/model" + "github.com/bububa/oceanengine/marketing-api/util" +) + +// ClueProductListRequest 获取升级版商品列表 API Request +type ClueProductListRequest struct { + // Filtering 过滤条件 + Filtering *ClueProductListFilter `json:"filtering,omitempty"` + // AdvertiserID 广告主ID + AdvertiserID uint64 `json:"advertiser_id,omitempty"` + // Page 页码 + Page int `json:"page,omitempty"` + // PageSize 页面大小,默认值为10,传参范围[1,100] + PageSize int `json:"page_size,omitempty"` +} + +type ClueProductListFilter struct { + // ProductIDs 商品ID精确搜索 + ProductIDs []uint64 `json:"product_ids,omitempty"` + // ProductName 商品名称模糊搜索 + ProductName string `json:"product_name,omitempty"` + // AuditStatus 商品审核状态 可选值: + // AUDIT_STATUS_APPROVE 审核通过 + // AUDIT_STATUS_INIT 审核中 + // AUDIT_STATUS_REJECT 审核未通过 + AuditStatus enum.ProductAuditStatus `json:"audit_status,omitempty"` + // CategoryIDs 类目id,会级联查询所有叶子类目 + CategoryIDs []uint64 `json:"category_ids,omitempty"` + // CategoryName 类目名称,支持模糊搜索 + CategoryName string `json:"category_name,omitempty"` + // CompletionStatus 商品必填字段完整性 + CompletionStatus []enum.ProductCompletionStatus `json:"completion_status,omitempty"` + // ProductIDOrNameSearch 商品ID或商品名称查询 + ProductIDOrNameSearch string `json:"product_id_or_name_search,omitempty"` + // Statuses 可投状态过滤 + Statuses []string `json:"statuses,omitempty"` + // Rels 商品权限关系过滤,允许值: + // REL_COP 授权 + // REL_OWN own + Rels []string `json:"rels,omitempty"` +} + +// Encode implements GetRequest interface +func (r ClueProductListRequest) 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 +} + +// ClueProductListResponse 获取升级版商品列表 API Response +type ClueProductListResponse struct { + Data *ClueProductListResult `json:"data,omitempty"` + model.BaseResponse +} + +type ClueProductListResult struct { + // PageInfo 分页信息 + PageInfo *model.PageInfo `json:"page_info,omitempty"` + // Products 商品列表 + Products []Product `json:"products,omitempty"` +} diff --git a/marketing-api/model/dpa/playlet_auth_get.go b/marketing-api/model/dpa/playlet_auth_get.go new file mode 100644 index 00000000..0bd08e0e --- /dev/null +++ b/marketing-api/model/dpa/playlet_auth_get.go @@ -0,0 +1,52 @@ +package dpa + +import ( + "strconv" + + "github.com/bububa/oceanengine/marketing-api/model" + "github.com/bububa/oceanengine/marketing-api/util" +) + +// PlayletAuthGetRequest 查询短剧商品原片授权申请状态 API Request +type PlayletAuthGetRequest struct { + // AdvertiserID 广告主账户ID + AdvertiserID uint64 `json:"advertiser_id,omitempty"` + // PlatformID 商品库ID,可通过「获取商品列表」接口获取 + PlatformID uint64 `json:"platform_id,omitempty"` + // ProductID 商品ID,可通过「获取商品列表」接口获取 + ProductID uint64 `json:"product_id,omitempty"` +} + +// Encode implements GetRequest interface +func (r PlayletAuthGetRequest) Encode() string { + values := util.GetUrlValues() + values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10)) + values.Set("platform_id", strconv.FormatUint(r.PlatformID, 10)) + values.Set("product_id", strconv.FormatUint(r.ProductID, 10)) + ret := values.Encode() + util.PutUrlValues(values) + return ret +} + +// PlayletAuthGetResponse 查询短剧商品原片授权申请状态 API Response +type PlayletAuthGetResponse struct { + Data *PlayletAuthGetResult `json:"data,omitempty"` + model.BaseResponse +} + +type PlayletAuthGetResult struct { + // AlbumID 短剧ID + AlbumID string `json:"album_id,omitempty"` + // Status 申请状态 可选值: + // ING 申请中 + // SUCCESS 申请成功 + // FAIL 申请失败 + // UNSUBMITTED 未提交申请 + Status string `json:"status,omitempty"` + // ApplyTime 申请提交时间,时间格式为yyyy-mm-dd hh:mm:ss + ApplyTime string `json:"apply_time,omitempty"` + // ExpireTime 授权过期时间,时间格式为yyyy-mm-dd hh:mm:ss + ExpireTime string `json:"expire_time,omitempty"` + // AlbumName 短剧名称 + AlbumName string `json:"album_name,omitempty"` +} diff --git a/marketing-api/model/dpa/product.go b/marketing-api/model/dpa/product.go index 66ab70af..9a0658a4 100644 --- a/marketing-api/model/dpa/product.go +++ b/marketing-api/model/dpa/product.go @@ -1,6 +1,9 @@ package dpa -import "github.com/bububa/oceanengine/marketing-api/model" +import ( + "github.com/bububa/oceanengine/marketing-api/enum" + "github.com/bububa/oceanengine/marketing-api/model" +) // Product 商品详情 type Product struct { @@ -20,6 +23,8 @@ type Product struct { ProductID uint64 `json:"product_id,omitempty"` // SpuID 商品spu_id SpuID string `json:"spu_id,omitempty"` + // PoiID 商品poiID + PoiID string `json:"poi_id,omitempty"` // OuterID 商品外部id OuterID string `json:"outer_id,omitempty"` // ImageURL 商品封面图片链接 @@ -27,7 +32,18 @@ type Product struct { // ImageURLs 扩展商品图,商品图片的补充 ImageURLs []Link `json:"image_urls,omitempty"` // Status 商品投放状态,0代表不可投放,1代表可投放 - Status int `json:"status,omitempty"` + Status enum.ProductStatus `json:"status,omitempty"` + // AuditStatus 审核状态,可选值: + // AUDIT_STATUS_APPROVE 审核通过 + // AUDIT_STATUS_INIT 审核中 + // AUDIT_STATUS_REJECT 审核未通过 + AuditStatus enum.ProductAuditStatus `json:"audit_status,omitempty"` + // CompletionStatus 字段填充状态,可选值: + // AD_COMPLETED 广告场景已完善 + // ALL_COMPLETED 必填字段已完善 + // LEADS_COMPLETED 经营场景已完善 + // TO_BE_COMPLETED 必填字段待完善 + CompletionStatus enum.ProductCompletionStatus `json:"completion_status,omitempty"` // Stock 商品库存状态,0代表无库存,1代表有库存 Stock int `json:"stock,omitempty"` // LandingInfo 落地页信息 @@ -64,6 +80,8 @@ type Product struct { Label string `json:"label,omitempty"` // ExternalURL 落地页链接 ExternalURL string `json:"external_url,omitempty"` + // Category 商品类目信息 + Category *ProductCategory `json:"category,omitempty"` // FirstCategory 商品所处一级行业 FirstCategory string `json:"first_category,omitempty"` // SubCategory 商品所处二级行业 @@ -71,17 +89,19 @@ type Product struct { // ThirdCategory 商品所处三级行业 ThirdCategory string `json:"third_category,omitempty"` // FirstCategoryID 商品所处一级行业 ID - FirstCategoryID string `json:"first_category_id,omitempty"` + FirstCategoryID model.Uint64 `json:"first_category_id,omitempty"` // SubCategoryID 商品所处二级行业 ID - SubCategoryID string `json:"sub_category_id,omitempty"` + SubCategoryID model.Uint64 `json:"sub_category_id,omitempty"` // ThirdCategoryID 商品所处三级行业 ID - ThirdCategoryID string `json:"third_category_id,omitempty"` + ThirdCategoryID model.Uint64 `json:"third_category_id,omitempty"` // BrandName 商品名称 BrandName string `json:"brand_name,omitempty"` // Tags 商品标签 Tags []string `json:"tags,omitempty"` // Video 视频链接url Video string `json:"video,omitempty"` + // VideoURL 商品视频链接 + VideoURL string `json:"video_url,omitempty"` // Videos 视频内容,小说库特有字段 Videos []Link `json:"videos,omitempty"` // HasVideo 当前商品是否有商品视频 0:没有,1:有 @@ -90,8 +110,30 @@ type Product struct { Profession *Profession `json:"profession,omitempty"` } +// Category 商品类目信息 +type ProductCategory struct { + // FirstCategoryName 商品所处一级行业 + FirstCategoryName string `json:"first_category_name,omitempty"` + // SubCategoryName 商品所处二级行业 + SubCategoryName string `json:"sub_category_name,omitempty"` + // ThirdCategoryName 商品所处三级行业 + ThirdCategoryName string `json:"third_category_name,omitempty"` + // FourthCategoryName 四级类目名称 + FourthCategoryName string `json:"fourth_category_name,omitempty"` + // FirstCategoryID 商品所处一级行业 ID + FirstCategoryID uint64 `json:"first_category_id,omitempty"` + // SubCategoryID 商品所处二级行业 ID + SubCategoryID uint64 `json:"sub_category_id,omitempty"` + // ThirdCategoryID 商品所处三级行业 ID + ThirdCategoryID uint64 `json:"third_category_id,omitempty"` + // FourthCategoryID 四级类目ID + FourthCategoryID uint64 `json:"fourth_category_id,omitempty"` +} + type Link struct { URL string `json:"string,omitempty"` + // TemplateID 视频模板ID + TemplateID string `json:"template_id,omitempty"` } // LandingInfo 落地页信息 @@ -136,6 +178,8 @@ type ShopKeeperInfo struct { ShopKeeperID string `json:"shop_keeper_id,omitempty"` // ShopKeeperName 商户名称 ShopKeeperName string `json:"shop_keeper_name,omitempty"` + // ShopKeeperLogo 商家logo + ShopKeeperLogo string `json:"shop_keeper_logo,omitempty"` // ShopKeeperURL PC端商户落地页URL ShopKeeperURL string `json:"shop_keeper_url,omitempty"` // ShopKeeperURLMobile H5页面商户落地页URL @@ -154,14 +198,14 @@ type ShopKeeperInfo struct { type PriceInfo struct { // Value 商品原价,可用于素材拼接,以及动态创意标题或者素材 Value float64 `json:"value,omitempty"` - // PriceUnit 价格单位 - PriceUnit string `json:"price_unit,omitempty"` // Saving 减价 Saving float64 `json:"saving,omitempty"` // Discount 折扣 Discount float64 `json:"discount,omitempty"` // Price 商品现价 Price float64 `json:"price,omitempty"` + // PriceUnit 价格单位 + PriceUnit string `json:"price_unit,omitempty"` // SalesPromotion 促销活动,关于商品促销活动的描述信息 SalesPromotion string `json:"sales_promotion,omitempty"` // DownPayment 首付 diff --git a/marketing-api/model/dpa/product_for_update.go b/marketing-api/model/dpa/product_for_update.go index 909a4e5c..0d7d338d 100644 --- a/marketing-api/model/dpa/product_for_update.go +++ b/marketing-api/model/dpa/product_for_update.go @@ -89,14 +89,14 @@ func CopyProductForUpdateFromProduct(src *Product, dist *ProductForUpdate) { dist.Title = src.Title dist.Description = src.Description dist.OfflineTime = src.OfflineTime.Value() - dist.Status = src.Status + dist.Status = src.Status.Value() dist.Stock = src.Stock dist.FirstCategory = src.FirstCategory dist.SubCategory = src.SubCategory dist.ThirdCategory = src.ThirdCategory - dist.FirstCategoryID = src.FirstCategoryID - dist.SubCategoryID = src.SubCategoryID - dist.ThirdCategoryID = src.ThirdCategoryID + dist.FirstCategoryID = src.FirstCategoryID.String() + dist.SubCategoryID = src.SubCategoryID.String() + dist.ThirdCategoryID = src.ThirdCategoryID.String() dist.SpuID = src.SpuID dist.OuterID = src.OuterID dist.ImageURL = src.ImageURL From 328b87c8b5ab7f93b9a35e8537c222cee00c1fa8 Mon Sep 17 00:00:00 2001 From: Syd Xu Date: Fri, 23 Aug 2024 13:37:59 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(core):=20v3=20api=E5=9F=9F=E5=90=8D?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- marketing-api/OCEANENGINE.md | 5 ++ .../api/advertiser/delivery_pkg_config.go | 2 +- .../api/advertiser/delivery_pkg_delete.go | 17 +++++++ .../api/advertiser/delivery_pkg_submit.go | 2 +- .../advertiser/delivery_qualification_list.go | 2 +- .../delivery_qualification_submit.go | 2 +- .../api/advertiser/qualification_get.go | 2 +- .../api/advertiser/qualification_submit.go | 2 +- .../api/agent/query_tranfser_balance.go | 2 +- .../api/agent/query_transfer_detail.go | 2 +- marketing-api/api/creative/detail_get.go | 2 +- marketing-api/api/eventmanager/share.go | 2 +- .../api/qianchuan/tools/allow_coupon.go | 2 +- .../api/qianchuan/tools/aweme_auth.go | 2 +- .../api/qianchuan/tools/estimate_audience.go | 2 +- marketing-api/api/qianchuan/tools/gray_get.go | 2 +- .../api/qianchuan/tools/shop_auth.go | 2 +- .../api/report/asynctask/v3/create.go | 2 +- marketing-api/api/report/asynctask/v3/get.go | 2 +- marketing-api/api/report/v3/material_get.go | 2 +- marketing-api/api/report/v3/project_get.go | 2 +- marketing-api/api/report/v3/promotion_get.go | 2 +- marketing-api/api/subscribe/accounts_add.go | 2 +- marketing-api/api/subscribe/accounts_list.go | 2 +- .../api/subscribe/accounts_remove.go | 2 +- marketing-api/api/tools/adraise/v3/set.go | 4 +- .../adraise/v3/status_current_ids_get.go | 2 +- .../api/tools/adraise/v3/status_get.go | 4 +- marketing-api/api/tools/adraise/v3/stop.go | 4 +- .../api/tools/adraise/v3/suggest_budget.go | 4 +- .../api/tools/adraise/v3/version_get.go | 4 +- marketing-api/api/tools/aweme_auth_list.go | 2 +- .../api/tools/comment/aweme_banned_create.go | 2 +- .../api/tools/comment/aweme_banned_delete.go | 2 +- .../api/tools/comment/aweme_banned_list.go | 2 +- marketing-api/api/tools/comment/get.go | 2 +- marketing-api/api/tools/comment/hide.go | 2 +- .../api/tools/comment/metrics_get.go | 2 +- .../api/tools/comment/mid2item_id.go | 2 +- marketing-api/api/tools/comment/reply.go | 2 +- marketing-api/api/tools/comment/reply_get.go | 2 +- .../api/tools/comment/stick_on_top.go | 2 +- .../api/tools/comment/terms_banned_add.go | 2 +- .../api/tools/comment/terms_banned_delete.go | 2 +- .../api/tools/comment/terms_banned_get.go | 2 +- .../api/tools/comment/terms_banned_update.go | 2 +- marketing-api/api/tools/gray_get.go | 2 +- .../api/tools/keywordsbidratio/create.go | 2 +- .../api/tools/keywordsbidratio/delete.go | 2 +- .../api/tools/keywordsbidratio/get.go | 2 +- .../keywordsbidratio/project_info_get.go | 2 +- .../api/tools/keywordsbidratio/update.go | 2 +- marketing-api/api/tools/micro_app_list.go | 2 +- marketing-api/api/tools/micro_game_list.go | 2 +- .../api/tools/nativeanchor/create.go | 2 +- .../api/tools/nativeanchor/delete.go | 2 +- marketing-api/api/tools/nativeanchor/get.go | 2 +- .../api/tools/nativeanchor/get_detail.go | 2 +- .../tools/nativeanchor/qrcode_preview_get.go | 2 +- .../api/tools/nativeanchor/update.go | 2 +- .../api/tools/rta/rta_exp_local_daily.go | 2 +- .../api/tools/rta/rta_exp_local_hourly.go | 2 +- .../api/tools/search_bid_ratio_get.go | 2 +- .../union/flow_package_promotion_report.go | 2 +- marketing-api/api/tools/v3/bid_suggest.go | 2 +- .../api/tools/wechat/applet_create.go | 2 +- marketing-api/api/tools/wechat/applet_list.go | 2 +- .../api/tools/wechat/applet_update.go | 2 +- .../tools/wechat/bp_asset_management_share.go | 2 +- .../bp_asset_management_share_cancel.go | 2 +- .../wechat/bp_asset_management_share_get.go | 2 +- marketing-api/api/tools/wechat/game_create.go | 2 +- marketing-api/api/tools/wechat/game_list.go | 2 +- marketing-api/api/v3/blueflow/keyword_list.go | 15 ++++++ marketing-api/api/v3/blueflow/package_list.go | 17 +++++++ .../promotion/auto_generate_config_create.go | 2 +- .../v3/promotion/auto_generate_config_get.go | 2 +- .../model/advertiser/delivery_pkg_delete.go | 45 +++++++++++++++++ .../model/advertiser/delivery_pkg_submit.go | 10 ++-- .../model/v3/blueflow/blue_flow_package.go | 33 +++++++++++++ .../model/v3/blueflow/keyword_list.go | 49 +++++++++++++++++++ .../model/v3/blueflow/package_list.go | 44 +++++++++++++++++ 82 files changed, 308 insertions(+), 83 deletions(-) create mode 100644 marketing-api/api/advertiser/delivery_pkg_delete.go create mode 100644 marketing-api/api/v3/blueflow/keyword_list.go create mode 100644 marketing-api/api/v3/blueflow/package_list.go create mode 100644 marketing-api/model/advertiser/delivery_pkg_delete.go create mode 100644 marketing-api/model/v3/blueflow/blue_flow_package.go create mode 100644 marketing-api/model/v3/blueflow/keyword_list.go create mode 100644 marketing-api/model/v3/blueflow/package_list.go diff --git a/marketing-api/OCEANENGINE.md b/marketing-api/OCEANENGINE.md index e927c999..1852a88b 100644 --- a/marketing-api/OCEANENGINE.md +++ b/marketing-api/OCEANENGINE.md @@ -24,6 +24,7 @@ - 查询推广产品资质规则配置 [ DeliveryPkgConfig(clt *core.SDKClient, accessToken string, req *advertiser.DeliveryPkgConfigRequest) (*advertiser.IndustryConfig, error) ] - 查询推广产品资质 [ DeliveryPkgGet(clt *core.SDKClient, accessToken string, req *advertiser.DeliveryPkgGetRequest) (*advertiser.DeliveryPkg, error) ] - 提交/编辑推广产品资质 [ DeliveryPkgSubmit(clt *core.SDKClient, accessToken string, req *advertiser.DeliveryPkgSubmitRequest) (*advertiser.DeliveryPkgSubmitResult, error) ] + - 批量删除推广产品资质 [ DeliveryPkgDelete(clt *core.SDKClient, accessToken string, req *advertiser.DeliveryPkgDeleteRequest) (*advertiser.DeliveryPkgDeleteResult, error) ] - 代理商账号管理 (api/agent) - 广告主列表 [ AdvertiserSelect(clt *core.SDKClient, accessToken string, req *agent.AdvertiserSelectRequest) (*agent.AdvertiserSelectResponseData, error) ] - 修改广告主 [ AdvertiserUpdate(clt *core.SDKClient, accessToken string, req *agent.AdvertiserUpdateRequest) (*agent.AdvertiserUpdateResponseData, error) ] @@ -121,6 +122,10 @@ - 获取模板(白盒策略)列表 [ creative.StrategyList(clt *core.SDKClient, accessToken string, req *creative.StrategyListRequest) (*creative.StrategyListData, error) ] - 获取关联云图的广告主账户信息 [ v3.CdpBrandGet(clt *core.SDKClient, accessToken string, req *v3.CdpBrandGetRequest) (*v3.CdpBrandGetResult, error) ] - 批量更新广告投放时段 [ ScheduleTimeUpdate(clt *core.SDKClient, accessToken string, req *promotion.ScheduleTimeUpdateRequest) (*promotion.UpdateResponseData, error) ] + - 搜索广告投放工具 + - 获取蓝海流量包 [ blueflow.PackageList(clt *core.SDKClient, accessToken string, req *blueflow.PackageListRequest) ([]blueflow.Package, error) ] + - 获取广告下可用蓝海关键词 [ KeywordList(clt *core.SDKClient, accessToken string, req *blueflow.KeywordListRequest) ([]blueflow.Keyword, error) ] + - 获取推荐关键词 [ keyword.Suggest(clt *core.SDKClient, accessToken string, req *v3.SuggestRequest) ([]keyword.SuggestKeyword, error) ] - Dou+ 投放能力 (api/duoplus) - 查询订单列表 [ OrderList(clt *core.SDKClient, accessToken string, req *duoplus.OrderListRequest) (*duoplus.OrderListResult, error) ] - 获取订单数据报表 [ OrderReport(clt *core.SDKClient, accessToken string, req *duoplus.OrderReportRequest) (*duoplus.OrderReportResult, error) ] diff --git a/marketing-api/api/advertiser/delivery_pkg_config.go b/marketing-api/api/advertiser/delivery_pkg_config.go index 0413fbd6..3215676f 100644 --- a/marketing-api/api/advertiser/delivery_pkg_config.go +++ b/marketing-api/api/advertiser/delivery_pkg_config.go @@ -9,7 +9,7 @@ import ( // 根据商业化行业获取不同行业下对应的资质提交规则。需注意:每个行业下的资质提交规则可能会因平台及外部监管的要求而发生变化,当规则发生变更时,规则的版本号+1 func DeliveryPkgConfig(clt *core.SDKClient, accessToken string, req *advertiser.DeliveryPkgConfigRequest) (*advertiser.IndustryConfig, error) { var resp advertiser.DeliveryPkgConfigResponse - if err := clt.Get("v3.0/advertiser/delivery_pkg_config/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/advertiser/delivery_pkg_config/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.IndustryConfig, nil diff --git a/marketing-api/api/advertiser/delivery_pkg_delete.go b/marketing-api/api/advertiser/delivery_pkg_delete.go new file mode 100644 index 00000000..20cb5baf --- /dev/null +++ b/marketing-api/api/advertiser/delivery_pkg_delete.go @@ -0,0 +1,17 @@ +package advertiser + +import ( + "github.com/bububa/oceanengine/marketing-api/core" + "github.com/bububa/oceanengine/marketing-api/model/advertiser" +) + +// DeliveryPkgDelete 批量删除推广产品资质 +// 该接口支持批量删除审核拒绝的投放资质(推广产品)。 +// 删除失败的原因包括2类:① 传入了审核状态≠「审核不通过」的资质id;② 广告主账户下没有该资质。 +func DeliveryPkgDelete(clt *core.SDKClient, accessToken string, req *advertiser.DeliveryPkgDeleteRequest) (*advertiser.DeliveryPkgDeleteResult, error) { + var resp advertiser.DeliveryPkgDeleteResponse + if err := clt.PostAPI("v3.0/advertiser/delivery_pkg/delete/", req, &resp, accessToken); err != nil { + return nil, err + } + return resp.Data, nil +} diff --git a/marketing-api/api/advertiser/delivery_pkg_submit.go b/marketing-api/api/advertiser/delivery_pkg_submit.go index e1035942..f1810128 100644 --- a/marketing-api/api/advertiser/delivery_pkg_submit.go +++ b/marketing-api/api/advertiser/delivery_pkg_submit.go @@ -9,7 +9,7 @@ import ( // 用于提交以推广产品形式整组提交的投放资质,该接口可以同时用于新增和编辑。针对审核不通过的推广产品资质支持编辑提交 func DeliveryPkgSubmit(clt *core.SDKClient, accessToken string, req *advertiser.DeliveryPkgSubmitRequest) (*advertiser.DeliveryPkgSubmitResult, error) { var resp advertiser.DeliveryPkgSubmitResponse - if err := clt.Post("v3.0/advertiser/delivery_pkg/submit/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/advertiser/delivery_pkg/submit/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/advertiser/delivery_qualification_list.go b/marketing-api/api/advertiser/delivery_qualification_list.go index fefe3834..b8ad5165 100644 --- a/marketing-api/api/advertiser/delivery_qualification_list.go +++ b/marketing-api/api/advertiser/delivery_qualification_list.go @@ -9,7 +9,7 @@ import ( // 用于查询账户投放资质 func DeliveryQualificationList(clt *core.SDKClient, accessToken string, req *advertiser.DeliveryQualificationListRequest) (*advertiser.DeliveryQualificationListData, error) { var resp advertiser.DeliveryQualificationListResponse - if err := clt.Get("v3.0/advertiser/delivery_qualification/list/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/advertiser/delivery_qualification/list/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/advertiser/delivery_qualification_submit.go b/marketing-api/api/advertiser/delivery_qualification_submit.go index cb225b2e..82723f25 100644 --- a/marketing-api/api/advertiser/delivery_qualification_submit.go +++ b/marketing-api/api/advertiser/delivery_qualification_submit.go @@ -15,7 +15,7 @@ import ( // 2. 正确方式:将一份完整的资质调一次接口上传至一个资质中,保证审核平台能够一次收到完整的资质内容 func DeliveryQualificationSubmit(clt *core.SDKClient, accessToken string, req *advertiser.DeliveryQualificationSubmitRequest) ([]uint64, error) { var resp advertiser.DeliveryQualificationSubmitResponse - if err := clt.Post("v3.0/advertiser/delivery_qualification/submit/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/advertiser/delivery_qualification/submit/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.QualificationIDs, nil diff --git a/marketing-api/api/advertiser/qualification_get.go b/marketing-api/api/advertiser/qualification_get.go index e6d3e17e..4515d2ed 100644 --- a/marketing-api/api/advertiser/qualification_get.go +++ b/marketing-api/api/advertiser/qualification_get.go @@ -12,7 +12,7 @@ func QualificationGet(clt *core.SDKClient, accessToken string, advertiserID uint AdvertiserID: advertiserID, } var resp advertiser.QualificationGetResponse - if err := clt.Get("v3.0/advertiser/qualification/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/advertiser/qualification/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/advertiser/qualification_submit.go b/marketing-api/api/advertiser/qualification_submit.go index d051e396..b9de59da 100644 --- a/marketing-api/api/advertiser/qualification_submit.go +++ b/marketing-api/api/advertiser/qualification_submit.go @@ -8,5 +8,5 @@ import ( // QualificationSubmit 提交广告主资质(新版) // 提交广告主资质信息为全量接口。更新的时候需要全量先获取所有资质,然后更新相应资质。 func QualificationSubmit(clt *core.SDKClient, accessToken string, req *advertiser.QualificationSubmitRequest) error { - return clt.Post("v3.0/advertiser/qualification/submit/", req, nil, accessToken) + return clt.PostAPI("v3.0/advertiser/qualification/submit/", req, nil, accessToken) } diff --git a/marketing-api/api/agent/query_tranfser_balance.go b/marketing-api/api/agent/query_tranfser_balance.go index 9c602471..aaf75f87 100644 --- a/marketing-api/api/agent/query_tranfser_balance.go +++ b/marketing-api/api/agent/query_tranfser_balance.go @@ -9,7 +9,7 @@ import ( // 查询账户自身转账余额、作为减款方需要预留的竞价消耗保证金 func QueryTransferBalance(clt *core.SDKClient, accessToken string, req *agent.QueryTransferBalanceRequest) ([]agent.AccountAmountDetail, error) { var resp agent.QueryTransferBalanceResponse - if err := clt.Get("v3.0/cg_transfer/query_transfer_balance/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/cg_transfer/query_transfer_balance/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.AccountAmountDetailList, nil diff --git a/marketing-api/api/agent/query_transfer_detail.go b/marketing-api/api/agent/query_transfer_detail.go index 2a0a688b..da5c0df2 100644 --- a/marketing-api/api/agent/query_transfer_detail.go +++ b/marketing-api/api/agent/query_transfer_detail.go @@ -9,7 +9,7 @@ import ( // 转账单信息,包括状态、双方账户、转账金额 func QueryTransferDetail(clt *core.SDKClient, accessToken string, req *agent.QueryTransferDetailRequest) (*agent.TransferDetail, error) { var resp agent.QueryTransferDetailResponse - if err := clt.Get("v3.0/cg_transfer/query_transfer_detail/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/cg_transfer/query_transfer_detail/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/creative/detail_get.go b/marketing-api/api/creative/detail_get.go index fe7115a3..525704ef 100644 --- a/marketing-api/api/creative/detail_get.go +++ b/marketing-api/api/creative/detail_get.go @@ -8,7 +8,7 @@ import ( // DetailGet 创意详细信息(新) func DetailGet(clt *core.SDKClient, accessToken string, req *creative.DetailGetRequest) (*creative.CreativeDetailV2, error) { var resp creative.DetailGetResponse - err := clt.Get("v3.0/creative/detail/get/", req, &resp, accessToken) + err := clt.GetAPI("v3.0/creative/detail/get/", req, &resp, accessToken) if err != nil { return nil, err } diff --git a/marketing-api/api/eventmanager/share.go b/marketing-api/api/eventmanager/share.go index 6ad9c3c9..e1314459 100644 --- a/marketing-api/api/eventmanager/share.go +++ b/marketing-api/api/eventmanager/share.go @@ -8,7 +8,7 @@ import ( // Share 事件管理资产共享 func Share(clt *core.SDKClient, accessToken string, req *eventmanager.ShareRequest) ([]eventmanager.ShareError, error) { var resp eventmanager.ShareResponse - if err := clt.Post("v3.0/event_manager/share/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/event_manager/share/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.ErrorList, nil diff --git a/marketing-api/api/qianchuan/tools/allow_coupon.go b/marketing-api/api/qianchuan/tools/allow_coupon.go index a66ed9fa..f3642d3c 100644 --- a/marketing-api/api/qianchuan/tools/allow_coupon.go +++ b/marketing-api/api/qianchuan/tools/allow_coupon.go @@ -8,7 +8,7 @@ import ( // AllowCoupon 智能优惠券白名单 func AllowCoupon(clt *core.SDKClient, accessToken string, req *tools.AllowCouponRequest) (*tools.AllowCouponResult, error) { var resp tools.AllowCouponResponse - if err := clt.Get("v1.0/qianchuan/tools/allow_coupon/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v1.0/qianchuan/tools/allow_coupon/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/qianchuan/tools/aweme_auth.go b/marketing-api/api/qianchuan/tools/aweme_auth.go index 30269d77..929e3d3e 100644 --- a/marketing-api/api/qianchuan/tools/aweme_auth.go +++ b/marketing-api/api/qianchuan/tools/aweme_auth.go @@ -13,7 +13,7 @@ import ( // 注意:如果广告主未在千川PC添加过抖音号,需要先在PC完成过一次添加抖音号操作(签署《巨量千川商业合作授权协议》),否则调用接口会报错。 func AwemeAuth(clt *core.SDKClient, accessToken string, req *tools.AwemeAuthRequest) (bool, error) { var resp tools.AwemeAuthResponse - if err := clt.Post("v1.0/qianchuan/tools/aweme_auth/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v1.0/qianchuan/tools/aweme_auth/", req, &resp, accessToken); err != nil { return false, err } return resp.Data.AuthSuccess, nil diff --git a/marketing-api/api/qianchuan/tools/estimate_audience.go b/marketing-api/api/qianchuan/tools/estimate_audience.go index 9a03abe3..268a7821 100644 --- a/marketing-api/api/qianchuan/tools/estimate_audience.go +++ b/marketing-api/api/qianchuan/tools/estimate_audience.go @@ -10,7 +10,7 @@ import ( // 定向中的限制与创建计划中的限制保持一致 func EstimateAudience(clt *core.SDKClient, accessToken string, req *tools.EstimateAudienceRequest) (*tools.EstimateAudienceResult, error) { var resp tools.EstimateAudienceResponse - if err := clt.Get("v1.0/qianchuan/tools/estimate_audience/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v1.0/qianchuan/tools/estimate_audience/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/qianchuan/tools/gray_get.go b/marketing-api/api/qianchuan/tools/gray_get.go index 5a2da029..7aca0bdf 100644 --- a/marketing-api/api/qianchuan/tools/gray_get.go +++ b/marketing-api/api/qianchuan/tools/gray_get.go @@ -10,7 +10,7 @@ import ( // 支持客户通过接口查询广告主ID是否命中各项白名单功能 func GrayGet(clt *core.SDKClient, accessToken string, req *tools.GrayGetRequest) (*qianchuanTools.GrayGetResult, error) { var resp qianchuanTools.GrayGetResponse - if err := clt.Get("v3.0/qianchuan/tools/gray/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/qianchuan/tools/gray/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/qianchuan/tools/shop_auth.go b/marketing-api/api/qianchuan/tools/shop_auth.go index 19445d75..a27ad071 100644 --- a/marketing-api/api/qianchuan/tools/shop_auth.go +++ b/marketing-api/api/qianchuan/tools/shop_auth.go @@ -8,5 +8,5 @@ import ( // ShopAuth 店铺新客定向授权 // 店铺新客定向授权 func ShopAuth(clt *core.SDKClient, accessToken string, req *tools.ShopAuthRequest) error { - return clt.Post("v1.0/qianchuan/tools/shop_auth/", req, nil, accessToken) + return clt.PostAPI("v1.0/qianchuan/tools/shop_auth/", req, nil, accessToken) } diff --git a/marketing-api/api/report/asynctask/v3/create.go b/marketing-api/api/report/asynctask/v3/create.go index c1b7dd2b..b66468ef 100644 --- a/marketing-api/api/report/asynctask/v3/create.go +++ b/marketing-api/api/report/asynctask/v3/create.go @@ -10,7 +10,7 @@ import ( // 自定义报表—创建异步任务。每个开发者每天最多只能为每个用户创建 10 个任务(不包括提交失败的任务)。 func Create(clt *core.SDKClient, accessToken string, req *v3.CreateRequest) (*asynctask.Task, error) { var resp asynctask.CreateResponse - if err := clt.Post("v3.0/report/custom/async_task/create/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/report/custom/async_task/create/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/report/asynctask/v3/get.go b/marketing-api/api/report/asynctask/v3/get.go index 806fbb98..418ebfb8 100644 --- a/marketing-api/api/report/asynctask/v3/get.go +++ b/marketing-api/api/report/asynctask/v3/get.go @@ -9,7 +9,7 @@ import ( // Get 获取任务列表 func Get(clt *core.SDKClient, accessToken string, req *v3.GetRequest) (*asynctask.GetResponseData, error) { var resp asynctask.GetResponse - if err := clt.Get("v3.0/report/custom/async_task/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/report/custom/async_task/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/report/v3/material_get.go b/marketing-api/api/report/v3/material_get.go index 52c015fc..611ffcf2 100644 --- a/marketing-api/api/report/v3/material_get.go +++ b/marketing-api/api/report/v3/material_get.go @@ -8,7 +8,7 @@ import ( // MaterialGet 素材数据报表 func MaterialGet(clt *core.SDKClient, accessToken string, req *v3.MaterialGetRequest) (*v3.MaterialGetResult, error) { var resp v3.MaterialGetResponse - if err := clt.Get("v3.0/report/material/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/report/material/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/report/v3/project_get.go b/marketing-api/api/report/v3/project_get.go index 75fb5ded..cf200e09 100644 --- a/marketing-api/api/report/v3/project_get.go +++ b/marketing-api/api/report/v3/project_get.go @@ -8,7 +8,7 @@ import ( // ProjectGet 项目数据报表 func ProjectGet(clt *core.SDKClient, accessToken string, req *v3.ProjectGetRequest) (*v3.ProjectGetResult, error) { var resp v3.ProjectGetResponse - if err := clt.Get("v3.0/report/project/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/report/project/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/report/v3/promotion_get.go b/marketing-api/api/report/v3/promotion_get.go index fde21dd1..b75d18da 100644 --- a/marketing-api/api/report/v3/promotion_get.go +++ b/marketing-api/api/report/v3/promotion_get.go @@ -8,7 +8,7 @@ import ( // PromotionGet 广告数据报表 func PromotionGet(clt *core.SDKClient, accessToken string, req *v3.PromotionGetRequest) (*v3.PromotionGetResult, error) { var resp v3.PromotionGetResponse - if err := clt.Get("v3.0/report/promotion/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/report/promotion/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/subscribe/accounts_add.go b/marketing-api/api/subscribe/accounts_add.go index 2f729ecc..97a6538d 100644 --- a/marketing-api/api/subscribe/accounts_add.go +++ b/marketing-api/api/subscribe/accounts_add.go @@ -7,5 +7,5 @@ import ( // AccountsAdd 新增 Adv 订阅 func AccountsAdd(clt *core.SDKClient, accessToken string, req *subscribe.AccountsAddRequest) error { - return clt.Post("v3.0/subscribe/accounts/add/", req, nil, accessToken) + return clt.PostAPI("v3.0/subscribe/accounts/add/", req, nil, accessToken) } diff --git a/marketing-api/api/subscribe/accounts_list.go b/marketing-api/api/subscribe/accounts_list.go index f352e55c..ce868803 100644 --- a/marketing-api/api/subscribe/accounts_list.go +++ b/marketing-api/api/subscribe/accounts_list.go @@ -9,7 +9,7 @@ import ( // 查询订阅任务所订阅的 Adv func AccountsList(clt *core.SDKClient, accessToken string, req *subscribe.AccountsListRequest) (*subscribe.AccountsListResult, error) { var resp subscribe.AccountsListResponse - if err := clt.Get("v3.0/subscribe/accounts/list/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/subscribe/accounts/list/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/subscribe/accounts_remove.go b/marketing-api/api/subscribe/accounts_remove.go index 9fec68ee..b9db9372 100644 --- a/marketing-api/api/subscribe/accounts_remove.go +++ b/marketing-api/api/subscribe/accounts_remove.go @@ -7,5 +7,5 @@ import ( // AccountsRemove 删除 Adv 订阅 func AccountsRemove(clt *core.SDKClient, accessToken string, req *subscribe.AccountsRemoveRequest) error { - return clt.Post("v3.0/subscribe/accounts/remove/", req, nil, accessToken) + return clt.PostAPI("v3.0/subscribe/accounts/remove/", req, nil, accessToken) } diff --git a/marketing-api/api/tools/adraise/v3/set.go b/marketing-api/api/tools/adraise/v3/set.go index 36df4d3d..782b2186 100644 --- a/marketing-api/api/tools/adraise/v3/set.go +++ b/marketing-api/api/tools/adraise/v3/set.go @@ -2,10 +2,10 @@ package v3 import ( "github.com/bububa/oceanengine/marketing-api/core" - "github.com/bububa/oceanengine/marketing-api/model/tools/adraise/v3" + v3 "github.com/bububa/oceanengine/marketing-api/model/tools/adraise/v3" ) // Set 设置一键起量: 用来启动或关停一键起量服务 func Set(clt *core.SDKClient, accessToken string, req *v3.SetRequest) error { - return clt.Post("v3.0/tools/promotion_raise/set/", req, nil, accessToken) + return clt.PostAPI("v3.0/tools/promotion_raise/set/", req, nil, accessToken) } diff --git a/marketing-api/api/tools/adraise/v3/status_current_ids_get.go b/marketing-api/api/tools/adraise/v3/status_current_ids_get.go index b5f209a1..e3d8a9e2 100644 --- a/marketing-api/api/tools/adraise/v3/status_current_ids_get.go +++ b/marketing-api/api/tools/adraise/v3/status_current_ids_get.go @@ -9,7 +9,7 @@ import ( // 批量获取广告当前的一键起量状态 func StatusCurrentIDsGet(clt *core.SDKClient, accessToken string, req *v3.StatusCurrentIDsGetRequest) (*v3.StatusCurrentIDsGetResult, error) { var resp v3.StatusCurrentIDsGetResponse - if err := clt.Get("v3.0/tools/promotion_status_current_ids/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/promotion_status_current_ids/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/adraise/v3/status_get.go b/marketing-api/api/tools/adraise/v3/status_get.go index 639f046e..273b0932 100644 --- a/marketing-api/api/tools/adraise/v3/status_get.go +++ b/marketing-api/api/tools/adraise/v3/status_get.go @@ -2,13 +2,13 @@ package v3 import ( "github.com/bububa/oceanengine/marketing-api/core" - "github.com/bububa/oceanengine/marketing-api/model/tools/adraise/v3" + v3 "github.com/bububa/oceanengine/marketing-api/model/tools/adraise/v3" ) // StatusGet 获取一键起量方案列表 func StatusGet(clt *core.SDKClient, accessToken string, req *v3.StatusGetRequest) ([]v3.PromotionRaiseStatus, error) { var resp v3.StatusGetResponse - if err := clt.Get("v3.0/tools/promotion_raise_status/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/promotion_raise_status/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.List, nil diff --git a/marketing-api/api/tools/adraise/v3/stop.go b/marketing-api/api/tools/adraise/v3/stop.go index 6888b313..6fc46784 100644 --- a/marketing-api/api/tools/adraise/v3/stop.go +++ b/marketing-api/api/tools/adraise/v3/stop.go @@ -2,10 +2,10 @@ package v3 import ( "github.com/bububa/oceanengine/marketing-api/core" - "github.com/bububa/oceanengine/marketing-api/model/tools/adraise/v3" + v3 "github.com/bububa/oceanengine/marketing-api/model/tools/adraise/v3" ) // Stop 关停一键起量 func Stop(clt *core.SDKClient, accessToken string, req *v3.StopRequest) error { - return clt.Post("v3.0/tools/promotion_raise/stop/", req, nil, accessToken) + return clt.PostAPI("v3.0/tools/promotion_raise/stop/", req, nil, accessToken) } diff --git a/marketing-api/api/tools/adraise/v3/suggest_budget.go b/marketing-api/api/tools/adraise/v3/suggest_budget.go index 70d87ab7..82530444 100644 --- a/marketing-api/api/tools/adraise/v3/suggest_budget.go +++ b/marketing-api/api/tools/adraise/v3/suggest_budget.go @@ -2,13 +2,13 @@ package v3 import ( "github.com/bububa/oceanengine/marketing-api/core" - "github.com/bububa/oceanengine/marketing-api/model/tools/adraise/v3" + v3 "github.com/bububa/oceanengine/marketing-api/model/tools/adraise/v3" ) // SuggestBudgetGet 获取广告建议起量预算 func SuggestBudgetGet(clt *core.SDKClient, accessToken string, req *v3.SuggestBudgetGetRequest) ([]v3.SuggestBudget, error) { var resp v3.SuggestBudgetGetResponse - if err := clt.Get("v3.0/tools/suggest_budget/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/suggest_budget/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.List, nil diff --git a/marketing-api/api/tools/adraise/v3/version_get.go b/marketing-api/api/tools/adraise/v3/version_get.go index 8a94e9de..e51e896f 100644 --- a/marketing-api/api/tools/adraise/v3/version_get.go +++ b/marketing-api/api/tools/adraise/v3/version_get.go @@ -2,13 +2,13 @@ package v3 import ( "github.com/bububa/oceanengine/marketing-api/core" - "github.com/bububa/oceanengine/marketing-api/model/tools/adraise/v3" + v3 "github.com/bububa/oceanengine/marketing-api/model/tools/adraise/v3" ) // VersionGet “获取起量版本信息”用于获取计划在多次起量过程中产生的起量版本号及对应的起止时间。 func VersionGet(clt *core.SDKClient, accessToken string, req *v3.VersionGetRequest) (*v3.VersionGetResponseData, error) { var resp v3.VersionGetResponse - if err := clt.Get("v3.0/tools/promotion_raise_version/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/promotion_raise_version/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/aweme_auth_list.go b/marketing-api/api/tools/aweme_auth_list.go index a95dcbe7..0778e263 100644 --- a/marketing-api/api/tools/aweme_auth_list.go +++ b/marketing-api/api/tools/aweme_auth_list.go @@ -9,7 +9,7 @@ import ( // 可以获取账户下抖音号授权关系以及授权视频 func AwemeAuthList(clt *core.SDKClient, accessToken string, req *tools.AwemeAuthListRequest) (*tools.AwemeAuthListData, error) { var resp tools.AwemeAuthListResponse - if err := clt.Get("2/tools/aweme_auth_list/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("2/tools/aweme_auth_list/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/comment/aweme_banned_create.go b/marketing-api/api/tools/comment/aweme_banned_create.go index 65f0cb7c..45cf2785 100644 --- a/marketing-api/api/tools/comment/aweme_banned_create.go +++ b/marketing-api/api/tools/comment/aweme_banned_create.go @@ -9,7 +9,7 @@ import ( // 添加屏蔽用户接口用于添加屏蔽抖音用户,抖音用户屏蔽需要广告主绑定抖音账号,每个绑定的抖音账号最多屏蔽5000个抖音id与5000个昵称关键词,广告主当前可添加屏蔽的抖音id和昵称关键词以绑定的抖音账号中已屏蔽最多的抖音账号为准。 func AwemeBannedCreate(clt *core.SDKClient, accessToken string, req *comment.AwemeBannedCreateRequest) (*comment.AwemeBannedCreateResponseData, error) { var resp comment.AwemeBannedCreateResponse - if err := clt.Post("v3.0/tools/aweme_banned/create/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/tools/aweme_banned/create/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/comment/aweme_banned_delete.go b/marketing-api/api/tools/comment/aweme_banned_delete.go index 4616ee50..7de109c8 100644 --- a/marketing-api/api/tools/comment/aweme_banned_delete.go +++ b/marketing-api/api/tools/comment/aweme_banned_delete.go @@ -9,7 +9,7 @@ import ( // 删除屏蔽用户接口用于删除已屏蔽的抖音用户,抖音用户屏蔽需要广告主绑定抖音账号。 func AwemeBannedDelete(clt *core.SDKClient, accessToken string, req *comment.AwemeBannedCreateRequest) (*comment.AwemeBannedCreateResponseData, error) { var resp comment.AwemeBannedCreateResponse - err := clt.Post("v3.0/tools/aweme_banned/delete/", req, &resp, accessToken) + err := clt.PostAPI("v3.0/tools/aweme_banned/delete/", req, &resp, accessToken) if err != nil { return nil, err } diff --git a/marketing-api/api/tools/comment/aweme_banned_list.go b/marketing-api/api/tools/comment/aweme_banned_list.go index b8b83e2f..d4c41f57 100644 --- a/marketing-api/api/tools/comment/aweme_banned_list.go +++ b/marketing-api/api/tools/comment/aweme_banned_list.go @@ -9,7 +9,7 @@ import ( // 获取屏蔽用户列表用于获取广告主绑定的抖音账号(第一个绑定的抖音账号)屏蔽的抖音id列表或昵称关键词列表。 func AwemeBannedList(clt *core.SDKClient, accessToken string, req *comment.AwemeBannedListRequest) (*comment.AwemeBannedListResponseData, error) { var resp comment.AwemeBannedListResponse - if err := clt.Get("v3.0/tools/aweme_banned/list/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/aweme_banned/list/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/comment/get.go b/marketing-api/api/tools/comment/get.go index af3585cd..b1d4f035 100644 --- a/marketing-api/api/tools/comment/get.go +++ b/marketing-api/api/tools/comment/get.go @@ -8,7 +8,7 @@ import ( // Get 获取评论列表 func Get(clt *core.SDKClient, accessToken string, req *comment.GetRequest) (*comment.GetResponseData, error) { var resp comment.GetResponse - if err := clt.Get("v3.0/tools/comment/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/comment/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/comment/hide.go b/marketing-api/api/tools/comment/hide.go index 3811286c..f8efa803 100644 --- a/marketing-api/api/tools/comment/hide.go +++ b/marketing-api/api/tools/comment/hide.go @@ -8,7 +8,7 @@ import ( // Hide 隐藏评论 func Hide(clt *core.SDKClient, accessToken string, req *comment.OperateRequest) ([]uint64, error) { var resp comment.OperateResponse - if err := clt.Post("v3.0/tools/comment/hide/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/tools/comment/hide/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.SuccessCommentIDs, nil diff --git a/marketing-api/api/tools/comment/metrics_get.go b/marketing-api/api/tools/comment/metrics_get.go index 4c2ec5b1..9a712045 100644 --- a/marketing-api/api/tools/comment/metrics_get.go +++ b/marketing-api/api/tools/comment/metrics_get.go @@ -9,7 +9,7 @@ import ( // 获取广告账户下评论的「可见评论数」、「可见负评数」、「可见评论负评率」 func MetricsGet(clt *core.SDKClient, accessToken string, req *comment.MetricsGetRequest) (*comment.MetricsGetResult, error) { var resp comment.MetricsGetResponse - if err := clt.Get("v3.0/tools/comment_metrics/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/comment_metrics/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/comment/mid2item_id.go b/marketing-api/api/tools/comment/mid2item_id.go index 736d814b..be812810 100644 --- a/marketing-api/api/tools/comment/mid2item_id.go +++ b/marketing-api/api/tools/comment/mid2item_id.go @@ -10,7 +10,7 @@ import ( // 该接口仅适用于评论管理,仅返回有评论内容的对应抖音视频。若相关素材id的关联item_id均无评论,则返回为空 func Mid2ItemID(clt *core.SDKClient, accessToken string, req *comment.Mid2ItemIDRequest) (*comment.Mid2ItemIDList, error) { var resp comment.Mid2ItemIDResponse - if err := clt.Get("v3.0/tools/comment/mid2item_id/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/comment/mid2item_id/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/comment/reply.go b/marketing-api/api/tools/comment/reply.go index 84b4ac2c..7e4eb244 100644 --- a/marketing-api/api/tools/comment/reply.go +++ b/marketing-api/api/tools/comment/reply.go @@ -8,7 +8,7 @@ import ( // Reply 回复评论 func Reply(clt *core.SDKClient, accessToken string, req *comment.OperateRequest) ([]uint64, error) { var resp comment.OperateResponse - if err := clt.Post("v3.0/tools/comment/reply/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/tools/comment/reply/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.SuccessCommentIDs, nil diff --git a/marketing-api/api/tools/comment/reply_get.go b/marketing-api/api/tools/comment/reply_get.go index b48633df..f566216a 100644 --- a/marketing-api/api/tools/comment/reply_get.go +++ b/marketing-api/api/tools/comment/reply_get.go @@ -9,7 +9,7 @@ import ( // 获取评论回复(用于获取二级评论) func ReplyGet(clt *core.SDKClient, accessToken string, req *comment.ReplyGetRequest) (*comment.ReplyGetResponseData, error) { var resp comment.ReplyGetResponse - if err := clt.Get("v3.0/tools/comment_reply/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/comment_reply/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/comment/stick_on_top.go b/marketing-api/api/tools/comment/stick_on_top.go index 5f7ed621..49b14b76 100644 --- a/marketing-api/api/tools/comment/stick_on_top.go +++ b/marketing-api/api/tools/comment/stick_on_top.go @@ -7,5 +7,5 @@ import ( // StickOnTop 置顶评论 func StickOnTop(clt *core.SDKClient, accessToken string, req *comment.StickOnTopRequest) error { - return clt.Post("v3.0/tools/comment/stick_on_top/", req, nil, accessToken) + return clt.PostAPI("v3.0/tools/comment/stick_on_top/", req, nil, accessToken) } diff --git a/marketing-api/api/tools/comment/terms_banned_add.go b/marketing-api/api/tools/comment/terms_banned_add.go index d11a65df..6cc6cfc9 100644 --- a/marketing-api/api/tools/comment/terms_banned_add.go +++ b/marketing-api/api/tools/comment/terms_banned_add.go @@ -8,5 +8,5 @@ import ( // TermsBannedAdd 添加屏蔽词 // 本接口用于添加评论屏蔽词。该屏蔽词针对该广告主下的所有评论生效,命中屏蔽词的抖音评论将直接隐藏,不对外进行展示。屏蔽词管理模块目前只针对“抖音”广告位生效。屏蔽词数量最多500个。 func TermsBannedAdd(clt *core.SDKClient, accessToken string, req *comment.TermsBannedAddRequest) error { - return clt.Post("v3.0/tools/comment/terms_banned/add/", req, nil, accessToken) + return clt.PostAPI("v3.0/tools/comment/terms_banned/add/", req, nil, accessToken) } diff --git a/marketing-api/api/tools/comment/terms_banned_delete.go b/marketing-api/api/tools/comment/terms_banned_delete.go index 46300db2..5f07c962 100644 --- a/marketing-api/api/tools/comment/terms_banned_delete.go +++ b/marketing-api/api/tools/comment/terms_banned_delete.go @@ -8,5 +8,5 @@ import ( // TermsBannedDelete 删除屏蔽词 // 本接口用于删除评论屏蔽词。屏蔽词会针对该广告主下的所有评论生效,命中屏蔽词的抖音评论将直接隐藏,不对外进行展示,删除后后续评论可正常展示。屏蔽词管理模块目前只针对“抖音”广告位生效。屏蔽词数量最多500个。 func TermsBannedDelete(clt *core.SDKClient, accessToken string, req *comment.TermsBannedDeleteRequest) error { - return clt.Post("v3.0/tools/comment/terms_banned/delete/", req, nil, accessToken) + return clt.PostAPI("v3.0/tools/comment/terms_banned/delete/", req, nil, accessToken) } diff --git a/marketing-api/api/tools/comment/terms_banned_get.go b/marketing-api/api/tools/comment/terms_banned_get.go index 2d3b53c0..a41cbfa8 100644 --- a/marketing-api/api/tools/comment/terms_banned_get.go +++ b/marketing-api/api/tools/comment/terms_banned_get.go @@ -9,7 +9,7 @@ import ( // 本接口用于获取广告主下的屏蔽词列表。该屏蔽词针对该广告主下的所有评论生效,命中屏蔽词的抖音评论将直接隐藏,不对外进行展示。屏蔽词管理模块目前只针对“抖音”广告位生效。屏蔽词数量最多500个。 func TermsBannedGet(clt *core.SDKClient, accessToken string, req *comment.TermsBannedGetRequest) (*comment.TermsBannedGetResponseData, error) { var resp comment.TermsBannedGetResponse - if err := clt.Get("v3.0/tools/comment/terms_banned/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/comment/terms_banned/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/comment/terms_banned_update.go b/marketing-api/api/tools/comment/terms_banned_update.go index 51412cab..5924fcac 100644 --- a/marketing-api/api/tools/comment/terms_banned_update.go +++ b/marketing-api/api/tools/comment/terms_banned_update.go @@ -9,5 +9,5 @@ import ( // 本接口用于对单一评论屏蔽词进行更新,可以选择指定的屏蔽词进行更新,效果等同于删除老屏蔽词后再添加新屏蔽词。该屏蔽词针对该广告主下的所有评论生效,命中屏蔽词的抖音评论将直接隐藏,不对外进行展示。屏蔽词管理模块目前只针对“抖音”广告位生效。屏蔽词数量最多500个。 // 如果new_terms已存在,则等同于删除origin_terms;如果origin_terms不存在,则等同于新增new_terms func TermsBannedUpdate(clt *core.SDKClient, accessToken string, req *comment.TermsBannedUpdateRequest) error { - return clt.Post("v3.0/tools/comment/terms_banned/update/", req, nil, accessToken) + return clt.PostAPI("v3.0/tools/comment/terms_banned/update/", req, nil, accessToken) } diff --git a/marketing-api/api/tools/gray_get.go b/marketing-api/api/tools/gray_get.go index c1e01736..95b6ebe2 100644 --- a/marketing-api/api/tools/gray_get.go +++ b/marketing-api/api/tools/gray_get.go @@ -9,7 +9,7 @@ import ( // 支持客户通过接口查询广告主ID是否命中各项白名单功能 func GrayGet(clt *core.SDKClient, accessToken string, req *tools.GrayGetRequest) ([]tools.GrayItem, error) { var resp tools.GrayGetResponse - if err := clt.Get("v3.0/tools/gray/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/gray/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.List, nil diff --git a/marketing-api/api/tools/keywordsbidratio/create.go b/marketing-api/api/tools/keywordsbidratio/create.go index 5faa14f1..3ce9471a 100644 --- a/marketing-api/api/tools/keywordsbidratio/create.go +++ b/marketing-api/api/tools/keywordsbidratio/create.go @@ -7,5 +7,5 @@ import ( // Create 设置优词提量系数和生效维度 func Create(clt *core.SDKClient, accessToken string, req *keywordsbidratio.CreateRequest) error { - return clt.Post("v3.0/tools/keywords_bid_ratio/create/", req, nil, accessToken) + return clt.PostAPI("v3.0/tools/keywords_bid_ratio/create/", req, nil, accessToken) } diff --git a/marketing-api/api/tools/keywordsbidratio/delete.go b/marketing-api/api/tools/keywordsbidratio/delete.go index 0734e722..d0cafa33 100644 --- a/marketing-api/api/tools/keywordsbidratio/delete.go +++ b/marketing-api/api/tools/keywordsbidratio/delete.go @@ -7,5 +7,5 @@ import ( // Delete 删除优词提量系数和生效维度 func Delete(clt *core.SDKClient, accessToken string, req *keywordsbidratio.DeleteRequest) error { - return clt.Post("v3.0/tools/keywords_bid_ratio/delete/", req, nil, accessToken) + return clt.PostAPI("v3.0/tools/keywords_bid_ratio/delete/", req, nil, accessToken) } diff --git a/marketing-api/api/tools/keywordsbidratio/get.go b/marketing-api/api/tools/keywordsbidratio/get.go index 320c983c..5be18bb6 100644 --- a/marketing-api/api/tools/keywordsbidratio/get.go +++ b/marketing-api/api/tools/keywordsbidratio/get.go @@ -8,7 +8,7 @@ import ( // Get 查询优词提量系数信息 func Get(clt *core.SDKClient, accessToken string, req *keywordsbidratio.GetRequest) ([]keywordsbidratio.Keyword, error) { var resp keywordsbidratio.GetResponse - if err := clt.Get("v3.0/tools/keywords_bid_ratio/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/keywords_bid_ratio/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.List, nil diff --git a/marketing-api/api/tools/keywordsbidratio/project_info_get.go b/marketing-api/api/tools/keywordsbidratio/project_info_get.go index b3e3bac3..185f5dbd 100644 --- a/marketing-api/api/tools/keywordsbidratio/project_info_get.go +++ b/marketing-api/api/tools/keywordsbidratio/project_info_get.go @@ -8,7 +8,7 @@ import ( // ProjectInfoGet 查询优词绑定的项目信息 func ProjectInfoGet(clt *core.SDKClient, accessToken string, req *keywordsbidratio.ProjectInfoGetRequest) (*keywordsbidratio.ProjectInfo, error) { var resp keywordsbidratio.ProjectInfoGetResponse - if err := clt.Get("v3.0/tools/keywords_project_info/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/keywords_project_info/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.ProjectInfo, nil diff --git a/marketing-api/api/tools/keywordsbidratio/update.go b/marketing-api/api/tools/keywordsbidratio/update.go index 0e56bd56..f7a86817 100644 --- a/marketing-api/api/tools/keywordsbidratio/update.go +++ b/marketing-api/api/tools/keywordsbidratio/update.go @@ -7,5 +7,5 @@ import ( // Update 更新优词提量系数和生效维度 func Update(clt *core.SDKClient, accessToken string, req *keywordsbidratio.UpdateRequest) error { - return clt.Post("v3.0/tools/keywords_bid_ratio/update/", req, nil, accessToken) + return clt.PostAPI("v3.0/tools/keywords_bid_ratio/update/", req, nil, accessToken) } diff --git a/marketing-api/api/tools/micro_app_list.go b/marketing-api/api/tools/micro_app_list.go index 9be50a9d..d2d30045 100644 --- a/marketing-api/api/tools/micro_app_list.go +++ b/marketing-api/api/tools/micro_app_list.go @@ -9,7 +9,7 @@ import ( // 获取巨量工作台上字节小程序资产列表 func MicroAppList(clt *core.SDKClient, accessToken string, req *tools.MicroAppListRequest) (*tools.MicroAppListResult, error) { var resp tools.MicroAppListResponse - if err := clt.Get("v3.0/tools/micro_app/list/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/micro_app/list/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/micro_game_list.go b/marketing-api/api/tools/micro_game_list.go index 14894b09..05aedd4b 100644 --- a/marketing-api/api/tools/micro_game_list.go +++ b/marketing-api/api/tools/micro_game_list.go @@ -9,7 +9,7 @@ import ( // 获取字节小游戏列表,对应在巨量工作台上的字节小游戏资产 func MicroGameList(clt *core.SDKClient, accessToken string, req *tools.MicroAppListRequest) (*tools.MicroAppListResult, error) { var resp tools.MicroAppListResponse - if err := clt.Get("v3.0/tools/micro_game/list/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/micro_game/list/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/nativeanchor/create.go b/marketing-api/api/tools/nativeanchor/create.go index e2de0700..d7a9cbab 100644 --- a/marketing-api/api/tools/nativeanchor/create.go +++ b/marketing-api/api/tools/nativeanchor/create.go @@ -8,7 +8,7 @@ import ( // Create 原生锚点创建 func Create(clt *core.SDKClient, accessToken string, req *nativeanchor.CreateRequest) (*nativeanchor.CreateResponseData, error) { var resp nativeanchor.CreateResponse - if err := clt.Post("v3.0/native_anchor/create/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/native_anchor/create/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/nativeanchor/delete.go b/marketing-api/api/tools/nativeanchor/delete.go index 5ce89ce4..9d9079e6 100644 --- a/marketing-api/api/tools/nativeanchor/delete.go +++ b/marketing-api/api/tools/nativeanchor/delete.go @@ -7,5 +7,5 @@ import ( // Delete 删除原生锚点 func Delete(clt *core.SDKClient, accessToken string, req *nativeanchor.DeleteRequest) error { - return clt.Post("v3.0/native_anchor/delete/", req, nil, accessToken) + return clt.PostAPI("v3.0/native_anchor/delete/", req, nil, accessToken) } diff --git a/marketing-api/api/tools/nativeanchor/get.go b/marketing-api/api/tools/nativeanchor/get.go index 05781915..bad9f45d 100644 --- a/marketing-api/api/tools/nativeanchor/get.go +++ b/marketing-api/api/tools/nativeanchor/get.go @@ -8,7 +8,7 @@ import ( // Get 获取账户下原生锚点 func Get(clt *core.SDKClient, accessToken string, req *nativeanchor.GetRequest) (*nativeanchor.GetResponseData, error) { var resp nativeanchor.GetResponse - if err := clt.Get("v3.0/native_anchor/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/native_anchor/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/nativeanchor/get_detail.go b/marketing-api/api/tools/nativeanchor/get_detail.go index e2d6eb5f..21a6a8aa 100644 --- a/marketing-api/api/tools/nativeanchor/get_detail.go +++ b/marketing-api/api/tools/nativeanchor/get_detail.go @@ -10,7 +10,7 @@ import ( // 暂不支持获取「高级在线预约」、「字节小程序」锚点详情 func GetDetail(clt *core.SDKClient, accessToken string, req *nativeanchor.GetDetailRequest) (*nativeanchor.GetDetailResult, error) { var resp nativeanchor.GetDetailResponse - if err := clt.Get("v3.0/native_anchor/get/detail/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/native_anchor/get/detail/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/nativeanchor/qrcode_preview_get.go b/marketing-api/api/tools/nativeanchor/qrcode_preview_get.go index 618204ee..0061603b 100644 --- a/marketing-api/api/tools/nativeanchor/qrcode_preview_get.go +++ b/marketing-api/api/tools/nativeanchor/qrcode_preview_get.go @@ -11,7 +11,7 @@ import ( // 只有当锚点关联广告时,才可查询到预览url func QrcodePreviewGet(clt *core.SDKClient, accessToken string, req *nativeanchor.QrcodePreviewGetRequest) (*nativeanchor.QrcodePreviewGetResult, error) { var resp nativeanchor.QrcodePreviewGetResponse - if err := clt.Get("v3.0/native_anchor/qrcode_preview/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/native_anchor/qrcode_preview/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/nativeanchor/update.go b/marketing-api/api/tools/nativeanchor/update.go index 0cd7b33d..ce9b5ee7 100644 --- a/marketing-api/api/tools/nativeanchor/update.go +++ b/marketing-api/api/tools/nativeanchor/update.go @@ -8,7 +8,7 @@ import ( // Update 更新原生锚点 func Update(clt *core.SDKClient, accessToken string, req *nativeanchor.UpdateRequest) (*nativeanchor.UpdateResponseData, error) { var resp nativeanchor.UpdateResponse - if err := clt.Post("v3.0/native_anchor/update/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/native_anchor/update/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/rta/rta_exp_local_daily.go b/marketing-api/api/tools/rta/rta_exp_local_daily.go index 9bd81fd3..53bc8574 100644 --- a/marketing-api/api/tools/rta/rta_exp_local_daily.go +++ b/marketing-api/api/tools/rta/rta_exp_local_daily.go @@ -11,7 +11,7 @@ import ( // 注:由于数据更新时间存在波动性,建议在查询当日上午7点后尝试拉取前一天的数据 func RtaExpLocalDailyGet(clt *core.SDKClient, accessToken string, req *rta.RtaExpLocalDailyGetRequest) ([]rta.Report, error) { var resp rta.RtaExpLocalDailyGetResponse - if err := clt.Get("v3.0/report/rta_exp_local_daily/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/report/rta_exp_local_daily/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.Data, nil diff --git a/marketing-api/api/tools/rta/rta_exp_local_hourly.go b/marketing-api/api/tools/rta/rta_exp_local_hourly.go index 250e3063..ceb8bc66 100644 --- a/marketing-api/api/tools/rta/rta_exp_local_hourly.go +++ b/marketing-api/api/tools/rta/rta_exp_local_hourly.go @@ -10,7 +10,7 @@ import ( // 该接口用于查询站内媒体渠道的RTA联合实验数据,支持分时t+5级别数据 func RtaExpLocalHourlyGet(clt *core.SDKClient, accessToken string, req *rta.RtaExpLocalHourlyGetRequest) ([]rta.Report, error) { var resp rta.RtaExpLocalHourlyGetResponse - if err := clt.Get("v3.0/report/rta_exp_local_hourly/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/report/rta_exp_local_hourly/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.Data, nil diff --git a/marketing-api/api/tools/search_bid_ratio_get.go b/marketing-api/api/tools/search_bid_ratio_get.go index bb97dcb5..2c2e2cff 100644 --- a/marketing-api/api/tools/search_bid_ratio_get.go +++ b/marketing-api/api/tools/search_bid_ratio_get.go @@ -8,7 +8,7 @@ import ( // SearchBidRatioGet 获取快投推荐出价系数 func SearchBidRatioGet(clt *core.SDKClient, accessToken string, req *tools.SearchBidRatioGetRequest) (float64, error) { var resp tools.SearchBidRatioGetResponse - if err := clt.Get("2/tools/search_bid_ratio/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("2/tools/search_bid_ratio/get/", req, &resp, accessToken); err != nil { return 0, err } return resp.Data.Ratio, nil diff --git a/marketing-api/api/tools/union/flow_package_promotion_report.go b/marketing-api/api/tools/union/flow_package_promotion_report.go index d00a2284..165b17a3 100644 --- a/marketing-api/api/tools/union/flow_package_promotion_report.go +++ b/marketing-api/api/tools/union/flow_package_promotion_report.go @@ -9,7 +9,7 @@ import ( // 查看穿山甲2.0广告位数据 func FlowPackagePromotionReport(clt *core.SDKClient, accessToken string, req *union.FlowPackagePromotionReportRequest) (*union.FlowPackageReportData, error) { var resp union.FlowPackageReportResponse - if err := clt.Get("v3.0/tools/union/flow_package/promotion/report/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/union/flow_package/promotion/report/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/v3/bid_suggest.go b/marketing-api/api/tools/v3/bid_suggest.go index 30a7645f..d888233b 100644 --- a/marketing-api/api/tools/v3/bid_suggest.go +++ b/marketing-api/api/tools/v3/bid_suggest.go @@ -10,7 +10,7 @@ import ( // 通过广告分析查询广告的建议出价,目前仅支持手动投放的广告查询建议出价 func BidSuggest(clt *core.SDKClient, accessToken string, req *v3.BidSuggestRequest) (*tools.BidSuggest, error) { var resp v3.BidSuggestResponse - if err := clt.Get("v3.0/tools/bids/suggest/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/bids/suggest/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.Data, nil diff --git a/marketing-api/api/tools/wechat/applet_create.go b/marketing-api/api/tools/wechat/applet_create.go index 85f9fe70..a3985936 100644 --- a/marketing-api/api/tools/wechat/applet_create.go +++ b/marketing-api/api/tools/wechat/applet_create.go @@ -8,7 +8,7 @@ import ( // AppletCreate 创建微信小程序 func AppletCreate(clt *core.SDKClient, accessToken string, req *wechat.AppletCreateRequest) (uint64, error) { var resp wechat.AppletCreateResponse - if err := clt.Post("v3.0/tools/wechat_applet/create/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/tools/wechat_applet/create/", req, &resp, accessToken); err != nil { return 0, err } return resp.Data.Data.InstanceID, nil diff --git a/marketing-api/api/tools/wechat/applet_list.go b/marketing-api/api/tools/wechat/applet_list.go index 05cc25ac..b1633789 100644 --- a/marketing-api/api/tools/wechat/applet_list.go +++ b/marketing-api/api/tools/wechat/applet_list.go @@ -8,7 +8,7 @@ import ( // AppletList 获取微信小程序列表 func AppletList(clt *core.SDKClient, accessToken string, req *wechat.AppletListRequest) (*wechat.AppletListResult, error) { var resp wechat.AppletListResponse - if err := clt.Get("v3.0/tools/wechat_applet/list/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/wechat_applet/list/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/wechat/applet_update.go b/marketing-api/api/tools/wechat/applet_update.go index 045eceaf..6073c626 100644 --- a/marketing-api/api/tools/wechat/applet_update.go +++ b/marketing-api/api/tools/wechat/applet_update.go @@ -8,7 +8,7 @@ import ( // AppletUpdate 更新微信小程序 func AppletUpdate(clt *core.SDKClient, accessToken string, req *wechat.AppletUpdateRequest) (*wechat.AppletUpdateResult, error) { var resp wechat.AppletUpdateResponse - if err := clt.Post("v3.0/tools/wechat_applet/update/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/tools/wechat_applet/update/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.Data, nil diff --git a/marketing-api/api/tools/wechat/bp_asset_management_share.go b/marketing-api/api/tools/wechat/bp_asset_management_share.go index 1caac6cb..f2e65002 100644 --- a/marketing-api/api/tools/wechat/bp_asset_management_share.go +++ b/marketing-api/api/tools/wechat/bp_asset_management_share.go @@ -10,7 +10,7 @@ import ( // 通过该接口,将微信小游戏/小程序资产共享给指定账户 func BpAssetManagementShare(clt *core.SDKClient, accessToken string, req *wechat.BpAssetManagementShareRequest) ([]wechat.BpAssetManagementShareError, error) { var resp wechat.BpAssetManagementShareResponse - if err := clt.Post("v3.0/tools/bp_asset_management/share/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/tools/bp_asset_management/share/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.ErrorList, nil diff --git a/marketing-api/api/tools/wechat/bp_asset_management_share_cancel.go b/marketing-api/api/tools/wechat/bp_asset_management_share_cancel.go index a9cff7e7..79f1a28f 100644 --- a/marketing-api/api/tools/wechat/bp_asset_management_share_cancel.go +++ b/marketing-api/api/tools/wechat/bp_asset_management_share_cancel.go @@ -8,7 +8,7 @@ import ( // BpAssetManagementShareCancel 取消微信小游戏/小程序共享关系 func BpAssetManagementShareCancel(clt *core.SDKClient, accessToken string, req *wechat.BpAssetManagementShareRequest) ([]wechat.BpAssetManagementShareError, error) { var resp wechat.BpAssetManagementShareResponse - if err := clt.Post("v3.0/tools/bp_asset_management/share/cancel", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/tools/bp_asset_management/share/cancel", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.ErrorList, nil diff --git a/marketing-api/api/tools/wechat/bp_asset_management_share_get.go b/marketing-api/api/tools/wechat/bp_asset_management_share_get.go index a369bb87..a0eb1275 100644 --- a/marketing-api/api/tools/wechat/bp_asset_management_share_get.go +++ b/marketing-api/api/tools/wechat/bp_asset_management_share_get.go @@ -8,7 +8,7 @@ import ( // BpAssetManagementShareGet 查看微信小游戏/小程序共享范围 func BpAssetManagementShareGet(clt *core.SDKClient, accessToken string, req *wechat.BpAssetManagementShareGetRequest) (*wechat.BpAssetManagementShareList, error) { var resp wechat.BpAssetManagementShareGetResponse - if err := clt.Get("v3.0/tools/bp_asset_management/share/get/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/bp_asset_management/share/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/tools/wechat/game_create.go b/marketing-api/api/tools/wechat/game_create.go index 4075040e..6e0d62b6 100644 --- a/marketing-api/api/tools/wechat/game_create.go +++ b/marketing-api/api/tools/wechat/game_create.go @@ -8,7 +8,7 @@ import ( // GameCreate 创建微信小游戏 func GameCreate(clt *core.SDKClient, accessToken string, req *wechat.GameCreateRequest) (*wechat.WechatGame, error) { var resp wechat.GameCreateResponse - if err := clt.Post("v3.0/tools/wechat_game/create/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/tools/wechat_game/create/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data.Data, nil diff --git a/marketing-api/api/tools/wechat/game_list.go b/marketing-api/api/tools/wechat/game_list.go index a112bc5c..7f47f2aa 100644 --- a/marketing-api/api/tools/wechat/game_list.go +++ b/marketing-api/api/tools/wechat/game_list.go @@ -8,7 +8,7 @@ import ( // GameList 获取微信小游戏列表 func GameList(clt *core.SDKClient, accessToken string, req *wechat.GameListRequest) (*wechat.GameListResult, error) { var resp wechat.GameListResponse - if err := clt.Get("v3.0/tools/wechat_game/list/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/tools/wechat_game/list/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/v3/blueflow/keyword_list.go b/marketing-api/api/v3/blueflow/keyword_list.go new file mode 100644 index 00000000..52a65aee --- /dev/null +++ b/marketing-api/api/v3/blueflow/keyword_list.go @@ -0,0 +1,15 @@ +package blueflow + +import ( + "github.com/bububa/oceanengine/marketing-api/core" + "github.com/bububa/oceanengine/marketing-api/model/v3/blueflow" +) + +// KeywordList 获取广告下可用蓝海关键词 +func KeywordList(clt *core.SDKClient, accessToken string, req *blueflow.KeywordListRequest) ([]blueflow.Keyword, error) { + var resp blueflow.KeywordListResponse + if err := clt.GetAPI("v3.0/blue_flow_keyword/list/", req, &resp, accessToken); err != nil { + return nil, err + } + return resp.Data.List, nil +} diff --git a/marketing-api/api/v3/blueflow/package_list.go b/marketing-api/api/v3/blueflow/package_list.go new file mode 100644 index 00000000..18986f30 --- /dev/null +++ b/marketing-api/api/v3/blueflow/package_list.go @@ -0,0 +1,17 @@ +package blueflow + +import ( + "github.com/bububa/oceanengine/marketing-api/core" + "github.com/bububa/oceanengine/marketing-api/model/v3/blueflow" +) + +// PackageList 获取蓝海流量包 +// 本接口支持查询搜索蓝海项目可用的蓝海流量包ID +// 您需要先通过本接口查询blue_flow_package_id,再前往「创建项目」接口创建搜索蓝海项目 +func PackageList(clt *core.SDKClient, accessToken string, req *blueflow.PackageListRequest) ([]blueflow.Package, error) { + var resp blueflow.PackageListResponse + if err := clt.GetAPI("v3.0/blue_flow_package/list/", req, &resp, accessToken); err != nil { + return nil, err + } + return resp.Data.BlueFlowPackages, nil +} diff --git a/marketing-api/api/v3/promotion/auto_generate_config_create.go b/marketing-api/api/v3/promotion/auto_generate_config_create.go index 4efc20ee..7b00fa79 100644 --- a/marketing-api/api/v3/promotion/auto_generate_config_create.go +++ b/marketing-api/api/v3/promotion/auto_generate_config_create.go @@ -9,7 +9,7 @@ import ( // 用来保存广告主自定义的策略及物料,用于创意智能生成。创建时promotion_id选填,更新时promotion_id必填,多次更新返回的configid不变 func AutoGenerateConfigCreate(clt *core.SDKClient, accessToken string, req *promotion.AutoGenerateConfigCreateRequest) (uint64, error) { var resp promotion.AutoGenerateConfigCreateResponse - if err := clt.Post("v3.0/promotion/auto_generate_config/create/", req, &resp, accessToken); err != nil { + if err := clt.PostAPI("v3.0/promotion/auto_generate_config/create/", req, &resp, accessToken); err != nil { return 0, err } return resp.Data.ConfigID, nil diff --git a/marketing-api/api/v3/promotion/auto_generate_config_get.go b/marketing-api/api/v3/promotion/auto_generate_config_get.go index faaab2f0..afa1d623 100644 --- a/marketing-api/api/v3/promotion/auto_generate_config_get.go +++ b/marketing-api/api/v3/promotion/auto_generate_config_get.go @@ -8,7 +8,7 @@ import ( // AutoGenerateConfigGet 查询配置详情 func AutoGenerateConfigGet(clt *core.SDKClient, accessToken string, req *promotion.AutoGenerateConfigGetRequest) (*promotion.AutoGenerateConfig, error) { var resp promotion.AutoGenerateConfigGetResponse - if err := clt.Get("v3.0/promotion/auto_generate_config/create/", req, &resp, accessToken); err != nil { + if err := clt.GetAPI("v3.0/promotion/auto_generate_config/create/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/model/advertiser/delivery_pkg_delete.go b/marketing-api/model/advertiser/delivery_pkg_delete.go new file mode 100644 index 00000000..925f0105 --- /dev/null +++ b/marketing-api/model/advertiser/delivery_pkg_delete.go @@ -0,0 +1,45 @@ +package advertiser + +import ( + "strconv" + + "github.com/bububa/oceanengine/marketing-api/model" + "github.com/bububa/oceanengine/marketing-api/util" +) + +// DeliveryPkgDeleteRequest 批量删除推广产品资质 API Request +type DeliveryPkgDeleteRequest struct { + // PkgIDs 推广产品pkg_id列表,支持传入多个批量删除,list长度1~50 + PkgIDs []uint64 `json:"pkg_ids,omitempty"` + // AdvertiserID 广告主ID + AdvertiserID uint64 `json:"advertiser_id,omitempty"` +} + +// Encode implements PostRequest interface +func (r DeliveryPkgDeleteRequest) Encode() []byte { + return util.JSONMarshal(r) +} + +type DeliveryPkgDeleteResponse struct { + Data *DeliveryPkgDeleteResult `json:"data,omitempty"` + model.BaseResponse +} + +type DeliveryPkgDeleteResult struct { + // PkgIDs 删除成功的推广产品id + PkgIDs []uint64 `json:"pkg_ids,omitempty"` + // Errors 删除失败的行业产品列表 +} + +// DeliveryPkgDeleteError 删除失败的行业产品 +type DeliveryPkgDeleteError struct { + // ErrorMessage 错误信息 + ErrorMessage string `json:"error_message,omitempty"` + // PkgID 行业产品id + PkgID uint64 `json:"pkg_id,omitempty"` +} + +// Error implements error interface +func (e DeliveryPkgDeleteError) Error() string { + return util.StringsJoin(e.ErrorMessage, "(", strconv.FormatUint(e.PkgID, 10), ")") +} diff --git a/marketing-api/model/advertiser/delivery_pkg_submit.go b/marketing-api/model/advertiser/delivery_pkg_submit.go index 53660eff..cb9437f2 100644 --- a/marketing-api/model/advertiser/delivery_pkg_submit.go +++ b/marketing-api/model/advertiser/delivery_pkg_submit.go @@ -7,10 +7,10 @@ import ( // DeliveryPkgSubmitRequest 提交推广产品资质 API Request type DeliveryPkgSubmitRequest struct { - // AdvertiserID 广告主ID - AdvertiserID uint64 `json:"advertiser_id,omitempty"` // DeliveryPkg 推广产品资质信息 DeliveryPkg *DeliveryPkg `json:"delivery_pkg,omitempty"` + // AdvertiserID 广告主ID + AdvertiserID uint64 `json:"advertiser_id,omitempty"` } // Encode implement PostRequest interface @@ -20,13 +20,13 @@ func (r DeliveryPkgSubmitRequest) Encode() []byte { // DeliverPkgSubmitResponse 提交推广产品资质 API Response type DeliveryPkgSubmitResponse struct { - model.BaseResponse Data *DeliveryPkgSubmitResult `json:"data,omitempty"` + model.BaseResponse } type DeliveryPkgSubmitResult struct { - // PkgID 推广产品组id,可用于后续的查询或编辑 - PkgID uint64 `json:"pkg_id,omitempty"` // QualificationIDs 系统生成的资质id,每份资质对应一个id QualificationIDs []uint64 `json:"qualification_ids,omitempty"` + // PkgID 推广产品组id,可用于后续的查询或编辑 + PkgID uint64 `json:"pkg_id,omitempty"` } diff --git a/marketing-api/model/v3/blueflow/blue_flow_package.go b/marketing-api/model/v3/blueflow/blue_flow_package.go new file mode 100644 index 00000000..ec590213 --- /dev/null +++ b/marketing-api/model/v3/blueflow/blue_flow_package.go @@ -0,0 +1,33 @@ +package blueflow + +// Package 蓝海流量包信息 +type Package struct { + // BlueFlowPackageID 蓝海流量包ID + BlueFlowPackageID uint64 `json:"blue_flow_package_id,omitempty"` + // BlueFlowPackageName 蓝海流量包名称 + BlueFlowPackageName string `json:"blue_flow_package_name,omitempty"` + // FlowCoverageRatio 流量覆盖比例,返回整数(百分比),范围是0% ~ 100%(周维度更新) + FlowCoverageRatio string `json:"flow_coverage_ratio,omitempty"` + // EstimatedReachTrafficName 预计触达流量区间(周维度更新) + EstimatedReachTrafficName []uint64 `json:"estimated_reach_traffic_name,omitempty"` + // EstimatedCostRange 预估消耗区间(周维度更新) + EstimatedCostRange []uint64 `json:"estimated_cost_range,omitempty"` + // SuggestedBidRange 建议出价区间(周维度更新) + SuggestedBidRange []uint64 `json:"suggested_bid_range,omitempty"` + // BlueFlowKeyword 流量包蓝海关键词信息 + BlueFlowKeyword []Keyword `json:"blue_flow_keyword,omitempty"` +} + +// Keyword 流量包蓝海关键词信息 +type Keyword struct { + // BlueFlowKeywordName 蓝海关键词名称 + BlueFlowKeywordName string `json:"blue_flow_keyword_name,omitempty"` + // BlueFlowKeywordTopQueryWordList TOP蓝海关键词搜索词(周维度更新) + BlueFlowKeywordTopQueryWordList []string `json:"blue_flow_keyword_top_query_word_list,omitempty"` + // BlueFlowKeywordEstimatedCostRange 蓝海关键词预估消耗区间(周维度更新) + BlueFlowKeywordEstimatedCostRange []uint64 `json:"blue_flow_keyword_estimated_cost_range,omitempty"` + // SupportBlueFlowRecommendMaterial 是否支持设置系统推荐图文(周维度更新): + // 是 true + // 否false + SupportBlueFlowRecommendMaterial bool `json:"support_blue_flow_recommend_material,omitempty"` +} diff --git a/marketing-api/model/v3/blueflow/keyword_list.go b/marketing-api/model/v3/blueflow/keyword_list.go new file mode 100644 index 00000000..2ddd7381 --- /dev/null +++ b/marketing-api/model/v3/blueflow/keyword_list.go @@ -0,0 +1,49 @@ +package blueflow + +import ( + "strconv" + + "github.com/bububa/oceanengine/marketing-api/model" + "github.com/bububa/oceanengine/marketing-api/util" +) + +// KeywordListRequest 获取广告下可用蓝海关键词 API Request +type KeywordListRequest struct { + // Filtering 过滤器 + Filtering *KeywordListFilter `json:"filtering,omitempty"` + // AdvertiserID 广告账户ID + AdvertiserID uint64 `json:"advertiser_id,omitempty"` + // ProjectID 项目ID + ProjectID uint64 `json:"project_id,omitempty"` +} + +type KeywordListFilter struct { + // BlueFlowKeywordName 蓝海关键词名称,模糊匹配,长度限制50字 + BlueFlowKeywordName string `json:"blue_flow_keyword_name,omitempty"` + // BlueFlowRecommendType 关键词推荐类别,可选值: + // ORDINARY 代表普通 + // PREFERRED 代表优选 + BlueFlowRecommendType string `json:"blue_flow_recommend_type,omitempty"` +} + +// Encode implements GetRequest interface +func (r KeywordListRequest) Encode() string { + values := util.GetUrlValues() + values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10)) + values.Set("project_id", strconv.FormatUint(r.ProjectID, 10)) + if r.Filtering != nil { + values.Set("filtering", string(util.JSONMarshal(r.Filtering))) + } + ret := values.Encode() + util.PutUrlValues(values) + return ret +} + +// KeywordListResponse 获取广告下可用蓝海关键词 API Response +type KeywordListResponse struct { + model.BaseResponse + Data struct { + // List 蓝海流量包关键词列表 + List []Keyword `json:"list,omitempty"` + } `json:"data,omitempty"` +} diff --git a/marketing-api/model/v3/blueflow/package_list.go b/marketing-api/model/v3/blueflow/package_list.go new file mode 100644 index 00000000..e25241b3 --- /dev/null +++ b/marketing-api/model/v3/blueflow/package_list.go @@ -0,0 +1,44 @@ +package blueflow + +import ( + "strconv" + + "github.com/bububa/oceanengine/marketing-api/model" + "github.com/bububa/oceanengine/marketing-api/util" +) + +// PackageListRequest 获取蓝海流量包 API Request +type PackageListRequest struct { + // Filtering 过滤器 + Filtering *PackageListFilter `json:"filtering,omitempty"` + // AdvertiserID 广告账户ID + AdvertiserID uint64 `json:"advertiser_id,omitempty"` +} + +type PackageListFilter struct { + // BlueFlowPackageName 蓝海流量包名称,支持模糊搜索 + BlueFlowPackageName string `json:"blue_flow_package_name,omitempty"` + // BlueFlowPackageID 蓝海流量包ID,名称与ID同时传入则ID忽略名称筛选 + BlueFlowPackageID uint64 `json:"blue_flow_package_id,omitempty"` +} + +// Encode implements GetRequest interface +func (r PackageListRequest) 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))) + } + ret := values.Encode() + util.PutUrlValues(values) + return ret +} + +// PackageListResponse 获取蓝海流量包 API Response +type PackageListResponse struct { + model.BaseResponse + Data struct { + // BlueFlowPackages 蓝海流量包信息列表 + BlueFlowPackages []Package `json:"blue_flow_packages,omitempty"` + } `json:"data,omitempty"` +}