gomod引用
This commit is contained in:
@@ -1,113 +0,0 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"cid/model/entity"
|
||||
|
||||
"gitee.com/red-future---jilin-g/common/http"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// GetAdStatisticsReq 获取广告统计数据请求
|
||||
type GetAdStatisticsReq struct {
|
||||
g.Meta `path:"/getStatistics" method:"get" tags:"广告统计" summary:"获取广告统计数据" dc:"获取广告的统计数据"`
|
||||
|
||||
// 分页参数
|
||||
http.Page
|
||||
|
||||
// 维度信息
|
||||
StatType string `json:"statType" v:"required"` // 统计类型:广告主、广告、广告位等
|
||||
StatDimension string `json:"statDimension" v:"required"` // 统计维度:小时、天、周、月
|
||||
TargetId string `json:"targetId"` // 目标ID:广告主ID、广告ID、广告位ID等
|
||||
|
||||
// 时间范围
|
||||
StartDate int64 `json:"startDate" v:"required"` // 开始日期
|
||||
EndDate int64 `json:"endDate" v:"required"` // 结束日期
|
||||
|
||||
// 筛选条件
|
||||
DeviceType string `json:"deviceType"` // 设备类型
|
||||
Platform string `json:"platform"` // 平台
|
||||
Region string `json:"region"` // 地区
|
||||
Gender string `json:"gender"` // 性别
|
||||
AgeGroup string `json:"ageGroup"` // 年龄段
|
||||
|
||||
// 排序
|
||||
SortBy string `json:"sortBy"` // 排序字段
|
||||
SortDirection string `json:"sortDirection"` // 排序方向:asc、desc
|
||||
}
|
||||
|
||||
type GetAdStatisticsRes struct {
|
||||
Statistics []*entity.AdStatistics `json:"statistics"`
|
||||
Total int `json:"total"`
|
||||
}
|
||||
|
||||
// GetDashboardReq 获取仪表盘数据请求
|
||||
type GetDashboardReq struct {
|
||||
g.Meta `path:"/getDashboard" method:"get" tags:"广告仪表盘" summary:"获取仪表盘数据" dc:"获取广告系统的仪表盘统计数据"`
|
||||
|
||||
// 时间范围
|
||||
StartDate int64 `json:"startDate" v:"required"` // 开始日期
|
||||
EndDate int64 `json:"endDate" v:"required"` // 结束日期
|
||||
|
||||
// 维度
|
||||
Dimension string `json:"dimension"` // 统计维度:天、周、月
|
||||
}
|
||||
|
||||
type GetDashboardRes struct {
|
||||
// 总览数据
|
||||
Overview OverviewData `json:"overview"`
|
||||
|
||||
// 趋势数据
|
||||
Trends []TrendData `json:"trends"`
|
||||
|
||||
// 排行数据
|
||||
TopAdvertisers []RankData `json:"topAdvertisers"` // 广告主排行
|
||||
TopAds []RankData `json:"topAds"` // 广告排行
|
||||
TopPositions []RankData `json:"topPositions"` // 广告位排行
|
||||
}
|
||||
|
||||
// OverviewData 总览数据
|
||||
type OverviewData struct {
|
||||
TotalAdvertisers int64 `json:"totalAdvertisers"` // 广告主总数
|
||||
TotalAds int64 `json:"totalAds"` // 广告总数
|
||||
TotalPositions int64 `json:"totalPositions"` // 广告位总数
|
||||
TotalImpressions int64 `json:"totalImpressions"` // 总展示次数
|
||||
TotalClicks int64 `json:"totalClicks"` // 总点击次数
|
||||
TotalCost int64 `json:"totalCost"` // 总消耗(分)
|
||||
TotalRevenue int64 `json:"totalRevenue"` // 总收入(分)
|
||||
AverageCTR float64 `json:"averageCTR"` // 平均点击率
|
||||
AverageCVR float64 `json:"averageCVR"` // 平均转化率
|
||||
}
|
||||
|
||||
// TrendData 趋势数据
|
||||
type TrendData struct {
|
||||
Date int64 `json:"date"` // 日期
|
||||
Impressions int64 `json:"impressions"` // 展示次数
|
||||
Clicks int64 `json:"clicks"` // 点击次数
|
||||
Conversions int64 `json:"conversions"` // 转化次数
|
||||
Cost int64 `json:"cost"` // 消耗(分)
|
||||
Revenue int64 `json:"revenue"` // 收入(分)
|
||||
CTR float64 `json:"ctr"` // 点击率
|
||||
CVR float64 `json:"cvr"` // 转化率
|
||||
}
|
||||
|
||||
// RankData 排行数据
|
||||
type RankData struct {
|
||||
Id string `json:"id"` // ID
|
||||
Name string `json:"name"` // 名称
|
||||
Impressions int64 `json:"impressions"` // 展示次数
|
||||
Clicks int64 `json:"clicks"` // 点击次数
|
||||
Cost int64 `json:"cost"` // 消耗(分)
|
||||
Revenue int64 `json:"revenue"` // 收入(分)
|
||||
CTR float64 `json:"ctr"` // 点击率
|
||||
}
|
||||
|
||||
// GenerateDailyStatisticsReq 生成每日统计数据请求
|
||||
type GenerateDailyStatisticsReq struct {
|
||||
g.Meta `path:"/generateDailyStatistics" method:"post" tags:"广告统计" summary:"生成每日统计数据" dc:"手动生成指定日期的广告统计数据"`
|
||||
|
||||
Date int64 `json:"date" v:"required"` // 日期时间戳
|
||||
}
|
||||
|
||||
type GenerateDailyStatisticsRes struct {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
@@ -30,7 +30,7 @@ type AddAdvertisementReq struct {
|
||||
BillingType string `json:"billingType" v:"required"` // 计费类型:CPC、CPM、CPA等
|
||||
|
||||
// 投放条件
|
||||
Targeting *entity.Targeting `json:"targeting"` // 定向条件
|
||||
Targeting *entity.UnifiedTargeting `json:"targeting"` // 定向条件
|
||||
}
|
||||
|
||||
type AddAdvertisementRes struct {
|
||||
@@ -62,7 +62,7 @@ type UpdateAdvertisementReq struct {
|
||||
BillingType string `json:"billingType"` // 计费类型:CPC、CPM、CPA等
|
||||
|
||||
// 投放条件
|
||||
Targeting *entity.Targeting `json:"targeting"` // 定向条件
|
||||
Targeting *entity.UnifiedTargeting `json:"targeting"` // 定向条件
|
||||
|
||||
// 状态信息
|
||||
Status *string `json:"status"` // 广告状态:待审核、审核中、已通过、已拒绝、投放中、已暂停、已结束
|
||||
|
||||
@@ -1,172 +0,0 @@
|
||||
package dto
|
||||
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
// 报表生成请求
|
||||
type ReportGenerateReq struct {
|
||||
g.Meta `path:"/generateReport" method:"post"`
|
||||
TenantID int64 `json:"tenant_id" v:"required"`
|
||||
AppID int64 `json:"app_id"`
|
||||
ReportType string `json:"report_type" v:"required|in:daily,weekly,monthly,quarterly,yearly"`
|
||||
Date string `json:"date"` // 格式: 2024-01-01 (daily), 2024-01 (monthly), 2024-Q1 (quarterly), 2024 (yearly)
|
||||
}
|
||||
|
||||
// 报表生成响应
|
||||
type ReportGenerateResp struct {
|
||||
ReportID string `json:"report_id"`
|
||||
ReportType string `json:"report_type"`
|
||||
ReportDate string `json:"report_date"`
|
||||
Data interface{} `json:"data"`
|
||||
}
|
||||
|
||||
// 报表列表请求
|
||||
type ReportListReq struct {
|
||||
g.Meta `path:"/getReportList" method:"get"`
|
||||
TenantID int64 `json:"tenant_id"`
|
||||
AppID int64 `json:"app_id"`
|
||||
ReportType string `json:"report_type"`
|
||||
StartDate string `json:"start_date"`
|
||||
EndDate string `json:"end_date"`
|
||||
Page int `json:"page" d:"1"`
|
||||
PageSize int `json:"page_size" d:"20"`
|
||||
}
|
||||
|
||||
// 报表列表响应
|
||||
type ReportListResp struct {
|
||||
Reports []*ReportDTO `json:"reports"`
|
||||
Total int `json:"total"`
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
}
|
||||
|
||||
// 报表详情请求
|
||||
type ReportDetailReq struct {
|
||||
g.Meta `path:"/getReportDetail" method:"get"`
|
||||
ReportID int64 `json:"report_id" v:"required"`
|
||||
}
|
||||
type ExportReportReq struct {
|
||||
g.Meta `path:"/exportReport" method:"get"`
|
||||
ReportID int64 `json:"report_id" v:"required"`
|
||||
}
|
||||
|
||||
// 报表详情响应
|
||||
type ReportDetailResp struct {
|
||||
ID int64 `json:"id"`
|
||||
TenantID interface{} `json:"tenant_id"`
|
||||
AppID int64 `json:"app_id"`
|
||||
ReportType string `json:"report_type"`
|
||||
ReportDate string `json:"report_date"`
|
||||
GeneratedAt string `json:"generated_at"`
|
||||
Data interface{} `json:"data"`
|
||||
}
|
||||
|
||||
// 报表DTO
|
||||
type ReportDTO struct {
|
||||
ID int64 `json:"id"`
|
||||
TenantID interface{} `json:"tenant_id"`
|
||||
AppID int64 `json:"app_id"`
|
||||
ReportType string `json:"report_type"`
|
||||
ReportDate string `json:"report_date"`
|
||||
GeneratedAt string `json:"generated_at"`
|
||||
}
|
||||
|
||||
// 统计查询请求
|
||||
type StatQueryReq struct {
|
||||
g.Meta `path:"/queryStats" method:"get"`
|
||||
TenantID int64 `json:"tenant_id" v:"required"`
|
||||
AppID int64 `json:"app_id"`
|
||||
AdType string `json:"ad_type"`
|
||||
Platform string `json:"platform"`
|
||||
Region string `json:"region"`
|
||||
StartDate string `json:"start_date" v:"required"`
|
||||
EndDate string `json:"end_date" v:"required"`
|
||||
Granularity string `json:"granularity" v:"in:daily,weekly,monthly" d:"daily"` // 统计粒度
|
||||
}
|
||||
|
||||
// 统计查询响应
|
||||
type StatQueryResp struct {
|
||||
Data []*StatDataPoint `json:"data"`
|
||||
Summary *StatSummary `json:"summary"`
|
||||
}
|
||||
|
||||
// 统计数据点
|
||||
type StatDataPoint struct {
|
||||
Date string `json:"date"`
|
||||
Impressions int64 `json:"impressions"`
|
||||
Clicks int64 `json:"clicks"`
|
||||
Revenue float64 `json:"revenue"`
|
||||
CTR float64 `json:"ctr"`
|
||||
AvgDuration float64 `json:"avg_duration"`
|
||||
}
|
||||
|
||||
// 统计摘要
|
||||
type StatSummary struct {
|
||||
TotalImpressions int64 `json:"total_impressions"`
|
||||
TotalClicks int64 `json:"total_clicks"`
|
||||
TotalRevenue float64 `json:"total_revenue"`
|
||||
AvgCTR float64 `json:"avg_ctr"`
|
||||
AvgDuration float64 `json:"avg_duration"`
|
||||
GrowthRate *GrowthRate `json:"growth_rate"`
|
||||
}
|
||||
|
||||
// 增长率统计
|
||||
type GrowthRate struct {
|
||||
Impressions float64 `json:"impressions"`
|
||||
Clicks float64 `json:"clicks"`
|
||||
Revenue float64 `json:"revenue"`
|
||||
CTR float64 `json:"ctr"`
|
||||
}
|
||||
|
||||
// 实时统计请求
|
||||
type RealTimeStatReq struct {
|
||||
g.Meta `path:"/realTimeStats" method:"get"`
|
||||
TenantID int64 `json:"tenant_id" v:"required"`
|
||||
AppID int64 `json:"app_id"`
|
||||
Hours int `json:"hours" d:"24"` // 过去多少小时的统计
|
||||
}
|
||||
|
||||
// 实时统计响应
|
||||
type RealTimeStatResp struct {
|
||||
CurrentHour *HourlyStat `json:"current_hour"`
|
||||
Last24Hours []*HourlyStat `json:"last_24_hours"`
|
||||
}
|
||||
|
||||
// 小时统计
|
||||
type HourlyStat struct {
|
||||
Hour string `json:"hour"`
|
||||
Impressions int64 `json:"impressions"`
|
||||
Clicks int64 `json:"clicks"`
|
||||
Revenue float64 `json:"revenue"`
|
||||
}
|
||||
|
||||
// Controller响应结构
|
||||
|
||||
// 生成报表响应
|
||||
type ReportGenerateRes struct {
|
||||
Data *ReportGenerateResp `json:"data"`
|
||||
}
|
||||
|
||||
// 报表列表响应
|
||||
type ReportListRes struct {
|
||||
Data *ReportListResp `json:"data"`
|
||||
}
|
||||
|
||||
// 报表详情响应
|
||||
type ReportDetailRes struct {
|
||||
Data *ReportDetailResp `json:"data"`
|
||||
}
|
||||
|
||||
// 统计查询响应
|
||||
type StatQueryRes struct {
|
||||
Data *StatQueryResp `json:"data"`
|
||||
}
|
||||
|
||||
// 实时统计响应
|
||||
type RealTimeStatRes struct {
|
||||
Data *RealTimeStatResp `json:"data"`
|
||||
}
|
||||
|
||||
// 导出报表响应
|
||||
type ExportReportRes struct {
|
||||
ReportData *ReportDetailResp `json:"report_data"`
|
||||
}
|
||||
Reference in New Issue
Block a user