Skip to content

Commit

Permalink
feat(agent):新增广告主账户信息查询
Browse files Browse the repository at this point in the history
  • Loading branch information
bububa committed Dec 25, 2024
1 parent 2bea026 commit b960e44
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 3 deletions.
1 change: 1 addition & 0 deletions marketing-api/OCEANENGINE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
- 批量删除推广产品资质 [ 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) ]
- 广告主账户信息查询 [ AdvertiserInfoQuery(ctx context.Context, clt *core.SDKClient, accessToken string, req *agent.AdvertiserInfoQueryRequest) ([]agent.AccountDetail, error) ]
- 修改广告主 [ AdvertiserUpdate(clt *core.SDKClient, accessToken string, req *agent.AdvertiserUpdateRequest) (*agent.AdvertiserUpdateResponseData, error) ]
- 二级代理商列表 [ ChildAgentSelect(clt *core.SDKClient, accessToken string, req *agent.ChildAgentSelectRequest) ([]uint64, error) ]
- 获取代理商信息 [ Info(clt *core.SDKClient, accessToken string, req *agent.InfoRequest) ([]agent.Info, error) ]
Expand Down
18 changes: 18 additions & 0 deletions marketing-api/api/agent/advertiser_info_query.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package agent

import (
"context"

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

// AdvertiserInfoQuery 广告主账户信息查询
// 广告主账户信息查询,包括:基础信息、自运营报备标签、账户绑定时间、账户联系人、账户负责人和协作者等
func AdvertiserInfoQuery(ctx context.Context, clt *core.SDKClient, accessToken string, req *agent.AdvertiserInfoQueryRequest) ([]agent.AccountDetail, error) {
var resp agent.AdvertiserInfoQueryResponse
if err := clt.Get(ctx, "2/agent/advertiser_info/query/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data.AccountDetailList, nil
}
107 changes: 107 additions & 0 deletions marketing-api/model/agent/advertiser_info_query.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
package agent

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

// AdvertiserInfoQueryRequest 广告主账户信息查询 API Request
type AdvertiserInfoQueryRequest struct {
// AccountIDs 广告主账户id,最多50个
AccountIDs []uint64 `json:"account_ids,omitempty"`
}

// Encode implements GetRequest interface
func (r AdvertiserInfoQueryRequest) Encode() string {
values := util.GetUrlValues()
values.Set("account_ids", string(util.JSONMarshal(r.AccountIDs)))
ret := values.Encode()
util.PutUrlValues(values)
return ret
}

// AdvertiserInfoQueryResponse 广告主账户信息查询 API Response
type AdvertiserInfoQueryResponse struct {
model.BaseResponse
Data struct {
// AccountDetailList 广告主账户详情
AccountDetailList []AccountDetail `json:"account_detail_list,omitempty"`
} `json:"data,omitempty"`
}

// AccountDetail 广告主账户详情
type AccountDetail struct {
// AdvertiserID 广告主id
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
// AdvertiserName 广告主账户名称
AdvertiserName string `json:"advertiser_name,omitempty"`
// AdvertiserStatus 广告主账户状态,枚举值:
// STATUS_CONFIRM_FAIL 审核失败/可再次申请
// STATUS_CONFIRM_FAIL_END 审核失败/最终状态
// STATUS_CONFIRM_MODIFY_FAIL 修改审核失败
// STATUS_DISABLE 已禁用
// STATUS_ENABLE 已审核
// STATUS_LIMIT 限制
// STATUS_PENDING_CONFIRM 待审核
// STATUS_PENDING_CONFIRM_MODIFY 修改审核
// STATUS_PENDING_VERIFIED 待验证
// STATUS_SELF_SERVICE_UNAUDITED 自助开户待验证资质
// STATUS_WAIT_FOR_BPM_AUDIT 等待CRM审核
// STATUS_WAIT_FOR_PUBLIC_AUTH 待对公验证
AdvertiserStatus enum.AdvertiserStatus `json:"advertiser_status,omitempty"`
// FirstIndustryName 一级行业名称
FirstIndustryName string `json:"first_industry_name,omitempty"`
// SecondIndustryName 二级行业名称
SecondIndustryName string `json:"second_industry_name,omitempty"`
// CreateTime 广告主账户创建时间
CreateTime string `json:"create_time,omitempty"`
// BindTime 广告主账户与代理商账户的绑定时间
BindTime string `json:"bind_time,omitempty"`
// SelfOperationTag 账户报备类型,枚举值:
// DECREASE_QUANTITY 走量
// EMPTY 无标签
// INCREASE_QUANTITY 收量
// SELF_OPERATION 自运营
SelfOperationTag enum.AdvertiserReportType `json:"self_operation_tag,omitempty"`
// FirstAgentCompanyName 一代代理商公司名称
FirstAgentCompanyName string `json:"first_agent_company_name,omitempty"`
// FirstAgentCompantyID 一代代理商公司ID
FirstAgentCompantyID uint64 `json:"first_agent_companty_id,omitempty"`
// FirstAgentName 一级代理商账户名称
FirstAgentName string `json:"first_agent_name,omitempty"`
// FirstAgentID 一级代理商账户ID
FirstAgentID uint64 `json:"first_agent_id,omitempty"`
// AdvCompanyName 广告主公司名称
AdvCompanyName string `json:"adv_company_name,omitempty"`
// AdvCompanyID 广告主公司ID
AdvCompanyID uint64 `json:"adv_company_id,omitempty"`
// CustomerSaleName 直客销售名称
CustomerSaleName string `json:"customer_sale_name,omitempty"`
// AuthExpireDate 对公认证过期时间
AuthExpireDate string `json:"auth_expire_date,omitempty"`
// ContactName 联系人姓名
ContactName string `json:"contact_name,omitempty"`
// OptimizerID 竞价权限负责人id
OptimizerID uint64 `json:"optimizer_id,omitempty"`
// OptimizerName 竞价权限负责人姓名
OptimizerName string `json:"optimizer_name,omitempty"`
// Collaborators
Collaborators []Collaborator `json:"collaborators,omitempty"`
}

type Collaborator struct {
// BrandOptimizerID 品牌权限负责人id
BrandOptimizerID uint64 `json:"brand_optimizer_id,omitempty"`
// BrandOptimizerName 品牌权限负责人姓名 a
BrndOptimizerName string `json:"brand_optimizer_name,omitempty"`
// BrandCollaborators
BrandCollaborators []BrandCollaborators `json:"brand_collaborators,omitempty"`
}

type BrandCollaborators struct {
// EmployeID 品牌权限协作者id
EmployeID uint64 `json:"employe_id,omitempty"`
// EmployeName 品牌权限协作者姓名
EmployeeName string `json:"employee_name,omitempty"`
}
2 changes: 1 addition & 1 deletion marketing-api/model/audiencepackage/audience_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type AudiencePackage struct {
// MarketingGoal 营销场景:VIDEO_AND_IMAGE 短视频/图片, LIVE 直播
MarketingGoal enum.MarketingGoal `json:"marketing_goal,omitempty"`
// DeliveryRange 广告投放范围【附录:广告投放范围】
DeliverRange enum.AdDeliveryRange `json:"delivery_range,omitempty"`
DeliveryRange enum.AdDeliveryRange `json:"delivery_range,omitempty"`
// HideIfExists 已安装用户,0表示不限,1表示过滤,2表示定向;过滤表示投放时不给安装客户展示广告,支持应用推广;定向表示投放时给安装客户展示广告;投放时优先获取直达链接,无直达链接时使用应用包名进行投放;如果无直达链接或应用包名,定向安装选项实际不生效;定向仅对Android链接生效。
// 过滤已安装
// UNLIMITED不限(默认值)
Expand Down
2 changes: 1 addition & 1 deletion marketing-api/model/audiencepackage/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type CreateRequest struct {
// LandingType 定向包推广类型
LandingType enum.LandingType `json:"landing_type,omitempty"`
// DeliveryRange 广告投放范围【附录:广告投放范围】
DeliverRange enum.AdDeliveryRange `json:"delivery_range,omitempty"`
DeliveryRange enum.AdDeliveryRange `json:"delivery_range,omitempty"`
// AdType 广告类型,允许值:
// ALL 所有广告(默认值)
// SEARCH 搜索广告
Expand Down
2 changes: 1 addition & 1 deletion marketing-api/model/audiencepackage/v3/audience_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type AudiencePackage struct {
// MarketingGoal 营销场景:VIDEO_AND_IMAGE 短视频/图片, LIVE 直播
MarketingGoal enum.MarketingGoal `json:"marketing_goal,omitempty"`
// DeliveryRange 广告投放范围【附录:广告投放范围】
DeliverRange enum.AdDeliveryRange `json:"delivery_range,omitempty"`
DeliveryRange enum.AdDeliveryRange `json:"delivery_range,omitempty"`
// HideIfExists 已安装用户,0表示不限,1表示过滤,2表示定向;过滤表示投放时不给安装客户展示广告,支持应用推广;定向表示投放时给安装客户展示广告;投放时优先获取直达链接,无直达链接时使用应用包名进行投放;如果无直达链接或应用包名,定向安装选项实际不生效;定向仅对Android链接生效。
// 过滤已安装
// UNLIMITED不限(默认值)
Expand Down

0 comments on commit b960e44

Please sign in to comment.