页面样式,svg
This commit is contained in:
60
schoolNewsWeb/src/apis/system/overview.ts
Normal file
60
schoolNewsWeb/src/apis/system/overview.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* @description 系统总览相关API
|
||||
*/
|
||||
|
||||
import { api } from '@/apis/index';
|
||||
import type { ResultDomain } from '@/types';
|
||||
|
||||
export interface SystemStatisticsDTO {
|
||||
totalUsers: number;
|
||||
totalUsersChange: string;
|
||||
totalResources: number;
|
||||
totalResourcesChange: string;
|
||||
todayVisits: number;
|
||||
todayVisitsChange: string;
|
||||
activeUsers: number;
|
||||
activeUsersChange: string;
|
||||
}
|
||||
|
||||
export interface ActiveUsersChartDTO {
|
||||
labels: string[];
|
||||
values: number[];
|
||||
}
|
||||
|
||||
export interface ResourceCategoryItemDTO {
|
||||
name: string;
|
||||
value: number;
|
||||
}
|
||||
|
||||
export interface ResourceCategoryStatsDTO {
|
||||
items: ResourceCategoryItemDTO[];
|
||||
}
|
||||
|
||||
export interface TodayVisitsDTO {
|
||||
uv: number;
|
||||
pv: number;
|
||||
avgVisitDuration: string;
|
||||
bounceRate: string;
|
||||
}
|
||||
|
||||
export const systemOverviewApi = {
|
||||
async getStatistics(): Promise<ResultDomain<SystemStatisticsDTO>> {
|
||||
const response = await api.get<SystemStatisticsDTO>('/system/overview/statistics');
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async getActiveUsersChart(start: string, end: string): Promise<ResultDomain<ActiveUsersChartDTO>> {
|
||||
const response = await api.get<ActiveUsersChartDTO>('/system/overview/active-users', { start, end });
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async getResourceCategoryStats(): Promise<ResultDomain<ResourceCategoryStatsDTO>> {
|
||||
const response = await api.get<ResourceCategoryStatsDTO>('/system/overview/resource-category-stats');
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async getTodayVisits(): Promise<ResultDomain<TodayVisitsDTO>> {
|
||||
const response = await api.get<TodayVisitsDTO>('/system/overview/today-visits');
|
||||
return response.data;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user