feat: add creator report overview export

This commit is contained in:
2026-01-13 11:44:29 +08:00
parent 4e35dff05c
commit 19b15bf20a
9 changed files with 1010 additions and 0 deletions

View File

@@ -1878,6 +1878,83 @@
}
}
},
"/t/{tenantCode}/v1/creator/reports/export": {
"post": {
"description": "Export creator report overview",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"CreatorCenter"
],
"summary": "Export report overview",
"parameters": [
{
"description": "Export form",
"name": "form",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.ReportExportForm"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.ReportExportResponse"
}
}
}
}
},
"/t/{tenantCode}/v1/creator/reports/overview": {
"get": {
"description": "Get creator report overview",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"CreatorCenter"
],
"summary": "Report overview",
"parameters": [
{
"type": "string",
"description": "Start time (RFC3339)",
"name": "start_at",
"in": "query"
},
{
"type": "string",
"description": "End time (RFC3339)",
"name": "end_at",
"in": "query"
},
{
"type": "string",
"description": "Granularity (day)",
"name": "granularity",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/dto.ReportOverviewResponse"
}
}
}
}
},
"/t/{tenantCode}/v1/creator/settings": {
"get": {
"description": "Get channel settings",
@@ -4436,6 +4513,118 @@
}
}
},
"dto.ReportExportForm": {
"type": "object",
"properties": {
"end_at": {
"description": "EndAt 统计结束时间RFC3339可选默认当前时间。",
"type": "string"
},
"format": {
"description": "Format 导出格式(仅支持 csv。",
"type": "string"
},
"granularity": {
"description": "Granularity 统计粒度day目前仅支持 day。",
"type": "string"
},
"start_at": {
"description": "StartAt 统计开始时间RFC3339可选默认当前时间往前 7 天)。",
"type": "string"
}
}
},
"dto.ReportExportResponse": {
"type": "object",
"properties": {
"content": {
"description": "Content 导出内容CSV 文本)。",
"type": "string"
},
"filename": {
"description": "Filename 导出文件名。",
"type": "string"
},
"mime_type": {
"description": "MimeType 导出内容类型。",
"type": "string"
}
}
},
"dto.ReportOverviewItem": {
"type": "object",
"properties": {
"date": {
"description": "Date 日期YYYY-MM-DD。",
"type": "string"
},
"paid_amount": {
"description": "PaidAmount 当日已支付金额(单位元)。",
"type": "number"
},
"paid_orders": {
"description": "PaidOrders 当日已支付订单数。",
"type": "integer"
},
"refund_amount": {
"description": "RefundAmount 当日退款金额(单位元)。",
"type": "number"
},
"refund_orders": {
"description": "RefundOrders 当日退款订单数。",
"type": "integer"
}
}
},
"dto.ReportOverviewResponse": {
"type": "object",
"properties": {
"items": {
"description": "Items 按日期拆分的趋势数据。",
"type": "array",
"items": {
"$ref": "#/definitions/dto.ReportOverviewItem"
}
},
"summary": {
"description": "Summary 汇总指标。",
"allOf": [
{
"$ref": "#/definitions/dto.ReportSummary"
}
]
}
}
},
"dto.ReportSummary": {
"type": "object",
"properties": {
"conversion_rate": {
"description": "ConversionRate 转化率(已支付订单数 / 累计曝光)。",
"type": "number"
},
"paid_amount": {
"description": "PaidAmount 统计区间内已支付金额(单位元)。",
"type": "number"
},
"paid_orders": {
"description": "PaidOrders 统计区间内已支付订单数。",
"type": "integer"
},
"refund_amount": {
"description": "RefundAmount 统计区间内退款金额(单位元)。",
"type": "number"
},
"refund_orders": {
"description": "RefundOrders 统计区间内退款订单数。",
"type": "integer"
},
"total_views": {
"description": "TotalViews 内容累计曝光(全量累计值,用于粗略换算)。",
"type": "integer"
}
}
},
"dto.Settings": {
"type": "object",
"properties": {