78 lines
3.0 KiB
Go
78 lines
3.0 KiB
Go
package response
|
|
|
|
// TrendPoint 折线图通用数据点(日期 + 数量)
|
|
type TrendPoint struct {
|
|
Date string `json:"date"` // 日期 "2026-03-01"
|
|
Count int64 `json:"count"` // 数量
|
|
}
|
|
|
|
// ListeningTrendResponse 收听趋势响应
|
|
type ListeningTrendResponse struct {
|
|
Trend []TrendPoint `json:"trend"` // 每日收听人次趋势
|
|
TotalCount int64 `json:"totalCount"` // 期间总收听次数
|
|
}
|
|
|
|
// SubscriptionTrendResponse 订阅趋势响应
|
|
type SubscriptionTrendResponse struct {
|
|
Trend []TrendPoint `json:"trend"` // 每日新增订阅数趋势
|
|
TotalNewSubs int64 `json:"totalNewSubs"` // 期间新增订阅总数
|
|
}
|
|
|
|
// RenewalTrendResponse 续费趋势响应
|
|
type RenewalTrendResponse struct {
|
|
Trend []TrendPoint `json:"trend"` // 每日续费订单数趋势
|
|
TotalRenewals int64 `json:"totalRenewals"` // 期间续费总数
|
|
}
|
|
|
|
// SubscriberStatsResponse 订阅用户统计响应
|
|
type SubscriberStatsResponse struct {
|
|
ActiveSubscribers int64 `json:"activeSubscribers"` // 当前有效订阅用户数
|
|
ExpiredSubscribers int64 `json:"expiredSubscribers"` // 已过期订阅用户数
|
|
TotalSubscribers int64 `json:"totalSubscribers"` // 历史总订阅用户数(去重)
|
|
ActiveTrend []TrendPoint `json:"activeTrend"` // 每日有效订阅用户数趋势
|
|
}
|
|
|
|
// CompletionRateResponse 内容质量:完播率
|
|
type CompletionRateResponse struct {
|
|
ProgramId string `json:"programId"`
|
|
Title string `json:"title"`
|
|
AvgCompletion float64 `json:"avgCompletion"` // 0.0 - 1.0 平均完播进度
|
|
PlayCount int64 `json:"playCount"` // 总播放样本数
|
|
}
|
|
|
|
// RetentionResponse 用户黏性:留存分析
|
|
type RetentionResponse struct {
|
|
Date string `json:"date"` // 初始日期
|
|
NewUsers int64 `json:"newUsers"` // 该日新增活跃用户数
|
|
Retention []float64 `json:"retention"` // [次日留存, 3日留存, 7日留存, 30日留存]
|
|
}
|
|
|
|
// FunnelResponse 商业转化:漏斗分析
|
|
type FunnelResponse struct {
|
|
ListenUsers int64 `json:"listenUsers"` // 活跃收听用户数
|
|
OrderUsers int64 `json:"orderUsers"` // 尝试下单用户数
|
|
PayUsers int64 `json:"payUsers"` // 支付成功用户数
|
|
LTV float64 `json:"ltv"` // 人均生命周期价值 (Revenue / ListenUsers)
|
|
}
|
|
|
|
// CategoryContribution 偏好探测:品类贡献点
|
|
type CategoryContribution struct {
|
|
CategoryId string `json:"categoryId"`
|
|
CategoryName string `json:"categoryName"`
|
|
ListenCount int64 `json:"listenCount"` // 播放量
|
|
Revenue int64 `json:"revenue"` // 营收(分)
|
|
Share float64 `json:"share"` // 营收占比 (0.0 - 1.0)
|
|
}
|
|
|
|
// PreferenceAnalysisResponse 品类偏好分析响应
|
|
type PreferenceAnalysisResponse struct {
|
|
List []CategoryContribution `json:"list"`
|
|
}
|
|
|
|
// VipStatsResponse VIP统计数据响应
|
|
type VipStatsResponse struct {
|
|
ActiveVipUsers int64 `json:"activeVipUsers"`
|
|
VipRevenue int64 `json:"vipRevenue"`
|
|
NewVipOrders int64 `json:"newVipOrders"`
|
|
}
|