仪表盘功能完善
This commit is contained in:
@@ -41,12 +41,29 @@ export interface RecentActivity {
|
||||
extraData: Record<string, any>
|
||||
}
|
||||
|
||||
export interface UserGrowthTrend {
|
||||
date: string
|
||||
newUsers: number
|
||||
totalUsers: number
|
||||
}
|
||||
|
||||
export interface RecentLogin {
|
||||
userId: string
|
||||
username: string
|
||||
nickname: string
|
||||
avatar: string
|
||||
loginTime: string
|
||||
timeDescription: string
|
||||
}
|
||||
|
||||
export interface DashboardStats {
|
||||
userStats: UserStats
|
||||
contentStats: ContentStats
|
||||
aiServiceStats: AiServiceStats
|
||||
systemStats: SystemStats
|
||||
recentActivities: RecentActivity[]
|
||||
userGrowthTrends: UserGrowthTrend[]
|
||||
recentLogins: RecentLogin[]
|
||||
updateTime: string
|
||||
}
|
||||
|
||||
@@ -98,4 +115,26 @@ export function getSystemStats() {
|
||||
url: '/admin/dashboard/system-stats',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户增长趋势数据
|
||||
*/
|
||||
export function getUserGrowthTrends(days: number = 7) {
|
||||
return request<UserGrowthTrend[]>({
|
||||
url: '/admin/dashboard/user-growth-trends',
|
||||
method: 'get',
|
||||
params: { days }
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取最近登录用户
|
||||
*/
|
||||
export function getRecentLogins(limit: number = 10) {
|
||||
return request<RecentLogin[]>({
|
||||
url: '/admin/dashboard/recent-logins',
|
||||
method: 'get',
|
||||
params: { limit }
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user