-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
719 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package offline | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/bububa/spotlight-mapi/core" | ||
"github.com/bububa/spotlight-mapi/model/report/offline" | ||
) | ||
|
||
// Advertiser 账户层级离线数据 | ||
func Advertiser(ctx context.Context, clt *core.SDKClient, req *offline.Request, accessToken string) (*offline.ReportList, error) { | ||
var resp offline.Response | ||
if err := clt.Post(ctx, "/jg/data/report/offline/account", req, &resp, accessToken); err != nil { | ||
return nil, err | ||
} | ||
return resp.Data, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package offline | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/bububa/spotlight-mapi/core" | ||
"github.com/bububa/spotlight-mapi/model/report/offline" | ||
) | ||
|
||
// Campaign 广告计划层级离线数据 | ||
func Campaign(ctx context.Context, clt *core.SDKClient, req *offline.Request, accessToken string) (*offline.ReportList, error) { | ||
var resp offline.Response | ||
if err := clt.Post(ctx, "/jg/data/report/offline/campaign", req, &resp, accessToken); err != nil { | ||
return nil, err | ||
} | ||
return resp.Data, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package offline | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/bububa/spotlight-mapi/core" | ||
"github.com/bububa/spotlight-mapi/model/report/offline" | ||
) | ||
|
||
// Creativity 广告创意层级离线数据 | ||
func Creativity(ctx context.Context, clt *core.SDKClient, req *offline.Request, accessToken string) (*offline.ReportList, error) { | ||
var resp offline.Response | ||
if err := clt.Post(ctx, "/jg/data/report/offline/creativity", req, &resp, accessToken); err != nil { | ||
return nil, err | ||
} | ||
return resp.Data, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Package offline 离线报表 | ||
package offline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package offline | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/bububa/spotlight-mapi/core" | ||
"github.com/bububa/spotlight-mapi/model/report/offline" | ||
) | ||
|
||
// Keyword 关键词层级离线数据 | ||
func Keyword(ctx context.Context, clt *core.SDKClient, req *offline.Request, accessToken string) (*offline.ReportList, error) { | ||
var resp offline.Response | ||
if err := clt.Post(ctx, "/jg/data/report/offline/keyword", req, &resp, accessToken); err != nil { | ||
return nil, err | ||
} | ||
return resp.Data, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package offline | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/bububa/spotlight-mapi/core" | ||
"github.com/bububa/spotlight-mapi/model/report/offline" | ||
) | ||
|
||
// Unit 广告单元层级离线数据 | ||
func Unit(ctx context.Context, clt *core.SDKClient, req *offline.Request, accessToken string) (*offline.ReportList, error) { | ||
var resp offline.Response | ||
if err := clt.Post(ctx, "/jg/data/report/offline/unit", req, &resp, accessToken); err != nil { | ||
return nil, err | ||
} | ||
return resp.Data, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package realtime | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/bububa/spotlight-mapi/core" | ||
"github.com/bububa/spotlight-mapi/model/report/realtime" | ||
) | ||
|
||
// Campaign 计划层级实时数据 | ||
func Campaign(ctx context.Context, clt *core.SDKClient, req *realtime.CampaignRequest, accessToken string) (*realtime.CampaignResponse, error) { | ||
resp := new(realtime.CampaignResponse) | ||
if err := clt.Post(ctx, "/jg/data/report/realtime/campaign", req, resp, accessToken); err != nil { | ||
return nil, err | ||
} | ||
return resp, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package realtime | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/bububa/spotlight-mapi/core" | ||
"github.com/bububa/spotlight-mapi/model/report/realtime" | ||
) | ||
|
||
// Creativity 创意层级实时数据 | ||
func Creativity(ctx context.Context, clt *core.SDKClient, req *realtime.CreativityRequest, accessToken string) (*realtime.CreativityResponse, error) { | ||
resp := new(realtime.CreativityResponse) | ||
if err := clt.Post(ctx, "/jg/data/report/realtime/creativity", req, resp, accessToken); err != nil { | ||
return nil, err | ||
} | ||
return resp, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package realtime | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/bububa/spotlight-mapi/core" | ||
"github.com/bububa/spotlight-mapi/model/report/realtime" | ||
) | ||
|
||
// Keyword 关键词层级实时数据 | ||
func Keyword(ctx context.Context, clt *core.SDKClient, req *realtime.KeywordRequest, accessToken string) (*realtime.KeywordResponse, error) { | ||
resp := new(realtime.KeywordResponse) | ||
if err := clt.Post(ctx, "/jg/data/report/realtime/keyword", req, resp, accessToken); err != nil { | ||
return nil, err | ||
} | ||
return resp, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package realtime | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/bububa/spotlight-mapi/core" | ||
"github.com/bububa/spotlight-mapi/model/report/realtime" | ||
) | ||
|
||
// Unit 单元层级实时数据 | ||
func Unit(ctx context.Context, clt *core.SDKClient, req *realtime.UnitRequest, accessToken string) (*realtime.UnitResponse, error) { | ||
resp := new(realtime.UnitResponse) | ||
if err := clt.Post(ctx, "/jg/data/report/realtime/unit", req, resp, accessToken); err != nil { | ||
return nil, err | ||
} | ||
return resp, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package enum | ||
|
||
// SortType 升降序asc:升序desc:降序 | ||
type SortType string | ||
|
||
const ( | ||
SortType_ASC SortType = "asc" | ||
SortType_DESC SortType = "desc" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package enum | ||
|
||
// TimeUnit 时间维度 | ||
type TimeUnit string | ||
|
||
const ( | ||
// TimeUnit_DAY 分天 | ||
TimeUnit_DAY TimeUnit = "DAY" | ||
// TimeUnit_HOUR 分时 | ||
TimeUnit_HOUR TimeUnit = "HOUR" | ||
// TimeUnit_SUMMARY 汇总,默认分天 | ||
TimeUnit_SUMMARY TimeUnit = "SUMMARY" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Package offline 离线报表 | ||
package offline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
package offline | ||
|
||
import ( | ||
"github.com/bububa/spotlight-mapi/enum" | ||
"github.com/bububa/spotlight-mapi/util" | ||
) | ||
|
||
// Request 离线报表数据 API Request | ||
type Request struct { | ||
// AdvertiserID 广告主ID | ||
AdvertiserID string `json:"advertiser_id"` | ||
// StartDate 开始时间,格式 yyyy-MM-dd | ||
StartDate string `json:"start_date,omitempty"` | ||
// EndDate 结束时间,格式 yyyy-MM-dd | ||
EndDate string `json:"end_date,omitempty"` | ||
// TimeUnit 时间维度: | ||
// "DAY":分天 | ||
// "HOUR":分时 | ||
// "SUMMARY":汇总,默认分天 | ||
TimeUnit enum.TimeUnit `json:"time_unit,omitempty"` | ||
// SortColumn 排序字段见附录column字段 | ||
SortColumn string `json:"sort_column,omitempty"` | ||
// Sort 升降序asc:升序desc:降序 | ||
Sort enum.SortType `json:"sort,omitempty"` | ||
// PageNum 页数,默认1 | ||
PageNum int64 `json:"page_num,omitempty"` | ||
// PageSize 页大小,默认20,最大1000 | ||
PageSize int64 `json:"page_size,omitempty"` | ||
// MarketingStrategy 营销诉求过滤条件: | ||
// 3:商品销售日常推广 | ||
// 4:产品种草 | ||
// 8:直播推广_日常推广 | ||
// 9:客资收集 | ||
// 10:抢占赛道 | ||
// 14:直播推广_直播预热 | ||
MarketingStrategy []int `json:"marketing_strategy,omitempty"` | ||
// BiddingStrategy 出价方式过滤条件:2:手动出价3:自动出价 | ||
BiddingStrategy []int `json:"bidding_strategy,omitempty"` | ||
// OptimizeTarget 推广目标过滤条件: | ||
// 0:点击量 | ||
// 1:互动量 | ||
// 3:表单提交量 | ||
// 4:商品成单量 | ||
// 5:私信咨询量 | ||
// 6:直播间观看量 | ||
// 11:商品访客量 | ||
// 12:落地页访问量 | ||
// 13:私信开口量 | ||
// 14:有效观看量 | ||
// 18:站外转化量 | ||
// 20:TI人群规模 | ||
// 21:行业商品成单 | ||
// 23:直播预热量 | ||
// 24:直播间成交 | ||
// 25:直播间支付ROI | ||
OptimizeTarget []int `json:"optimize_target,omitempty"` | ||
// Placement 广告类型过滤条件 | ||
// 1:信息流推广 | ||
// 2:搜索推广 | ||
// 4:全站智投 | ||
// 7:视频内流 | ||
Placement []int `json:"placement,omitempty"` | ||
// PromotionTarget 推广标的类型过滤条件 | ||
// 1:笔记 | ||
// 2:商品 | ||
// 9:落地页 | ||
// 18:直播间 | ||
// 商品、落地页、直播间笔记只能三选一 | ||
PromotionTarget []int `json:"promotion_target,omitempty"` | ||
// BuildType 搭建方式过滤条件 | ||
// 0:标准搭建 | ||
// 1:省心智投 | ||
BuildType []int `json:"build_type,omitempty"` | ||
// SplitColumns 细分条件(相当于group by) | ||
// marketingTarget:营销诉求 | ||
// buildType:搭建方式 | ||
// placement:广告类型 | ||
// optimizeTarget:推广目标 | ||
// biddingStrategy:出价方式 | ||
// promotionTarget:推广标的类型 | ||
// jumpType:创意跳转类型 | ||
// itemId:商品 | ||
// pageId:落地页 | ||
// liveRedId:直播间笔记 | ||
// keyword:关键词 | ||
SplitColumns []string `json:"split_columns,omitempty"` | ||
// Programmatic 创意组合方式过滤条件 | ||
// 0:自定义创意 | ||
// 1:程序化创意 | ||
Programmatic []int `json:"programmatic,omitempty"` | ||
// MarketingTarget 营销诉求过滤条件:3:商品销量_日常推广4:产品种草8:直播推广_日常推广9:客资收集10:抢占赛道14:直播推广_直播预热 | ||
MarketingTarget []int `json:"marketing_target,omitempty"` | ||
} | ||
|
||
// Encode implement PostRequest interface | ||
func (r Request) Encode() []byte { | ||
return util.JSONMarshal(r) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package offline | ||
|
||
import ( | ||
"github.com/bububa/spotlight-mapi/model" | ||
"github.com/bububa/spotlight-mapi/model/report" | ||
) | ||
|
||
// Response 离线数据 API Response | ||
type Response struct { | ||
model.BaseResponse | ||
Data *ReportList `json:"data,omitempty"` | ||
} | ||
|
||
// ReportList 离线数据列表 | ||
type ReportList struct { | ||
List []Report `json:"data_list,omitempty"` | ||
TotalCount int64 `json:"total_count,omitempty"` | ||
} | ||
|
||
// Report 离线数据报表 | ||
type Report struct { | ||
Dimension | ||
report.DataReportDTO | ||
} | ||
|
||
type Dimension struct { | ||
// Time 时间 | ||
Time string `json:"time,omitempty"` | ||
// CampaignID 计划id | ||
CampaignID model.Uint64 `json:"campaign_id,omitempty"` | ||
// CampaignName 计划名称 | ||
CampaignName string `json:"campaign_name,omitempty"` | ||
// UnitID 单元id | ||
UnitID model.Uint64 `json:"unit_id,omitempty"` | ||
// UnitName 单元名称 | ||
UnitName string `json:"unit_name,omitempty"` | ||
// CreativityID 创意id | ||
CreativityID model.Uint64 `json:"creativity_id,omitempty"` | ||
// CreativityName 创意名称 | ||
CreativityName string `json:"creativity_name,omitempty"` | ||
// CreativityImage 创意图片 | ||
CreativityImage string `json:"creativity_image,omitempty"` | ||
// Keyword 关键词 | ||
Keyword string `json:"keyword,omitempty"` | ||
// Placement 广告类型 | ||
Placement model.Int `json:"placement,omitempty"` | ||
// OptimizeTarget 优化目标 | ||
OptimizeTarget model.Int `json:"optimize_target,omitempty"` | ||
// PromotionTarget 推广标的 | ||
PromotionTarget model.Int `json:"promotion_target,omitempty"` | ||
// BiddingStrategy 出价方式 | ||
BiddingStrategy model.Int `json:"bidding_strategy,omitempty"` | ||
// BuildType 搭建类型 | ||
BuildType model.Int `json:"build_type,omitempty"` | ||
// MarketingTarget 营销诉求 | ||
MarketingTarget model.Int `json:"marketing_target,omitempty"` | ||
// NoteID 笔记id | ||
NoteID string `json:"note_id,omitempty"` | ||
// PageID 落地页id | ||
PageID string `json:"page_id,omitempty"` | ||
// ItemID 商品id | ||
ItemID string `json:"item_id,omitempty"` | ||
// LiveRedID 直播间id | ||
LiveRedID string `json:"live_red_id,omitempty"` | ||
} |
Oops, something went wrong.