Skip to content

Commit

Permalink
Merge branch 'release/v1.29.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bububa committed Nov 21, 2024
2 parents f172a3a + 3c5bd1d commit ba5359f
Show file tree
Hide file tree
Showing 14 changed files with 397 additions and 0 deletions.
3 changes: 3 additions & 0 deletions marketing-api/STAR.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
- 二级代理商列表 [ ChildAgentSelect(clt *core.SDKClient, accessToken string, req *agent.ChildAgentSelectRequest) ([]uint64, error) ]
- 获取代理商信息 [ Info(clt *core.SDKClient, accessToken string, req *agent.InfoRequest) ([]agent.Info, error) ]
- 巨量星图 (api/star)
- 获取星广联投(星图版)任务列表 [ task.List(ctx context.Context, clt *core.SDKClient, accessToken string, req *task.ListRequest) (*task.ListResult, error) ]
- 获取星广联投(星图版)任务维度数据 [ task.Detail(ctx context.Context, clt *core.SDKClient, accessToken string, req *task.DetailRequest) (*task.Demand, error) ]
- 获取星广联投(星图版)视频维度数据 [ task.ItemList(ctx context.Context, clt *core.SDKClient, accessToken string, req *task.ItemListRequest) ([]task.ItemStatInfo, error) ]
- 获取星图客户任务列表 [ DemandList(clt *core.SDKClient, accessToken string, req *star.DemandListRequest) (*star.DemandListResponseData, error) ]
- 获取星图客户任务订单列表 [ DemandOrderList(clt *core.SDKClient, accessToken string, req *star.DemandOrderListRequest) (*star.DemandOrderListResponseData, error) ]
- 获取订单投后分析报表 [ ReportOrderOverviewGet(clt *core.SDKClient, accessToken string, req *star.ReportOrderOverviewGetRequest) (*star.ReportOrderOverviewGetResponseData, error) ]
Expand Down
19 changes: 19 additions & 0 deletions marketing-api/api/star/star-ad-unite-task/detail.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package task

import (
"context"

"github.com/bububa/oceanengine/marketing-api/core"
task "github.com/bububa/oceanengine/marketing-api/model/star/star-ad-unite-task"
)

// Detail 获取星广联投(星图版)任务维度数据
// 此接口可根据星图客户id和星广联投(星图版)任务id,获取某段时间下该任务信息和投放数据。
func Detail(ctx context.Context, clt *core.SDKClient, accessToken string, req *task.DetailRequest) (*task.Demand, error) {
var resp task.DetailResponse
err := clt.GetAPI(ctx, "2/star/star_ad_unite_task/detail/", req, &resp, accessToken)
if err != nil {
return nil, err
}
return resp.Data, nil
}
2 changes: 2 additions & 0 deletions marketing-api/api/star/star-ad-unite-task/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package task 获取星广联投(星图版)任务
package task
21 changes: 21 additions & 0 deletions marketing-api/api/star/star-ad-unite-task/item_list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package task

import (
"context"

"github.com/bububa/oceanengine/marketing-api/core"
task "github.com/bububa/oceanengine/marketing-api/model/star/star-ad-unite-task"
)

// ItemList 获取星广联投(星图版)视频维度数据
// 此接口可根据星图客户id和星广联投(星图版)任务id,获取某段时间下该任务分天的视频数据
// 其中预估实时消耗、转化量可拉取当天实时数据。
// 累计结算消耗、播放量仅支持T+1拉取,第二天10点后可获取稳定数据
func ItemList(ctx context.Context, clt *core.SDKClient, accessToken string, req *task.ItemListRequest) ([]task.ItemStatInfo, error) {
var resp task.ItemListResponse
err := clt.GetAPI(ctx, "2/star/star_ad_unite_task_item/list/", req, &resp, accessToken)
if err != nil {
return nil, err
}
return resp.Data.StatInfo, nil
}
19 changes: 19 additions & 0 deletions marketing-api/api/star/star-ad-unite-task/list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package task

import (
"context"

"github.com/bububa/oceanengine/marketing-api/core"
task "github.com/bububa/oceanengine/marketing-api/model/star/star-ad-unite-task"
)

// List 获取星广联投(星图版)任务列表
// 此接口可根据星图客户id,获取星图客户账号下星广联投(星图版)全部任务。
func List(ctx context.Context, clt *core.SDKClient, accessToken string, req *task.ListRequest) (*task.ListResult, error) {
var resp task.ListResponse
err := clt.GetAPI(ctx, "2/star/star_ad_unite_task/list/", req, &resp, accessToken)
if err != nil {
return nil, err
}
return resp.Data, nil
}
13 changes: 13 additions & 0 deletions marketing-api/enum/star_ad_unite_task_audit_status.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package enum

// StarAdUniteTaskAuditStatus 任务审核状态 可选值:
type StarAdUniteTaskAuditStatus string

const (
// StarAdUniteTaskAuditStatus_CONFIRM 审核通过
StarAdUniteTaskAuditStatus_CONFIRM StarAdUniteTaskAuditStatus = "CONFIRM"
// StarAdUniteTaskAuditStatus_CONFIRM_FAIL 审核失败
StarAdUniteTaskAuditStatus_CONFIRM_FAIL StarAdUniteTaskAuditStatus = "CONFIRM_FAIL"
// StarAdUniteTaskAuditStatus_PENDING_CONFIRM 审核中
StarAdUniteTaskAuditStatus_PENDING_CONFIRM StarAdUniteTaskAuditStatus = "PENDING_CONFIRM"
)
17 changes: 17 additions & 0 deletions marketing-api/enum/star_ad_unite_task_evaluate_type.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package enum

// StarAdUniteTaskEvaluateType 任务优化目标 可选值:
type StarAdUniteTaskEvaluateType string

const (
// StarAdUniteTaskEvaluateType_ACTIVE 激活
StarAdUniteTaskEvaluateType_ACTIVE StarAdUniteTaskEvaluateType = "ACTIVE"
// StarAdUniteTaskEvaluateType_ACTIVE_PAY 首次付费
StarAdUniteTaskEvaluateType_ACTIVE_PAY StarAdUniteTaskEvaluateType = "ACTIVE_PAY"
// StarAdUniteTaskEvaluateType_DEEP_PURCHASE 每次付费
StarAdUniteTaskEvaluateType_DEEP_PURCHASE StarAdUniteTaskEvaluateType = "DEEP_PURCHASE"
// StarAdUniteTaskEvaluateType_INSTALL_FINISH 安装完成
StarAdUniteTaskEvaluateType_INSTALL_FINISH StarAdUniteTaskEvaluateType = "INSTALL_FINISH"
// StarAdUniteTaskEvaluateType_REGISTER 注册
StarAdUniteTaskEvaluateType_REGISTER StarAdUniteTaskEvaluateType = "REGISTER"
)
15 changes: 15 additions & 0 deletions marketing-api/enum/star_ad_unite_task_item_status.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package enum

// StarAdUniteTaskItemStatus 视频状态 可选值:
type StarAdUniteTaskItemStatus string

const (
// StarAdUniteTaskItemStatus_AUDIT_PASS 审核通过
StarAdUniteTaskItemStatus_AUDIT_PASS StarAdUniteTaskItemStatus = "AUDIT_PASS"
// StarAdUniteTaskItemStatus_CREATED 视频已发布
StarAdUniteTaskItemStatus_CREATED StarAdUniteTaskItemStatus = "CREATED"
// StarAdUniteTaskItemStatus_PRIVATE_AREA 仅个人可见
StarAdUniteTaskItemStatus_PRIVATE_AREA StarAdUniteTaskItemStatus = "PRIVATE_AREA"
// StarAdUniteTaskItemStatus_USER_DELETED 用户删除
StarAdUniteTaskItemStatus_USER_DELETED StarAdUniteTaskItemStatus = "USER_DELETED"
)
33 changes: 33 additions & 0 deletions marketing-api/enum/star_ad_unite_task_status.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package enum

// StarAdUniteTaskStatus 任务状态
type StarAdUniteTaskStatus string

const (
// StarAdUniteTaskStatus_ALL 不限
StarAdUniteTaskStatus_ALL StarAdUniteTaskStatus = "ALL"
// StarAdUniteTaskStatus_BILLING 计费中
StarAdUniteTaskStatus_BILLING StarAdUniteTaskStatus = "BILLING"
// StarAdUniteTaskStatus_BULLETIN 公示中
StarAdUniteTaskStatus_BULLETIN StarAdUniteTaskStatus = "BULLETIN"
// StarAdUniteTaskStatus_CANCELED 已取消
StarAdUniteTaskStatus_CANCELED StarAdUniteTaskStatus = "CANCELED"
// StarAdUniteTaskStatus_CLOSED 已关闭
StarAdUniteTaskStatus_CLOSED StarAdUniteTaskStatus = "CLOSED"
// StarAdUniteTaskStatus_ENROLL 预热中
StarAdUniteTaskStatus_ENROLL StarAdUniteTaskStatus = "ENROLL"
// StarAdUniteTaskStatus_FINISHED 已完成
StarAdUniteTaskStatus_FINISHED StarAdUniteTaskStatus = "FINISHED"
// StarAdUniteTaskStatus_ONGOING 进行中
StarAdUniteTaskStatus_ONGOING StarAdUniteTaskStatus = "ONGOING"
// StarAdUniteTaskStatus_PROVIDER_ACCEPTING 服务商接单中
StarAdUniteTaskStatus_PROVIDER_ACCEPTING StarAdUniteTaskStatus = "PROVIDER_ACCEPTING"
// StarAdUniteTaskStatus_STARTED 投稿中
StarAdUniteTaskStatus_STARTED StarAdUniteTaskStatus = "STARTED"
// StarAdUniteTaskStatus_RECEIVEING 待接收
StarAdUniteTaskStatus_RECEIVEING StarAdUniteTaskStatus = "RECEIVEING"
// StarAdUniteTaskStatus_WAIT_EVALUATE 待评价
StarAdUniteTaskStatus_WAIT_EVALUATE StarAdUniteTaskStatus = "WAIT_EVALUATE"
// StarAdUniteTaskStatus_WAIT_PAYMENT 待付款
StarAdUniteTaskStatus_WAIT_PAYMENT StarAdUniteTaskStatus = "WAIT_PAYMENT"
)
101 changes: 101 additions & 0 deletions marketing-api/model/star/star-ad-unite-task/demand.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
package task

import "github.com/bububa/oceanengine/marketing-api/enum"

// Demand 任务信息
type Demand struct {
// StarID 客户的星图id
StarID uint64 `json:"star_id,omitempty"`
// DemandID 任务id
DemandID uint64 `json:"demand_id,omitempty"`
// DemandName 任务名称
DemandName string `json:"demand_name,omitempty"`
// CreateTime 任务创建时间,格式:yyyy-mm-dd HH:MM:SS
CreateTime string `json:"create_time,omitempty"`
// EvaluateType 任务优化目标 可选值:
// ACTIVE 激活
// ACTIVE_PAY 首次付费
// DEEP_PURCHASE 每次付费
// INSTALL_FINISH 安装完成
// REGISTER 注册
EvaluateType enum.StarAdUniteTaskEvaluateType `json:"evaluate_type,omitempty"`
// Budget 任务预算,单位:元*1000,建议获取后除以1000展示为元单位
Budget int64 `json:"budget,omitempty"`
// WeekSchedule 投放时段(没返回就是全时段投放)
WeekSchedule [][]int `json:"week_schedule,omitempty"`
// Status 任务状态 可选值:
// BILLING 计费中
// BULLETIN 公示中
// CANCELED 已取消
// CLOSED 已关闭
// ENROLL 预热中
// FINISHED 已完成
// PROVIDER_ACCEPTING 服务商接单中
// STARTED 投稿中
Status enum.StarAdUniteTaskStatus `json:"status,omitempty"`
// AuditStatus 任务审核状态 可选值:
// CONFIRM 审核通过
// CONFIRM_FAIL 审核失败
// PENDING_CONFIRM 审核中
AuditStatus enum.StarAdUniteTaskAuditStatus `json:"audit_status,omitempty"`
// StatInfo 分日数据列表
StatInfo []StatInfo `json:"stat_info,omitempty"`
}

// StatInfo 分日数据
type StatInfo struct {
// StatDate 数据日期,只和安卓/iOS消耗、转化数、深度转化数相关
StatDate string `json:"stat_date,omitempty"`
// AndroidConvertUnitAmount 安卓最新出价,单位:元*1000,建议获取后除以1000展示为元单位
AndroidConvertUnitAmount int64 `json:"android_convert_unit_amount,omitempty"`
// IosConvertUnitAmount iOS最新出价,单位:元*1000,建议获取后除以1000展示为元单位
IosConvertUnitAmount int64 `json:"ios_convert_unit_amount,omitempty"`
// AndroidCost 安卓消耗,单位:元*100000,建议获取后除以100000展示为元单位
AndroidCost int64 `json:"android_cost,omitempty"`
// IosCost iOS消耗,单位:元*100000,建议获取后除以100000展示为元单位
IosCost int64 `json:"ios_cost,omitempty"`
// AndroidConvert 安卓转化数
AndroidConvert int64 `json:"android_convert,omitempty"`
// IosConvert iOS转化数
IosConvert int64 `json:"ios_convert,omitempty"`
// AndroidDeepConvert 深度转化数
AndroidDeepConvert int64 `json:"android_deep_convert,omitempty"`
// IosDeepConvert 深度转化数
IosDeepConvert int64 `json:"ios_deep_convert,omitempty"`
}

// ItemStatInfo 分日数据
type ItemStatInfo struct {
// StatDate 数据日期,只和安卓/iOS消耗、转化数、深度转化数相关
StatDate string `json:"stat_date,omitempty"`
// StarID 客户的星图id
StarID uint64 `json:"star_id,omitempty"`
// AuthorID 达人id
AuthorID uint64 `json:"author_id,omitempty"`
// AuthorNickName 达人昵称
AuthorNickName string `json:"author_nick_name,omitempty"`
// DemandID 任务id
DemandID uint64 `json:"demand_id,omitempty"`
// ItemID 视频id
ItemID uint64 `json:"item_id,omitempty"`
// ItemURL 视频链接
ItemURL string `json:"item_url,omitempty"`
// ItemTitle 视频标题
ItemTitle string `json:"item_title,omitempty"`
// ItemStatus 视频状态 可选值:
// AUDIT_PASS 审核通过
// CREATED 视频已发布
// PRIVATE_AREA 仅个人可见
// USER_DELETED 用户删除
ItemStatus enum.StarAdUniteTaskItemStatus `json:"item_status,omitempty"`
// ReleaseTime 视频发布日期
ReleaseTime int64 `json:"release_time,omitempty"`
// PlayCnt 播放量,T+1更新,第二天10点后可获取稳定数据
PlayCnt int64 `json:"play_cnt,omitempty"`
// Convert 转化数,实时更新
Convert int64 `json:"convert,omitempty"`
// Cost 预估实时消耗,实时更新,单位:元*100000,建议获取后除以100000展示为元单位
Cost int64 `json:"cost,omitempty"`
// SettledCost 累计已结算消耗,T+1更新,单位:元*100000,建议获取后除以100000展示为元单位,第二天10点后可获取稳定数据
SettledCost int64 `json:"settled_cost,omitempty"`
}
38 changes: 38 additions & 0 deletions marketing-api/model/star/star-ad-unite-task/detail.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package task

import (
"strconv"

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

// DetailRequest 获取星广联投(星图版)任务维度数据 API Request
type DetailRequest struct {
// StarID 客户的星图id
StarID uint64 `json:"star_id,omitempty"`
// DemandID 任务id
DemandID uint64 `json:"demand_id,omitempty"`
// StarStartDate 查询起始时间,格式:yyyy-mm-dd ,只和安卓/iOS消耗、转化数、深度转化数相关
StarStartDate string `json:"star_start_date,omitempty"`
// StarEndDate 查询结束时间,格式:yyyy-mm-dd
StarEndDate string `json:"star_end_date,omitempty"`
}

// Encode implement GetRequest interface
func (r DetailRequest) Encode() string {
values := util.GetUrlValues()
values.Set("star_id", strconv.FormatUint(r.StarID, 10))
values.Set("demand_id", strconv.FormatUint(r.DemandID, 10))
values.Set("star_start_date", r.StarStartDate)
values.Set("star_end_date", r.StarEndDate)
ret := values.Encode()
util.PutUrlValues(values)
return ret
}

// DetailResponse 获取星广联投(星图版)任务维度数据 API Response
type DetailResponse struct {
Data *Demand `json:"data,omitempty"`
model.BaseResponse
}
2 changes: 2 additions & 0 deletions marketing-api/model/star/star-ad-unite-task/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package task 获取星广联投(星图版)任务
package task
50 changes: 50 additions & 0 deletions marketing-api/model/star/star-ad-unite-task/item_list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package task

import (
"strconv"

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

// ItemListRequest 获取星广联投(星图版)视频维度数据 API Request
type ItemListRequest struct {
// StarID 客户的星图id
StarID uint64 `json:"star_id,omitempty"`
// Page 页码,默认为1
Page int `json:"page,omitempty"`
// PageSize 页面大小,默认10,最大值20
PageSize int `json:"page_size,omitempty"`
// DemandID 任务id
DemandID uint64 `json:"demand_id,omitempty"`
// StarStartDate 查询起始时间,格式:yyyy-mm-dd ,只和安卓/iOS消耗、转化数、深度转化数相关
StarStartDate string `json:"star_start_date,omitempty"`
// StarEndDate 查询结束时间,格式:yyyy-mm-dd
StarEndDate string `json:"star_end_date,omitempty"`
}

// Encode implement GetRequest interface
func (r ItemListRequest) Encode() string {
values := util.GetUrlValues()
values.Set("star_id", strconv.FormatUint(r.StarID, 10))
values.Set("demand_id", strconv.FormatUint(r.DemandID, 10))
values.Set("star_start_date", r.StarStartDate)
values.Set("star_end_date", r.StarEndDate)
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
}

// ItemListResponse 获取星广联投(星图版)视频维度数据 API Response
type ItemListResponse struct {
model.BaseResponse
Data struct {
StatInfo []ItemStatInfo `json:"stat_info,omitempty"`
} `json:"data,omitempty"`
}
Loading

0 comments on commit ba5359f

Please sign in to comment.