147 lines
4.9 KiB
Go
147 lines
4.9 KiB
Go
package dto
|
|
|
|
// DashboardResponse 仪表盘统计响应。
|
|
type DashboardResponse struct {
|
|
Users DashboardUsers `json:"users"`
|
|
Orders DashboardOrders `json:"orders"`
|
|
Revenue DashboardRevenue `json:"revenue"`
|
|
Todo DashboardTodo `json:"todo"`
|
|
Content DashboardContent `json:"content"`
|
|
VIP DashboardVIP `json:"vip"`
|
|
Goods DashboardGoods `json:"goods"`
|
|
Usage DashboardUsage `json:"usage"`
|
|
Social DashboardSocial `json:"social"`
|
|
}
|
|
|
|
// DashboardUsers 用户统计。
|
|
type DashboardUsers struct {
|
|
Total int64 `json:"total"` // 用户总数
|
|
TodayNew int64 `json:"today_new"` // 今日新增
|
|
Normal int64 `json:"normal"` // 正常
|
|
TempBan int64 `json:"temp_ban"` // 临时禁用
|
|
PermBan int64 `json:"perm_ban"` // 永久禁用
|
|
Deactivated int64 `json:"deactivated"` // 已注销
|
|
}
|
|
|
|
// DashboardOrders 订单统计。
|
|
type DashboardOrders struct {
|
|
Total int64 `json:"total"` // 订单总数
|
|
Pending int64 `json:"pending"` // 待支付
|
|
Paid int64 `json:"paid"` // 已支付
|
|
Cancelled int64 `json:"cancelled"` // 已取消
|
|
Expired int64 `json:"expired"` // 已过期
|
|
Refunded int64 `json:"refunded"` // 已退款
|
|
}
|
|
|
|
// DashboardRevenue 营收统计(单位:分)。
|
|
type DashboardRevenue struct {
|
|
TotalRevenue int64 `json:"total_revenue"` // 累计营收
|
|
TodayRevenue int64 `json:"today_revenue"` // 今日营收
|
|
RefundTotal int64 `json:"refund_total"` // 累计退款
|
|
}
|
|
|
|
// DashboardTodo 待办统计。
|
|
type DashboardTodo struct {
|
|
RefundPending int64 `json:"refund_pending"` // 待处理退款
|
|
OutfitPendingAudit int64 `json:"outfit_pending_audit"` // 待审核穿搭
|
|
GoodsOnShelf int64 `json:"goods_on_shelf"` // 上架商品数
|
|
}
|
|
|
|
// ===== 内容审核概况 =====
|
|
|
|
// DashboardContent 内容审核概况。
|
|
type DashboardContent struct {
|
|
Outfit DashboardOutfitStats `json:"outfit"`
|
|
Clothes DashboardClothesStats `json:"clothes"`
|
|
Share DashboardShareStats `json:"share"`
|
|
}
|
|
|
|
// DashboardOutfitStats 穿搭审核统计。
|
|
type DashboardOutfitStats struct {
|
|
Total int64 `json:"total"` // 穿搭总数
|
|
Pending int64 `json:"pending"` // 待审核
|
|
Passed int64 `json:"passed"` // 审核通过
|
|
Rejected int64 `json:"rejected"` // 审核不通过
|
|
Banned int64 `json:"banned"` // 封禁
|
|
}
|
|
|
|
// DashboardClothesStats 衣物图片处理统计。
|
|
type DashboardClothesStats struct {
|
|
Total int64 `json:"total"` // 衣物总数
|
|
Processing int64 `json:"processing"` // 处理中(抠图/分类/排队)
|
|
Success int64 `json:"success"` // 处理成功
|
|
Failed int64 `json:"failed"` // 处理失败
|
|
}
|
|
|
|
// DashboardShareStats 衣柜分享统计。
|
|
type DashboardShareStats struct {
|
|
Total int64 `json:"total"` // 分享总数
|
|
Normal int64 `json:"normal"` // 正常
|
|
Cancelled int64 `json:"cancelled"` // 用户取消
|
|
Expired int64 `json:"expired"` // 已过期
|
|
Banned int64 `json:"banned"` // 管理员封禁
|
|
}
|
|
|
|
// ===== VIP 会员概况 =====
|
|
|
|
// DashboardVIP 会员概况。
|
|
type DashboardVIP struct {
|
|
MemberTotal int64 `json:"member_total"` // 有效会员总数(月度/年度/体验)
|
|
Monthly int64 `json:"monthly"` // 月度会员
|
|
Yearly int64 `json:"yearly"` // 年度会员
|
|
Trial int64 `json:"trial"` // 体验会员
|
|
ExpiringSoon int64 `json:"expiring_soon"` // 7天内即将到期
|
|
}
|
|
|
|
// ===== 商品分类统计 =====
|
|
|
|
// DashboardGoods 商品统计。
|
|
type DashboardGoods struct {
|
|
Total int64 `json:"total"`
|
|
OnShelf int64 `json:"on_shelf"`
|
|
OffShelf int64 `json:"off_shelf"`
|
|
ByType []GoodsTypeCount `json:"by_type"`
|
|
}
|
|
|
|
// GoodsTypeCount 商品类型数量。
|
|
type GoodsTypeCount struct {
|
|
Type int8 `json:"type"` // 1会员包 2上传包 3AI推荐包 4衣柜分享包 5搭配分享包
|
|
Count int64 `json:"count"`
|
|
}
|
|
|
|
// ===== 趋势 =====
|
|
|
|
// TrendRequest 趋势查询参数。
|
|
type TrendRequest struct {
|
|
Days int `form:"days" binding:"omitempty,min=1,max=90"`
|
|
}
|
|
|
|
// TrendResponse 趋势响应。
|
|
type TrendResponse struct {
|
|
Points []TrendPoint `json:"points"`
|
|
}
|
|
|
|
// TrendPoint 单日趋势点。
|
|
type TrendPoint struct {
|
|
Date string `json:"date"` // YYYY-MM-DD
|
|
NewUsers int64 `json:"new_users"` // 新增用户
|
|
Orders int64 `json:"orders"` // 已支付订单量
|
|
Revenue int64 `json:"revenue"` // 营收(分)
|
|
}
|
|
|
|
// ===== 今日消耗与互动 =====
|
|
|
|
// DashboardUsage 今日消耗统计。
|
|
type DashboardUsage struct {
|
|
AIRecommend int64 `json:"ai_recommend"` // 今日AI推荐消耗次数
|
|
ClosetShare int64 `json:"closet_share"` // 今日衣柜分享消耗次数
|
|
OutfitShare int64 `json:"outfit_share"` // 今日社区分享消耗次数
|
|
}
|
|
|
|
// DashboardSocial 内容互动统计。
|
|
type DashboardSocial struct {
|
|
CosImageCount int64 `json:"cos_image_count"` // COS总图数
|
|
LikeCount int64 `json:"like_count"` // 点赞数
|
|
CollectCount int64 `json:"collect_count"` // 收藏数
|
|
}
|