Skip to content

Commit

Permalink
Merge branch 'release/v1.26.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
bububa committed Aug 19, 2024
2 parents 0b346cf + aedf9d9 commit 8cc4580
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package report

import (
"github.com/bububa/oceanengine/marketing-api/core"
"github.com/bububa/oceanengine/marketing-api/model/qianchuan/report"
)

// LongTransferOrderConfigGet 获取长周期订单明细可用指标和维度
func LongTransferOrderConfigGet(clt *core.SDKClient, accessToken string, req *report.CustomConfigGetRequest) (*report.CustomConfigGetResult, error) {
var resp report.CustomConfigGetResponse
err := clt.Get("v1.0/qianchuan/report/long_transfer/order/config/get/", req, &resp, accessToken)
if err != nil {
return nil, err
}
return resp.Data, nil
}
16 changes: 16 additions & 0 deletions marketing-api/api/qianchuan/report/long_transfer_order_data_get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package report

import (
"github.com/bububa/oceanengine/marketing-api/core"
"github.com/bububa/oceanengine/marketing-api/model/qianchuan/report"
)

// LongTransferOrderDataGet 获取长周期订单数据
func LongTransferOrderDataGet(clt *core.SDKClient, accessToken string, req *report.CustomGetRequest) (*report.CustomGetResult, error) {
var resp report.CustomGetResponse
err := clt.Get("v1.0/qianchuan/report/long_transfer/order/data/get/", req, &resp, accessToken)
if err != nil {
return nil, err
}
return resp.Data, nil
}
16 changes: 16 additions & 0 deletions marketing-api/api/qianchuan/report/today_live_room_config_get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package report

import (
"github.com/bububa/oceanengine/marketing-api/core"
"github.com/bububa/oceanengine/marketing-api/model/qianchuan/report"
)

// TodayLiveRoomConfigGet 获取直播大屏可用指标和维度
func TodayLiveRoomConfigGet(clt *core.SDKClient, accessToken string, req *report.CustomConfigGetRequest) (*report.CustomConfigGetResult, error) {
var resp report.CustomConfigGetResponse
err := clt.Get("v1.0/qianchuan/report/today_live/room/config/get/", req, &resp, accessToken)
if err != nil {
return nil, err
}
return resp.Data, nil
}
16 changes: 16 additions & 0 deletions marketing-api/api/qianchuan/report/today_live_room_data_get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package report

import (
"github.com/bububa/oceanengine/marketing-api/core"
"github.com/bububa/oceanengine/marketing-api/model/qianchuan/report"
)

// TodayLiveRoomDataGet 获取直播大屏数据
func TodayLiveRoomDataGet(clt *core.SDKClient, accessToken string, req *report.CustomGetRequest) (*report.CustomGetResult, error) {
var resp report.CustomGetResponse
err := clt.Get("v1.0/qianchuan/report/today_live/room/data/get/", req, &resp, accessToken)
if err != nil {
return nil, err
}
return resp.Data, nil
}
51 changes: 38 additions & 13 deletions marketing-api/model/qianchuan/aweme/order_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,20 @@ import (

// OrderGetRequest 获取随心推订单列表 API Request
type OrderGetRequest struct {
// AdvertiserID 千川广告主id
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
// Filtering
Filtering *OrderGetFilter `json:"filtering,omitempty"`
// OrderField 排序字段。默认升序 可选值:
// order_create_time 按照创建时间排序
// pay_order_amount 按照成交金额排序
// prepay_and_pay_order_roi 按照支付roi排序
// stat_cost 按照消耗排序
OrderField string `json:"order_field,omitempty"`
// OrderCreateStartTime 计划创建开始时间,格式:"yyyy-mm-dd"
OrderCreateStartTime string `json:"order_create_start_time,omitempty"`
// OrderCreateEndTime 计划创建结束时间,与order_create_start_date搭配使用,格式:"yyyy-mm-dd",时间跨度不能超过180天
OrderCreateEndTime string `json:"order_create_end_time,omitempty"`
// AdvertiserID 千川广告主id
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
// Cursor 页码,默认值:0
Cursor int `json:"cursor,omitempty"`
// Count 页面大小,允许值:10, 20, 50,默认值:10
Expand All @@ -27,14 +37,18 @@ type OrderGetFilter struct {
// LIVE_PROM_GOODS:直播带货
MarketingGoal enum.MarketingGoal `json:"marketing_goal,omitempty"`
// Status 小店订单状态 可选值:
// AUDIT: 审核中
// BOOK: 未开播
// DELIVERY_OK: 投放中
// FINISHED: 投放完成
// FROZEN: 投放终止
// OFFLINE_AUDIT: 审核不通过
// OVER: 投放结束
// UNPAID: 未支付
// AUDIT 审核中
// BOOK 未开播
// CREATING 已支付,计划创建中
// DELIVERY_OK 投放中
// FAILED 计划创建失败
// FINISHED 投放完成
// FROZEN 投放终止
// OFFLINE_AUDIT 审核不通过
// OVER 投放结束
// TIMEOUT 未支付超过15分钟,订单关闭
// UNPAID 未支付
// UNPAIDCANCEL 未支付取消订单
Status qianchuan.OrderStatus `json:"status,omitempty"`
}

Expand All @@ -51,20 +65,31 @@ func (r OrderGetRequest) Encode() string {
if r.Count > 0 {
values.Set("count", strconv.Itoa(r.Count))
}
if r.OrderField != "" {
values.Set("order_field", r.OrderField)
}
if r.OrderCreateStartTime != "" {
values.Set("order_create_start_time", r.OrderCreateStartTime)
}
if r.OrderCreateEndTime != "" {
values.Set("order_create_end_time", r.OrderCreateEndTime)
}
ret := values.Encode()
util.PutUrlValues(values)
return ret
}

// OrderGetResponse 获取随心推订单列表 API Response
type OrderGetResponse struct {
model.BaseResponse
Data *OrderGetResult `json:"data,omitempty"`
model.BaseResponse
}

type OrderGetResult struct {
// List
List []Order `json:"list,omitempty"`
// PageInfo
PageInfo *model.PageInfo `json:"page_info,omitempty"`
// List
List []Order `json:"list,omitempty"`
// FailList 获取失败的订单id列表
FailList []uint64 `json:"fail_list,omitempty"`
}
6 changes: 3 additions & 3 deletions marketing-api/model/qianchuan/report/custom_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ type CustomGetRequest struct {
StartTime string `json:"start_time,omitempty"`
// EndTime 结束时间。格式为:2022-08-01 23:59:59
EndTime string `json:"end_time,omitempty"`
// DataTopics 数据主题,可选值:
// DataTopic 数据主题,可选值:
// ECP_BASIC_DATA 千川平台广告基础数据
// SITE_PROMOTION_POST_DATA_LIVE 全域推广-素材-直播间画面
// SITE_PROMOTION_POST_DATA_VIDEO 全域推广-素材-视频
// SITE_PROMOTION_POST_DATA_OTHER 全域推广-素材-其他创意
// SITE_PROMOTION_POST_DATA_TITLE 全域推广-素材-标题
DataTopics []string `json:"data_topics,omitempty"`
DataTopic string `json:"data_topic,omitempty"`
// Dimensions 维度列表。
// 可通过【获取自定义报表可用维度和指标】接口获取不同数据主题下的可用维度和指标
Dimensions []string `json:"dimensions,omitempty"`
Expand Down Expand Up @@ -69,7 +69,7 @@ type CustomGetOrderBy struct {
func (r CustomGetRequest) Encode() string {
values := util.GetUrlValues()
values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10))
values.Set("data_topics", string(util.JSONMarshal(r.DataTopics)))
values.Set("data_topic", r.DataTopic)
values.Set("dimensions", string(util.JSONMarshal(r.Dimensions)))
values.Set("metrics", string(util.JSONMarshal(r.Metrics)))
if len(r.Filters) > 0 {
Expand Down

0 comments on commit 8cc4580

Please sign in to comment.