diff --git a/marketing-api/STAR.md b/marketing-api/STAR.md index 266b90ff..a1d4624a 100644 --- a/marketing-api/STAR.md +++ b/marketing-api/STAR.md @@ -6,6 +6,7 @@ - 刷新 Token [ RefreshToken(clt *core.SDKClient, refreshToken string) (*oauth.AccessTokenResponseData, error)] - 账号服务 - 广告主信息与资质管理 + - 获取星图账户信息 [ Info(clt *core.SDKClient, accessToken string, req *star.InfoRequest) ([]star.Info, error) ] - 修改广告主 [ agent.AdvertiserUpdate(clt *core.SDKClient, accessToken string, req *agent.AdvertiserUpdateRequest) (*agent.AdvertiserUpdateResponseData, error) ] - 代理商账号管理 (api/agent) - 广告主列表 [ AdvertiserSelect(clt *core.SDKClient, accessToken string, req *agent.AdvertiserSelectRequest) (*agent.AdvertiserSelectResponseData, error) ] @@ -15,9 +16,11 @@ - 获取星广联投(星图版)任务列表 [ 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) ] - - 获取订单投后受众报表 [ ReportOrderUserDistributionGet(clt *core.SDKClient, accessToken string, req *star.ReportOrderUserDistributionGetRequest) (*star.ReportOrderUserDistributionGetResponseData, error) ] - - 获取星图订单投后线索 [ ClueList(clt *core.SDKClient, accessToken string, req *star.ClueListRequest) (*star.ClueListResponseData, error) ] - - 获取星图账户信息 [ Info(clt *core.SDKClient, accessToken string, req *star.InfoRequest) ([]star.Info, error) ] + - 获取星图客户任务列表 [ DemandList(clt *core.SDKClient, accessToken string, req *star.DemandListRequest) (*star.DemandListResult, error) ] + - 获取星图客户任务订单列表 [ DemandOrderList(clt *core.SDKClient, accessToken string, req *star.DemandOrderListRequest) (*star.DemandOrderListResult, error) ] + - 获取订单投后分析报表 [ ReportOrderOverviewGet(clt *core.SDKClient, accessToken string, req *star.ReportOrderOverviewGetRequest) (*star.ReportOrderOverviewGetResult, error) ] + - 获取订单投后受众报表 [ ReportOrderUserDistributionGet(clt *core.SDKClient, accessToken string, req *star.ReportOrderUserDistributionGetRequest) (*star.ReportOrderUserDistributionGetResult, error) ] + - 获取星图订单投后线索 [ ClueGet(clt *core.SDKClient, accessToken string, req *star.ClueGetRequest) (*star.ClueGetResult, error) ] + - 获取任务下累计可查询的数据指标 [ ReportDataTopicConfig(ctx context.Context, clt *core.SDKClient, accessToken string, req *star.ReportDataTopicConfigRequest) ([]star.DataTopicConfig, error) ] + - 获取投后数据主题累计数据 [ ReportCustomDataTopicConfig(ctx context.Context, clt *core.SDKClient, accessToken string, req *star.ReportDataTopicConfigRequest) (*star.ReportCustomDataTopicConfigResult, error) ] + - 获取投后每日趋势数据(短视频) [ ReportCustomDataTopicDailyReport(ctx context.Context, clt *core.SDKClient, accessToken string, req *star.ReportCustomDataTopicDailyReportRequest) ([]star.ReportCustomDataTopicDailyReport, error) ] diff --git a/marketing-api/api/star/clue_list.go b/marketing-api/api/star/clue_list.go index afbad649..d856a6b2 100644 --- a/marketing-api/api/star/clue_list.go +++ b/marketing-api/api/star/clue_list.go @@ -10,10 +10,9 @@ import ( // ClueList 获取星图订单投后线索 // 此接口用于根据星图id和订单id,获取星图客户的投后线索; // 若星图客户所发布的抖音传播任务,为线索收集类任务,则星图客户或代理商,可通过此接口,获取达人接单视频中所收集的线索列表。 -func ClueList(ctx context.Context, clt *core.SDKClient, accessToken string, req *star.ClueListRequest) (*star.ClueListResponseData, error) { - var resp star.ClueListResponse - err := clt.Get(ctx, "2/star/clue/list/", req, &resp, accessToken) - if err != nil { +func ClueList(ctx context.Context, clt *core.SDKClient, accessToken string, req *star.ClueGetRequest) (*star.ClueGetResult, error) { + var resp star.ClueGetResponse + if err := clt.Get(ctx, "2/star/clue/list/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/star/demand_list.go b/marketing-api/api/star/demand_list.go index 9e9c95ed..875fa839 100644 --- a/marketing-api/api/star/demand_list.go +++ b/marketing-api/api/star/demand_list.go @@ -9,7 +9,7 @@ import ( // DemandList 获取星图客户任务列表 // 此接口用于根据星图ID,获取星图客户账号下的全部任务,包含星图任务id、任务名称、结算方式、组件类型、任务创建时间。 -func DemandList(ctx context.Context, clt *core.SDKClient, accessToken string, req *star.DemandListRequest) (*star.DemandListResponseData, error) { +func DemandList(ctx context.Context, clt *core.SDKClient, accessToken string, req *star.DemandListRequest) (*star.DemandListResult, error) { var resp star.DemandListResponse err := clt.Get(ctx, "2/star/demand/list/", req, &resp, accessToken) if err != nil { diff --git a/marketing-api/api/star/demand_order_list.go b/marketing-api/api/star/demand_order_list.go index 4465647a..872739e3 100644 --- a/marketing-api/api/star/demand_order_list.go +++ b/marketing-api/api/star/demand_order_list.go @@ -9,9 +9,9 @@ import ( // DemandOrderList 获取星图客户任务订单列表 // 此接口用于根据星图id和星图任务id,获取星图客户所发布任务的订单列表,包含订单总数、订单id、订单创建时间、订单状态、作品名称、作品封面图、视频id、视频链接、接单的达人id、达人名称、达人头像。 -func DemandOrderList(ctx context.Context, clt *core.SDKClient, accessToken string, req *star.DemandOrderListRequest) (*star.DemandOrderListResponseData, error) { +func DemandOrderList(ctx context.Context, clt *core.SDKClient, accessToken string, req *star.DemandOrderListRequest) (*star.DemandOrderListResult, error) { var resp star.DemandOrderListResponse - err := clt.Get(ctx, "2/star/demand/order/list/", req, &resp, accessToken) + err := clt.GetAPI(ctx, "2/star/demand/order/list/", req, &resp, accessToken) if err != nil { return nil, err } diff --git a/marketing-api/api/star/report_custom_data_topic_config.go b/marketing-api/api/star/report_custom_data_topic_config.go new file mode 100644 index 00000000..4a6a08e2 --- /dev/null +++ b/marketing-api/api/star/report_custom_data_topic_config.go @@ -0,0 +1,17 @@ +package star + +import ( + "context" + + "github.com/bububa/oceanengine/marketing-api/core" + "github.com/bububa/oceanengine/marketing-api/model/star" +) + +// ReportCustomDataTopicConfig 获取投后数据主题累计数据 +func ReportCustomDataTopicConfig(ctx context.Context, clt *core.SDKClient, accessToken string, req *star.ReportDataTopicConfigRequest) (*star.ReportCustomDataTopicConfigResult, error) { + var resp star.ReportCustomDataTopicConfigResponse + if err := clt.GetAPI(ctx, "2/star/report/custom_data_topic_config/", req, &resp, accessToken); err != nil { + return nil, err + } + return resp.Data, nil +} diff --git a/marketing-api/api/star/report_custom_data_topic_daily_report.go b/marketing-api/api/star/report_custom_data_topic_daily_report.go new file mode 100644 index 00000000..11d6b34c --- /dev/null +++ b/marketing-api/api/star/report_custom_data_topic_daily_report.go @@ -0,0 +1,20 @@ +package star + +import ( + "context" + + "github.com/bububa/oceanengine/marketing-api/core" + "github.com/bububa/oceanengine/marketing-api/model/star" +) + +// ReportCustomDataTopicDailyReport 获取投后每日趋势数据(短视频) +func ReportCustomDataTopicDailyReport(ctx context.Context, clt *core.SDKClient, accessToken string, req *star.ReportCustomDataTopicDailyReportRequest) ([]star.ReportCustomDataTopicDailyReport, error) { + var resp star.ReportCustomDataTopicDailyReportResponse + if err := clt.GetAPI(ctx, "2/star/report/custom_data_topic_daily_report/", req, &resp, accessToken); err != nil { + return nil, err + } + if resp.Data == nil { + return nil, nil + } + return resp.Data.Stats, nil +} diff --git a/marketing-api/api/star/report_data_topic_config.go b/marketing-api/api/star/report_data_topic_config.go new file mode 100644 index 00000000..9b2adb98 --- /dev/null +++ b/marketing-api/api/star/report_data_topic_config.go @@ -0,0 +1,21 @@ +package star + +import ( + "context" + + "github.com/bububa/oceanengine/marketing-api/core" + "github.com/bububa/oceanengine/marketing-api/model/star" +) + +// ReportDataTopicConfig 获取任务下累计可查询的数据指标 +func ReportDataTopicConfig(ctx context.Context, clt *core.SDKClient, accessToken string, req *star.ReportDataTopicConfigRequest) ([]star.DataTopicConfig, error) { + var resp star.ReportDataTopicConfigResponse + err := clt.GetAPI(ctx, "2/star/report/data_topic_config/", req, &resp, accessToken) + if err != nil { + return nil, err + } + if resp.Data == nil { + return nil, nil + } + return resp.Data.Stat, nil +} diff --git a/marketing-api/api/star/report_order_overview_get.go b/marketing-api/api/star/report_order_overview_get.go index 8299e0c5..8b9a6bde 100644 --- a/marketing-api/api/star/report_order_overview_get.go +++ b/marketing-api/api/star/report_order_overview_get.go @@ -12,10 +12,9 @@ import ( // 结果中所有的rate均为*100后的结果,如five_s_play_rate=2750,表示有效播放率27.5%。 // 数据为非实时更新,一般在次日凌晨产出前一天的数据; // 一般历史数据都不会变,除了数据有问题有校对的情况会更新历史数据。 -func ReportOrderOverviewGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *star.ReportOrderOverviewGetRequest) (*star.ReportOrderOverviewGetResponseData, error) { +func ReportOrderOverviewGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *star.ReportOrderOverviewGetRequest) (*star.ReportOrderOverviewGetResult, error) { var resp star.ReportOrderOverviewGetResponse - err := clt.Get(ctx, "2/star/report/order_overview/get/", req, &resp, accessToken) - if err != nil { + if err := clt.GetAPI(ctx, "2/star/report/order_overview/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/api/star/report_order_user_distribution_get.go b/marketing-api/api/star/report_order_user_distribution_get.go index 9404d06a..f47599da 100644 --- a/marketing-api/api/star/report_order_user_distribution_get.go +++ b/marketing-api/api/star/report_order_user_distribution_get.go @@ -11,10 +11,9 @@ import ( // 此接口用于根据订单id,获取星图客户所发布任务的接单达人作品的受众分析数据,包含性别、年龄、省份、城市、设备、兴趣、活跃度分布。 // 数据为非实时更新,一般在次日凌晨产出前一天的数据; // 一般历史数据都不会变,除了数据有问题有校对的情况会更新历史数据。 -func ReportOrderUserDistributionGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *star.ReportOrderUserDistributionGetRequest) (*star.ReportOrderUserDistributionGetResponseData, error) { +func ReportOrderUserDistributionGet(ctx context.Context, clt *core.SDKClient, accessToken string, req *star.ReportOrderUserDistributionGetRequest) (*star.ReportOrderUserDistributionGetResult, error) { var resp star.ReportOrderUserDistributionGetResponse - err := clt.Get(ctx, "2/star/report/order_user_distribution/get/", req, &resp, accessToken) - if err != nil { + if err := clt.GetAPI(ctx, "2/star/report/order_user_distribution/get/", req, &resp, accessToken); err != nil { return nil, err } return resp.Data, nil diff --git a/marketing-api/enum/star_report_topic.go b/marketing-api/enum/star_report_topic.go new file mode 100644 index 00000000..a1300827 --- /dev/null +++ b/marketing-api/enum/star_report_topic.go @@ -0,0 +1,25 @@ +package enum + +// StarReportTopic 数据主题 +type StarReportTopic string + +const ( + // StarReportTopic_BASIC_DATA 基础信息 + StarReportTopic_BASIC_DATA StarReportTopic = "BASIC_DATA" + // StarReportTopic_FLOW_DATA 流量表现 + StarReportTopic_FLOW_DATA StarReportTopic = "FLOW_DATA" + // StarReportTopic_CONVERT_DATA 转化表现 + StarReportTopic_CONVERT_DATA StarReportTopic = "CONVERT_DATA" + // StarReportTopic_SEARCH_DATA 搜索表现 + StarReportTopic_SEARCH_DATA StarReportTopic = "SEARCH_DATA" + // StarReportTopic_RECOMMEND_DATA 种草表现 + StarReportTopic_RECOMMEND_DATA StarReportTopic = "RECOMMEND_DATA" + // StarReportTopic_DY_SHOP_DATA 抖音进店 + StarReportTopic_DY_SHOP_DATA StarReportTopic = "DY_SHOP_DATA" + // StarReportTopic_USER_DISTRIBUTION_DATA 用户画像、 + StarReportTopic_USER_DISTRIBUTION_DATA StarReportTopic = "USER_DISTRIBUTION_DATA" + // StarReportTopic_INDEX_SCORE_DATA 指数得分 + StarReportTopic_INDEX_SCORE_DATA StarReportTopic = "INDEX_SCORE_DATA" + // StarReportTopic_COMMENT_DATA 评论数据 + StarReportTopic_COMMENT_DATA StarReportTopic = "COMMENT_DATA" +) diff --git a/marketing-api/model/star/clue_list.go b/marketing-api/model/star/clue_get.go similarity index 78% rename from marketing-api/model/star/clue_list.go rename to marketing-api/model/star/clue_get.go index 2f7b7575..36d018cc 100644 --- a/marketing-api/model/star/clue_list.go +++ b/marketing-api/model/star/clue_get.go @@ -7,8 +7,8 @@ import ( "github.com/bububa/oceanengine/marketing-api/util" ) -// ClueListRequest 获取星图订单投后线索 API Request -type ClueListRequest struct { +// ClueGetRequest 获取星图订单投后线索 API Request +type ClueGetRequest struct { // StarID 星图id,星图客户授权后,通过“获取已授权账户”接口,查询到账号角色为”6-星图账号“的账户id,即为星图id StarID uint64 `json:"star_id,omitempty"` // DemandID 任务id @@ -22,7 +22,7 @@ type ClueListRequest struct { } // Encode implement GetRequest interface -func (r ClueListRequest) Encode() string { +func (r ClueGetRequest) Encode() string { values := util.GetUrlValues() values.Set("star_id", strconv.FormatUint(r.StarID, 10)) if r.DemandID > 0 { @@ -42,15 +42,15 @@ func (r ClueListRequest) Encode() string { return ret } -// ClueListResponse 获取星图客户任务列表 API Response -type ClueListResponse struct { - model.BaseResponse +// ClueGetResponse 获取星图客户任务列表 API Response +type ClueGetResponse struct { // Data json返回值 - Data *ClueListResponseData `json:"data,omitempty"` + Data *ClueGetResult `json:"data,omitempty"` + model.BaseResponse } -// ClueListResponseData json返回值 -type ClueListResponseData struct { +// ClueGetResult json返回值 +type ClueGetResult struct { List []Clue `json:"list,omitempty"` PageInfo model.PageInfo `json:"page_info"` } diff --git a/marketing-api/model/star/demand.go b/marketing-api/model/star/demand.go index 597ef990..6912c525 100644 --- a/marketing-api/model/star/demand.go +++ b/marketing-api/model/star/demand.go @@ -4,10 +4,10 @@ import "github.com/bububa/oceanengine/marketing-api/enum" // Demand 星图客户任务 type Demand struct { - // ID 任务id - ID uint64 `json:"demand_id,omitempty"` - // Name 任务名称 - Name string `json:"name,omitempty"` + // DemandID 任务id + DemandID uint64 `json:"demand_id,omitempty"` + // DemandName 任务名称 + DemandName string `json:"name,omitempty"` // TaskCategory 所创建的星图任务类型。枚举值详见【附录-枚举值-星图任务类型】 TaskCategory enum.StarTaskCategory `json:"task_category,omitempty"` // ComponentType 组件类型 diff --git a/marketing-api/model/star/demand_list.go b/marketing-api/model/star/demand_list.go index 1f0d3e9d..c9a43941 100644 --- a/marketing-api/model/star/demand_list.go +++ b/marketing-api/model/star/demand_list.go @@ -11,10 +11,10 @@ import ( // DemandListRequest 获取星图客户任务列表 API Request type DemandListRequest struct { - // StarID 星图id,星图客户授权后,通过“获取已授权账户”接口,查询到账号角色为”6-星图账号“的账户id,即为星图id - StarID uint64 `json:"star_id,omitempty"` // Filtering 过滤条件,若此字段不传,或传空则视为无限制条件 Filtering *DemandListFilter `json:"filtering,omitempty"` + // StarID 星图id,星图客户授权后,通过“获取已授权账户”接口,查询到账号角色为”6-星图账号“的账户id,即为星图id + StarID uint64 `json:"star_id,omitempty"` // Page 页码,默认为1 Page int `json:"page,omitempty"` // PageSize 页面大小,默认10,最大值50 @@ -23,6 +23,10 @@ type DemandListRequest struct { // DemandListFilter 过滤条件 type DemandListFilter struct { + // QueryTimeRange 查询时间范围内创建的任务。 + // 筛选时间时,开始时间必须与结束时间同时传入,开始时间必须小于等于结束时间。 + // 若缺省默认查询全时间范围任务,若出现超时等情况请缩小查询时间范围。 + QueryTimeRange *model.DateRange `json:"query_time_range,omitempty"` // ComponentType 组件类型 ComponentType enum.StarComponentType `json:"component_type,omitempty"` // TaskCategory 星图任务类型,允许值详见【附录-枚举值-星图任务类型】 @@ -56,13 +60,13 @@ func (r DemandListRequest) Encode() string { // DemandListResponse 获取星图客户任务列表 API Response type DemandListResponse struct { - model.BaseResponse // Data json返回值 - Data *DemandListResponseData `json:"data,omitempty"` + Data *DemandListResult `json:"data,omitempty"` + model.BaseResponse } -// DemandListResponseData json返回值 -type DemandListResponseData struct { +// DemandListResult json返回值 +type DemandListResult struct { List []Demand `json:"list,omitempty"` PageInfo model.PageInfo `json:"page_info"` } diff --git a/marketing-api/model/star/demand_order_list.go b/marketing-api/model/star/demand_order_list.go index c42be617..31b226da 100644 --- a/marketing-api/model/star/demand_order_list.go +++ b/marketing-api/model/star/demand_order_list.go @@ -11,10 +11,12 @@ import ( // DemandOrderListRequest 获取星图客户任务列表 API Request type DemandOrderListRequest struct { - // StarID 星图id,星图客户授权后,通过“获取已授权账户”接口,查询到账号角色为”6-星图账号“的账户id,即为星图id - StarID uint64 `json:"star_id,omitempty"` // Filtering 过滤条件,若此字段不传,或传空则视为无限制条件 Filtering *DemandOrderListFilter `json:"filtering,omitempty"` + // StarID 星图id,星图客户授权后,通过“获取已授权账户”接口,查询到账号角色为”6-星图账号“的账户id,即为星图id + StarID uint64 `json:"star_id,omitempty"` + // DemandID 任务id,可通过“获取星图客户任务列表”获取 + DemandID uint64 `json:"demand_id,omitempty"` // Page 页码,默认为1 Page int `json:"page,omitempty"` // PageSize 页面大小,默认10,最大值50 @@ -48,13 +50,13 @@ func (r DemandOrderListRequest) Encode() string { // DemandOrderListResponse 获取星图客户任务列表 API Response type DemandOrderListResponse struct { - model.BaseResponse // Data json返回值 - Data *DemandOrderListResponseData `json:"data,omitempty"` + Data *DemandOrderListResult `json:"data,omitempty"` + model.BaseResponse } -// DemandOrderListResponseData json返回值 -type DemandOrderListResponseData struct { +// DemandOrderListResult json返回值 +type DemandOrderListResult struct { List []Order `json:"list,omitempty"` PageInfo model.PageInfo `json:"page_info"` } diff --git a/marketing-api/model/star/info.go b/marketing-api/model/star/info.go index 2851df9e..0f3ef554 100644 --- a/marketing-api/model/star/info.go +++ b/marketing-api/model/star/info.go @@ -61,8 +61,8 @@ type Info struct { // IndustryInfo 行业信息 type IndustryInfo struct { - // IndustryID 行业id - IndustryID uint64 `json:"industry_id,omitempty"` // IndustryName 行业名称 IndustryName string `json:"industry_name,omitempty"` + // IndustryID 行业id + IndustryID uint64 `json:"industry_id,omitempty"` } diff --git a/marketing-api/model/star/order.go b/marketing-api/model/star/order.go index 6997cc63..a87591e1 100644 --- a/marketing-api/model/star/order.go +++ b/marketing-api/model/star/order.go @@ -4,8 +4,8 @@ import "github.com/bububa/oceanengine/marketing-api/enum" // Order 星图客户任务订单 type Order struct { - // ID 订单id - ID uint64 `json:"order_id,omitempty"` + // OrderID 订单id + OrderID uint64 `json:"order_id,omitempty"` // Title 作品名称 Title string `json:"title,omitempty"` // UniversalOrderStatus 订单状态 @@ -14,18 +14,22 @@ type Order struct { AuthorID uint64 `json:"author_id,omitempty"` // AuthorName 达人名称 AuthorName string `json:"author_name,omitempty"` - // AvatarURL 达人头像 - AvatarURL string `json:"avatar_url,omitempty"` + // AvatarURI 达人头像 + AvatarURI string `json:"avatar_uri,omitempty"` // CreateTime 订单创建时间,格式:%Y-%m-%d %H:%M:%S CreateTime string `json:"create_time,omitempty"` // DemandID 任务id DemandID uint64 `json:"demand_id,omitempty"` - // HeadImageURL 封面图 - HeadImageURL string `json:"head_image_url,omitempty"` + // HeadImageURI 封面图 + HeadImageURI string `json:"head_image_uri,omitempty"` // VideoID 视频id,每个视频唯一(建议使用item_id) VideoID string `json:"video_id,omitempty"` // ItemID 视频id,与星图平台前端video_url中展现的视频id一致,每个视频唯一 ItemID uint64 `json:"item_id,omitempty"` // VideoURL 视频链接 VideoURL string `json:"video_url,omitempty"` + // CampaignID 需求id + CampaignID uint64 `json:"campaign_id,omitempty"` + // ReleaseTime 指派任务产出物发布时间 + ReleaseTime string `json:"release_time,omitempty"` } diff --git a/marketing-api/model/star/report_custom_data_topic_config.go b/marketing-api/model/star/report_custom_data_topic_config.go new file mode 100644 index 00000000..6e7627c8 --- /dev/null +++ b/marketing-api/model/star/report_custom_data_topic_config.go @@ -0,0 +1,18 @@ +package star + +import "github.com/bububa/oceanengine/marketing-api/model" + +// ReportCustomDataTopicConfigResponse 获取投后数据主题累计数据 API Response +type ReportCustomDataTopicConfigResponse struct { + Data *ReportCustomDataTopicConfigResult `json:"data,omitempty"` + model.BaseResponse +} + +type ReportCustomDataTopicConfigResult struct { + // Data 对应请求的数据主题数组 + Data []DataTopicConfig `json:"data,omitempty"` + // ItemID 请求的交付物Id + ItemID uint64 `json:"item_id,omitempty"` + // DemandID 请求的任务Id + DemandID uint64 `json:"demand_id,omitempty"` +} diff --git a/marketing-api/model/star/report_custom_data_topic_daily_report.go b/marketing-api/model/star/report_custom_data_topic_daily_report.go new file mode 100644 index 00000000..c7a21ff8 --- /dev/null +++ b/marketing-api/model/star/report_custom_data_topic_daily_report.go @@ -0,0 +1,71 @@ +package star + +import ( + "strconv" + + "github.com/bububa/oceanengine/marketing-api/enum" + "github.com/bububa/oceanengine/marketing-api/model" + "github.com/bububa/oceanengine/marketing-api/util" +) + +// ReportCustomDataTopicDailyReportRequest 获取投后每日趋势数据(短视频) API Request +type ReportCustomDataTopicDailyReportRequest struct { + // StartTime 起始时间: yyyy-MM-dd + StartTime string `json:"start_time,omitempty"` + // EndTime 结束时间: yyyy-MM-dd + EndTime string `json:"end_time,omitempty"` + // Topics 数据主题: + // BASIC_DATA:基础信息 + // FLOW_DATA:流量表现 + // CONVERT_DATA:转化表现 + // SEARCH_DATA:搜索表现 + // RECOMMEND_DATA: 种草表现 + // DY_SHOP_DATA:抖音进店 + // USER_DISTRIBUTION_DATA:用户画像、 + // INDEX_SCORE_DATA: 指数得分 + // COMMENT_DATA:评论数据 + // 直播用户画像仅保留近90天且直播时长 >= 25 分钟直播数据 + Topics []enum.StarReportTopic `json:"topics,omitempty"` + // StarID 发起请求的客户的starId + StarID uint64 `json:"star_id,omitempty"` + // WorkID 交付作品Id,如:视频Id,直播间room_id. + WorkID uint64 `json:"work_id,omitempty"` + // DemandID 任务Id + DemandID uint64 `json:"demand_id,omitempty"` +} + +// Encode implement GetRequest interface +func (r ReportCustomDataTopicDailyReportRequest) Encode() string { + values := util.GetUrlValues() + values.Set("star_id", strconv.FormatUint(r.StarID, 10)) + values.Set("work_id", strconv.FormatUint(r.WorkID, 10)) + values.Set("demand_id", strconv.FormatUint(r.DemandID, 10)) + values.Set("topics", string(util.JSONMarshal(r.Topics))) + values.Set("start_time", r.StartTime) + values.Set("end_time", r.EndTime) + ret := values.Encode() + util.PutUrlValues(values) + return ret +} + +// ReportCustomDataTopicDailyReportResponse 获取投后数据主题累计数据 API Response +type ReportCustomDataTopicDailyReportResponse struct { + Data *ReportCustomDataTopicDailyReportResult `json:"data,omitempty"` + model.BaseResponse +} + +type ReportCustomDataTopicDailyReportResult struct { + // Stats 统计数据列表 + Stats []ReportCustomDataTopicDailyReport `json:"stats,omitempty"` +} + +type ReportCustomDataTopicDailyReport struct { + // Date 该指标数据的yyyy-MM-dd日期时间, 按天聚合。BASIC_DATA作为通用指标在每日趋势数据中date为"0"。 + Date string `json:"date,omitempty"` + // Data 对应请求的数据主题数组 + Data []DataTopicConfig `json:"data,omitempty"` + // WorkID 交付作品Id:如视频Id + ItemID uint64 `json:"item_id,omitempty"` + // DemandID 请求的任务Id + DemandID uint64 `json:"demand_id,omitempty"` +} diff --git a/marketing-api/model/star/report_data_topic_config.go b/marketing-api/model/star/report_data_topic_config.go new file mode 100644 index 00000000..a0937eaa --- /dev/null +++ b/marketing-api/model/star/report_data_topic_config.go @@ -0,0 +1,93 @@ +package star + +import ( + "strconv" + + "github.com/bububa/oceanengine/marketing-api/enum" + "github.com/bububa/oceanengine/marketing-api/model" + "github.com/bububa/oceanengine/marketing-api/util" +) + +// ReportDataTopicConfigRequest 获取任务下累计可查询的数据指标 API Request +type ReportDataTopicConfigRequest struct { + // Topics 数据主题: + // BASIC_DATA:基础信息 + // FLOW_DATA:流量表现 + // CONVERT_DATA:转化表现 + // SEARCH_DATA:搜索表现 + // RECOMMEND_DATA: 种草表现 + // DY_SHOP_DATA:抖音进店 + // USER_DISTRIBUTION_DATA:用户画像、 + // INDEX_SCORE_DATA: 指数得分 + // COMMENT_DATA:评论数据 + // 直播用户画像仅保留近90天且直播时长 >= 25 分钟直播数据 + Topics []enum.StarReportTopic `json:"topics,omitempty"` + // StarID 发起请求的客户的starId + StarID uint64 `json:"star_id,omitempty"` + // WorkID 交付作品Id,如:视频Id,直播间room_id. + WorkID uint64 `json:"work_id,omitempty"` + // DemandID 任务Id + DemandID uint64 `json:"demand_id,omitempty"` +} + +// Encode implement GetRequest interface +func (r ReportDataTopicConfigRequest) Encode() string { + values := util.GetUrlValues() + values.Set("star_id", strconv.FormatUint(r.StarID, 10)) + values.Set("work_id", strconv.FormatUint(r.WorkID, 10)) + values.Set("demand_id", strconv.FormatUint(r.DemandID, 10)) + values.Set("topics", string(util.JSONMarshal(r.Topics))) + ret := values.Encode() + util.PutUrlValues(values) + return ret +} + +// ReportDataTopicConfigResponse 获取任务下累计可查询的数据指标 API Response +type ReportDataTopicConfigResponse struct { + Data *ReportDataTopicConfigResult `json:"data,omitempty"` + model.BaseResponse +} + +type ReportDataTopicConfigResult struct { + // Stat 对应请求的数据主题数组 + Stat []DataTopicConfig `json:"stat,omitempty"` +} + +// DataTopicConfig 任务下累计可查询的数据指标 +type DataTopicConfig struct { + // DataTopic 同请求中的数据主题枚举值。不存在的数据主题将缺省。 可选值: + // BASIC_DATA 基础信息 + // COMMENT_DATA 评论数据 + // CONVERT_DATA 转化表现 + // DY_SHOP_DATA 抖音进店 + // FLOW_DATA 流量表现 + // INDEX_SCORE_DATA 指数得分 + // RECOMMEND_DATA 种草表现 + // SEARCH_DATA 搜索表现 + // USER_DISTRIBUTION_DATA 用户画像 + DataTopic enum.StarReportTopic `json:"data_topic,omitempty"` + // Metrics 数据主题下的数据指标,一个数据主题对应一个或多个数据指标。不存在的数据指标将缺省。 + Metrics []DataTopicMetric `json:"metrics,omitempty"` +} + +// DataTopicMetric 数据主题下的数据指标 +type DataTopicMetric struct { + // Field 指标字段,仅包含英文与下划线等符号 + Field string `json:"field,omitempty"` + // Name 指标名称,中文或英文描述字段名称 + Name string `json:"name,omitempty"` + // Type 指标数据类型: + // STRING + // INT64 + // FLOAT64 + // JSON 可选值: + // FLOAT64 64位浮点数 + // INT64 64位整数 + // JSON JSON + // STRING 字符串 + Type string `json:"type,omitempty"` + // Description 指标描述 + Description string `json:"description,omitempty"` + // Value 指标值 + Value string `json:"value,omitempty"` +} diff --git a/marketing-api/model/star/report_order_overview_get.go b/marketing-api/model/star/report_order_overview_get.go index 4864e0ed..89341c95 100644 --- a/marketing-api/model/star/report_order_overview_get.go +++ b/marketing-api/model/star/report_order_overview_get.go @@ -27,13 +27,13 @@ func (r ReportOrderOverviewGetRequest) Encode() string { // ReportOrderOverviewGetResponse 获取订单投后分析报表 API Response type ReportOrderOverviewGetResponse struct { - model.BaseResponse // Data json返回值 - Data *ReportOrderOverviewGetResponseData `json:"data,omitempty"` + Data *ReportOrderOverviewGetResult `json:"data,omitempty"` + model.BaseResponse } -// ReportOrderOverviewGetResponseData json返回值 -type ReportOrderOverviewGetResponseData struct { +// ReportOrderOverviewGetResult json返回值 +type ReportOrderOverviewGetResult struct { // Comment 舆情表现 Comment *CommentReport `json:"comment,omitempty"` // Convert 转化表现 diff --git a/marketing-api/model/star/report_order_user_distribution_get.go b/marketing-api/model/star/report_order_user_distribution_get.go index bb9864fa..328c90b1 100644 --- a/marketing-api/model/star/report_order_user_distribution_get.go +++ b/marketing-api/model/star/report_order_user_distribution_get.go @@ -27,13 +27,15 @@ func (r ReportOrderUserDistributionGetRequest) Encode() string { // ReportOrderUserDistributionGetResponse 获取订单投后受众报表 API Response type ReportOrderUserDistributionGetResponse struct { - model.BaseResponse // Data json返回值 - Data *ReportOrderUserDistributionGetResponseData `json:"data,omitempty"` + Data *ReportOrderUserDistributionGetResult `json:"data,omitempty"` + model.BaseResponse } -// ReportOrderUserDistributionGetResponseData 返回值 -type ReportOrderUserDistributionGetResponseData struct { +// ReportOrderUserDistributionGetResult 返回值 +type ReportOrderUserDistributionGetResult struct { + // UpdateTime 数据更新时间,格式%Y-%m-%d %H:%M:%S + UpdateTime string `json:"update_time,omitempty"` // Activity 活跃度分布 Activity []KV `json:"activity,omitempty"` // Age 年龄分布 @@ -48,8 +50,6 @@ type ReportOrderUserDistributionGetResponseData struct { Interest []KV `json:"interest,omitempty"` // Province 省份分布 Province []KV `json:"province,omitempty"` - // UpdateTime 数据更新时间,格式%Y-%m-%d %H:%M:%S - UpdateTime string `json:"update_time,omitempty"` } // KV .