Skip to content

Commit

Permalink
Merge branch 'release/v1.20.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
bububa committed Oct 27, 2023
2 parents a301683 + b94ab23 commit 17fc059
Show file tree
Hide file tree
Showing 25 changed files with 581 additions and 82 deletions.
9 changes: 9 additions & 0 deletions marketing-api/OCEANENGINE.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,15 @@
- 查询安卓应用母包 [ AndroidBasicPackageGet(clt *core.SDKClient, accessToken string, req *appmanagement.AndroidBasicPackageGetRequest) (*appmanagement.AndroidBasicPackageGetResult, error) ]
- 更新安卓应用母包 [ AndroidBasicPackageUpdate(clt *core.SDKClient, accessToken string, req *appmanagement.AndroidBasicPackageUpdateRequest) error ]
- 发布安卓应用母包 [ 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策略 [ 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) ]
- 获取站内媒体RTA联合实验数据(分时t+5) [ RtaExpLocalHourlyGet(clt *core.SDKClient, accessToken string, req *rta.RtaExpLocalHourlyGetRequest) ([]rta.Report, error) ]
- 获取站内媒体RTA联合实验数据(分天t+1)[ RtaExpLocalDailyGet(clt *core.SDKClient, accessToken string, req *rta.RtaExpLocalDailyGetRequest) ([]rta.GetRtaExpLocalDailyData, error) ]
- 获取RTA策略绑定信息列表 [ ScopeGet(clt *core.SDKClient, accessToken string, req *rta.ScopeGetRequest) ([]rta.Scope, error) ]
- 评论管理 (tools/comment)
- 获取评论列表 [ Get(clt *core.SDKClient, accessToken string, req *comment.GetRequest) (*comment.GetResponseData, error) ]
- 获取评论回复列表 [ ReplyGet(clt *core.SDKClient, accessToken string, req *comment.ReplyGetRequest) (*comment.ReplyGetResponseData, error) ]
Expand Down
15 changes: 0 additions & 15 deletions marketing-api/api/rta/rta_exp_local_daily.go

This file was deleted.

2 changes: 2 additions & 0 deletions marketing-api/api/tools/rta/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package rta RTA策略管理
package rta
15 changes: 15 additions & 0 deletions marketing-api/api/tools/rta/get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package rta

import (
"github.com/bububa/oceanengine/marketing-api/core"
"github.com/bububa/oceanengine/marketing-api/model/tools/rta"
)

// Get 获取可用的RTA策略
func Get(clt *core.SDKClient, accessToken string, req *rta.GetRequest) ([]rta.RtaInfo, error) {
var resp rta.GetResponse
if err := clt.Get("2/tools/rta/get/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data.List, nil
}
15 changes: 15 additions & 0 deletions marketing-api/api/tools/rta/get_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package rta

import (
"github.com/bububa/oceanengine/marketing-api/core"
"github.com/bububa/oceanengine/marketing-api/model/tools/rta"
)

// GetInfo 获取RTA策略数据 API Response
func GetInfo(clt *core.SDKClient, accessToken string, req *rta.GetInfoRequest) (*rta.GetInfoData, error) {
var resp rta.GetInfoResponse
if err := clt.Get("2/tools/rta/get_info/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data, nil
}
17 changes: 17 additions & 0 deletions marketing-api/api/tools/rta/rta_exp_get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package rta

import (
"github.com/bububa/oceanengine/marketing-api/core"
"github.com/bububa/oceanengine/marketing-api/model/tools/rta"
)

// ExpGet 获取穿山甲渠道RTA联合实验数据
// 功能
// 该接口用于查询穿山甲渠道的RTA联合实验数据
func RtaExpGet(clt *core.SDKClient, accessToken string, req *rta.RtaExpGetRequest) ([]rta.Report, error) {
var resp rta.RtaExpGetResponse
if err := clt.Get("2/report/rta_exp/get/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data.Data, nil
}
18 changes: 18 additions & 0 deletions marketing-api/api/tools/rta/rta_exp_local_daily.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package rta

import (
"github.com/bububa/oceanengine/marketing-api/core"
"github.com/bububa/oceanengine/marketing-api/model/tools/rta"
)

// RtaExpLocalDailyGet 获取站内媒体RTA联合实验数据分天(t+1)
// 功能
// 该接口用于查询站内媒体渠道的RTA联合实验数据,支持分天t+1级别数据
// 注:由于数据更新时间存在波动性,建议在查询当日上午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 {
return nil, err
}
return resp.Data.Data, nil
}
17 changes: 17 additions & 0 deletions marketing-api/api/tools/rta/rta_exp_local_hourly.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package rta

import (
"github.com/bububa/oceanengine/marketing-api/core"
"github.com/bububa/oceanengine/marketing-api/model/tools/rta"
)

// RtaExpLocalHourlyGet 获取站内媒体RTA联合实验数据(分时t+5)
// 功能
// 该接口用于查询站内媒体渠道的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 {
return nil, err
}
return resp.Data.Data, nil
}
16 changes: 16 additions & 0 deletions marketing-api/api/tools/rta/scope_get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package rta

import (
"github.com/bububa/oceanengine/marketing-api/core"
"github.com/bububa/oceanengine/marketing-api/model/tools/rta"
)

// ScopeGet 获取RTA策略绑定信息列表
// 获取RTA策略下的项目(广告组)列表,一个rta策略要么绑定campaign要么绑定project,不可能同时绑定
func ScopeGet(clt *core.SDKClient, accessToken string, req *rta.ScopeGetRequest) ([]rta.Scope, error) {
var resp rta.ScopeGetResponse
if err := clt.Get("2/tools/rta/scope/get/", req, &resp, accessToken); err != nil {
return nil, err
}
return resp.Data.List, nil
}
12 changes: 12 additions & 0 deletions marketing-api/api/tools/rta/set_scope.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package rta

import (
"github.com/bububa/oceanengine/marketing-api/core"
"github.com/bububa/oceanengine/marketing-api/model/tools/rta"
)

// SetScope 设置账户下RTA策略生效范围
// 设置广告账户下某个RTA策略的生效范围,设置一个新的RTA策略时,默认为停用状态,需要继续调用修改RTA策略状态
func SetScope(clt *core.SDKClient, accessToken string, req *rta.SetScopeRequest) error {
return clt.Post("2/tools/rta/set_scope/", req, nil, accessToken)
}
12 changes: 12 additions & 0 deletions marketing-api/api/tools/rta/status_update.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package rta

import (
"github.com/bububa/oceanengine/marketing-api/core"
"github.com/bububa/oceanengine/marketing-api/model/tools/rta"
)

// StatusUpdate 批量启停账户下RTA策略
// 修改RTA策略状态
func StatusUpdate(clt *core.SDKClient, accessToken string, req *rta.StatusUpdateRequest) error {
return clt.Post("2/tools/rta/status_update/", req, nil, accessToken)
}
11 changes: 11 additions & 0 deletions marketing-api/enum/rta_status.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package enum

// RtaStatus 目标状态
type RtaStatus string

const (
// RtaStatus_ENABLE 启用
RtaStatus_ENABLE RtaStatus = "ENABLE"
// RtaStatus_DISABLE 停用
RtaStatus_DISABLE RtaStatus = "DISABLE"
)
13 changes: 13 additions & 0 deletions marketing-api/enum/rta_target_type.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package enum

// RtaTargetType 生效维度
type RtaTargetType string

const (
// RtaTargetType_ADV 广告账户
RtaTargetType_ADV RtaTargetType = "ADV"
// RtaTargetType_CAMPAIGN 广告组
RtaTargetType_CAMPAIGN RtaTargetType = "CAMPAIGN"
// RtaTargetType_PROJECT 项目(体验版)
RtaTargetType_PROJECT RtaTargetType = "PROJECT"
)
67 changes: 0 additions & 67 deletions marketing-api/model/rta/rta_exp_local_daily.go

This file was deleted.

2 changes: 2 additions & 0 deletions marketing-api/model/tools/rta/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package rta RTA策略管理
package rta
32 changes: 32 additions & 0 deletions marketing-api/model/tools/rta/get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package rta

import (
"strconv"

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

// GetRequest 获取可用的RTA策略 API Request
type GetRequest struct {
// AdvertiserID 广告主ID
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
}

// Encode implement GetRequest interface
func (r GetRequest) Encode() string {
values := util.GetUrlValues()
values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10))
ret := values.Encode()
util.PutUrlValues(values)
return ret
}

// GetResponse 获取可用的RTA策略 API Response
type GetResponse struct {
model.BaseResponse
Data struct {
// List 可用的RTA策略列表
List []RtaInfo `json:"list,omitempty"`
} `json:"data,omitempty"`
}
65 changes: 65 additions & 0 deletions marketing-api/model/tools/rta/get_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package rta

import (
"strconv"

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

// GetInfoRequest 获取RTA策略数据 API Request
type GetInfoRequest struct {
// AdvertiserID 广告主ID
AdvertiserID uint64 `json:"advertiser_id,omitempty"`
// CampaignID 广告组id,若传入,则拉取的是组维度的RTA策略
CampaignID uint64 `json:"campaign_id,omitempty"`
}

// Encode implement GetRequest interface
func (r GetInfoRequest) Encode() string {
values := util.GetUrlValues()
values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10))
values.Set("campaign_id", strconv.FormatUint(r.CampaignID, 10))
ret := values.Encode()
util.PutUrlValues(values)
return ret
}

// GetInfoResponse 获取RTA策略数据 API Response
type GetInfoResponse struct {
model.BaseResponse
Data *GetInfoData `json:"data,omitempty"`
}

type GetInfoData struct {
// InterfaceInfo RTA配置数据
InterfaceInfo *InterfaceInfo `json:"interface_info,omitempty"`
// RtaInfo RTA策略信息
RtaInfo *RtaInfo `json:"rta_info,omitempty"`
}

// InterfaceInfo RTA配置数据
type InterfaceInfo struct {
// Status 接口地址状态
// 1:生效 0:失效
Status int `json:"status,omitempty"`
// DeliveryRange 适用流量范围:
// LOCAL_ONLY: 站内
// UNION_ONLY: 穿山甲
// UNIVERSAL_DELIVERY: 全部
DeliveryRange string `json:"delivery_range,omitempty"`
// LocalQPS 站内QPS
LocalQPS int64 `json:"local_qps,omitempty"`
// UnionQPS 穿山甲QPS
UnionQPS int64 `json:"union_qps,omitempty"`
// URL 接口地址
URL string `json:"url,omitempty"`
}

// RtaInfo RTA策略信息
type RtaInfo struct {
// RtaID RTA策略ID
RtaID uint64 `json:"rta_id,omitempty"`
// Remark 备注,即RTA策略描述
Remark string `json:"remark,omitempty"`
}
26 changes: 26 additions & 0 deletions marketing-api/model/tools/rta/report.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package rta

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

type Report struct {
// Date 数据统计日期,格式YYYYMMDDHH
Date string `json:"date,omitempty"`
// VID 联合实验组唯一标识
VID int `json:"vid,omitempty"`
// CusVID 客户自行开分桶实验的唯一标识
CusVID int `json:"cus_vid,omitempty"`
// Strategy 联合实验策略,请求入参
Strategy model.Int `json:"strategy,omitempty"`
// Click 展现数据-点击数。当头条用户点击广告素材时,触发点击事件,该事件被认为是一次有效的广告点击
Click int64 `json:"click,omitempty"`
// Show 展现数据-展示数。广告展示给用户的次数。计算方式:经平台判定有效且被计费的展示次数
Show int64 `json:"show,omitempty"`
// Convert 转化数据-转化数。将转化数记录在转化事件发生的时间上。建议广告主考核成本时参考“转化数据(计费时间)”例如您的广告在早上8点进行了展示和点击,用户晚上19点发生了激活行为,我们会把激活数披露在晚上19点
Convert int64 `json:"convert,omitempty"`
// Cost 展现数据-总花费。表示广告在投放期内的预估花费金额
Cost float64 `json:"cost,omitempty"`
// BidCoef 返回RTA出价系数的区间值
BidCoef string `json:"bid_coef,omitempty"`
// WinRatio 竞胜率。竞胜率=竞胜数/参竞数,代表广告主参竞请求的胜出比例,范围 0~1
WinRatio float64 `json:"win_ratio,omitempty"`
}
Loading

0 comments on commit 17fc059

Please sign in to comment.