116 lines
4.7 KiB
Go
116 lines
4.7 KiB
Go
package admindashboard
|
|
|
|
import "time"
|
|
|
|
type DashboardDTO struct {
|
|
Metrics MetricsDTO `json:"metrics"`
|
|
Pending PendingDTO `json:"pending"`
|
|
ListingDaily ListingDailyOverviewDTO `json:"listing_daily"`
|
|
TradingDaily TradingDailyOverviewDTO `json:"trading_daily"`
|
|
ManualEntryToday []ManualEntryAgentStatsDTO `json:"manual_entry_today"`
|
|
RecentOrders []RecentOrderDTO `json:"recent_orders"`
|
|
RecentDisputes []RecentDisputeDTO `json:"recent_disputes"`
|
|
GeneratedAt time.Time `json:"generated_at"`
|
|
}
|
|
|
|
type MetricsDTO struct {
|
|
TotalUsers int64 `json:"total_users"`
|
|
VerifiedUsers int64 `json:"verified_users"`
|
|
TotalListings int64 `json:"total_listings"`
|
|
PublishedListings int64 `json:"published_listings"`
|
|
TotalOrders int64 `json:"total_orders"`
|
|
RentingOrders int64 `json:"renting_orders"`
|
|
TodayOrders int64 `json:"today_orders"`
|
|
TodayLedgerAmountCent int64 `json:"today_ledger_amount_cent"`
|
|
}
|
|
|
|
// ListingDailyOverviewDTO 商品上下架统计:今日三组 + 近 7 日趋势。
|
|
type ListingDailyOverviewDTO struct {
|
|
Today ListingDayStatsDTO `json:"today"`
|
|
Trend []ListingDayStatsDTO `json:"trend"`
|
|
TodayChannels []ListingChannelDayStatsDTO `json:"today_channels"`
|
|
ChannelTrend []ListingChannelDayStatsDTO `json:"channel_trend"`
|
|
TodayUploaders []ListingUploaderDayStatsDTO `json:"today_uploaders"`
|
|
UploaderTrend []ListingUploaderDayStatsDTO `json:"uploader_trend"`
|
|
Days int `json:"days"`
|
|
Timezone string `json:"timezone"`
|
|
}
|
|
|
|
type ListingDayStatsDTO struct {
|
|
Date string `json:"date"` // YYYY-MM-DD(上海时区)
|
|
PublishedCount int64 `json:"published_count"`
|
|
ActiveOfflineCount int64 `json:"active_offline_count"` // 号主 + 后台主动下架
|
|
TradeLeaveCount int64 `json:"trade_leave_count"` // rented / completed / sealed / 交易侧归档下架
|
|
}
|
|
|
|
type ListingChannelDayStatsDTO struct {
|
|
Date string `json:"date"` // YYYY-MM-DD(上海时区)
|
|
SourceChannel string `json:"source_channel"`
|
|
PublishedCount int64 `json:"published_count"`
|
|
ActiveOfflineCount int64 `json:"active_offline_count"`
|
|
TradeLeaveCount int64 `json:"trade_leave_count"`
|
|
}
|
|
|
|
type ListingUploaderDayStatsDTO struct {
|
|
Date string `json:"date"` // YYYY-MM-DD(上海时区)
|
|
UploaderID uint64 `json:"uploader_id"`
|
|
UploaderName string `json:"uploader_name"`
|
|
UploadCount int64 `json:"upload_count"`
|
|
}
|
|
|
|
// TradingDailyOverviewDTO 经营成交统计:今日指标 + 近 7 日趋势。
|
|
// 统计口径:已支付订单(status 不在 pending_payment/cancelled/closed),按创建日归属北京时间自然日。
|
|
type TradingDailyOverviewDTO struct {
|
|
Today TradingDayStatsDTO `json:"today"`
|
|
Trend []TradingDayStatsDTO `json:"trend"`
|
|
Days int `json:"days"`
|
|
Timezone string `json:"timezone"`
|
|
}
|
|
|
|
type TradingDayStatsDTO struct {
|
|
Date string `json:"date"` // YYYY-MM-DD(上海时区)
|
|
// PremiumOrderCount 极品专区成交订单数。
|
|
PremiumOrderCount int64 `json:"premium_order_count"`
|
|
// Insurance8OrderCount 选择保险 8% 的成交订单数。
|
|
Insurance8OrderCount int64 `json:"insurance_8_order_count"`
|
|
// Insurance4OrderCount 选择保险 4% 的成交订单数。
|
|
Insurance4OrderCount int64 `json:"insurance_4_order_count"`
|
|
}
|
|
|
|
// ManualEntryAgentStatsDTO 今日客服手动录单统计(按客服聚合)。
|
|
type ManualEntryAgentStatsDTO struct {
|
|
AdminID uint64 `json:"admin_id"`
|
|
AdminName string `json:"admin_name"`
|
|
Count int64 `json:"count"`
|
|
}
|
|
|
|
type PendingDTO struct {
|
|
ListingReviews int64 `json:"listing_reviews"`
|
|
Disputes int64 `json:"disputes"`
|
|
PendingHandoffs int64 `json:"pending_handoffs"`
|
|
PendingReturnConfirms int64 `json:"pending_return_confirms"`
|
|
}
|
|
|
|
type RecentOrderDTO struct {
|
|
ID uint64 `json:"id"`
|
|
OrderNo string `json:"order_no"`
|
|
Title string `json:"title"`
|
|
RenterID uint64 `json:"renter_id"`
|
|
OwnerID uint64 `json:"owner_id"`
|
|
Status string `json:"status"`
|
|
RentAmountCent int64 `json:"rent_amount_cent"`
|
|
DepositAmountCent int64 `json:"deposit_amount_cent"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
type RecentDisputeDTO struct {
|
|
ID uint64 `json:"id"`
|
|
OrderID uint64 `json:"order_id"`
|
|
OrderNo string `json:"order_no"`
|
|
Title string `json:"title"`
|
|
Type string `json:"type"`
|
|
Status string `json:"status"`
|
|
InitiatorID uint64 `json:"initiator_id"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|