feat: add creator report overview export
This commit is contained in:
65
backend/app/http/v1/dto/creator_report.go
Normal file
65
backend/app/http/v1/dto/creator_report.go
Normal file
@@ -0,0 +1,65 @@
|
||||
package dto
|
||||
|
||||
type ReportOverviewFilter struct {
|
||||
// StartAt 统计开始时间(RFC3339,可选;默认当前时间往前 7 天)。
|
||||
StartAt *string `query:"start_at"`
|
||||
// EndAt 统计结束时间(RFC3339,可选;默认当前时间)。
|
||||
EndAt *string `query:"end_at"`
|
||||
// Granularity 统计粒度(day;目前仅支持 day)。
|
||||
Granularity *string `query:"granularity"`
|
||||
}
|
||||
|
||||
type ReportOverviewResponse struct {
|
||||
// Summary 汇总指标。
|
||||
Summary ReportSummary `json:"summary"`
|
||||
// Items 按日期拆分的趋势数据。
|
||||
Items []ReportOverviewItem `json:"items"`
|
||||
}
|
||||
|
||||
type ReportSummary struct {
|
||||
// TotalViews 内容累计曝光(全量累计值,用于粗略换算)。
|
||||
TotalViews int64 `json:"total_views"`
|
||||
// PaidOrders 统计区间内已支付订单数。
|
||||
PaidOrders int64 `json:"paid_orders"`
|
||||
// PaidAmount 统计区间内已支付金额(单位元)。
|
||||
PaidAmount float64 `json:"paid_amount"`
|
||||
// RefundOrders 统计区间内退款订单数。
|
||||
RefundOrders int64 `json:"refund_orders"`
|
||||
// RefundAmount 统计区间内退款金额(单位元)。
|
||||
RefundAmount float64 `json:"refund_amount"`
|
||||
// ConversionRate 转化率(已支付订单数 / 累计曝光)。
|
||||
ConversionRate float64 `json:"conversion_rate"`
|
||||
}
|
||||
|
||||
type ReportOverviewItem struct {
|
||||
// Date 日期(YYYY-MM-DD)。
|
||||
Date string `json:"date"`
|
||||
// PaidOrders 当日已支付订单数。
|
||||
PaidOrders int64 `json:"paid_orders"`
|
||||
// PaidAmount 当日已支付金额(单位元)。
|
||||
PaidAmount float64 `json:"paid_amount"`
|
||||
// RefundOrders 当日退款订单数。
|
||||
RefundOrders int64 `json:"refund_orders"`
|
||||
// RefundAmount 当日退款金额(单位元)。
|
||||
RefundAmount float64 `json:"refund_amount"`
|
||||
}
|
||||
|
||||
type ReportExportForm struct {
|
||||
// StartAt 统计开始时间(RFC3339,可选;默认当前时间往前 7 天)。
|
||||
StartAt *string `json:"start_at"`
|
||||
// EndAt 统计结束时间(RFC3339,可选;默认当前时间)。
|
||||
EndAt *string `json:"end_at"`
|
||||
// Granularity 统计粒度(day;目前仅支持 day)。
|
||||
Granularity *string `json:"granularity"`
|
||||
// Format 导出格式(仅支持 csv)。
|
||||
Format string `json:"format"`
|
||||
}
|
||||
|
||||
type ReportExportResponse struct {
|
||||
// Filename 导出文件名。
|
||||
Filename string `json:"filename"`
|
||||
// MimeType 导出内容类型。
|
||||
MimeType string `json:"mime_type"`
|
||||
// Content 导出内容(CSV 文本)。
|
||||
Content string `json:"content"`
|
||||
}
|
||||
Reference in New Issue
Block a user