import { request } from '/@/utils/service';
import { UserPageQuery, AddReq, DelReq, EditReq, InfoReq } from '@fast-crud/fast-crud';

export const apiPrefix = '/api/system/dashboard/';
export function GetList() {
	return request({
		url: apiPrefix,
		method: 'get',
	});
}

export function GetOverviewList() {
	return request({
		url: apiPrefix+'overview_stats/',
		method: 'get',
	});
}

export function GetDeviceRankList() {
	return request({
		url: apiPrefix+'device_rankings/',
		method: 'get',
	});
}


export function GetBorrowRanking(params:object) {
	return request({
		url: apiPrefix+'device_rankings/',
		method: 'get',
		params:params
	});
}

/* 复合接口 */

export function GetBorrowRankingComposite(params:object) {
	return request({
		url: '/api/system/dashboard/combined_dashboard/',
		method: 'get',
		params:params
	});
}



export function GetUtilizationList() {
	return request({
		url: apiPrefix+'utilization_trend/',
		method: 'get',
	});
}


export function GetBorrowTrends(obj:string) {
	return request({
		url: apiPrefix+'borrow_trends/?period='+obj,
		// url: apiPrefix+'borrow_trends/',
		method: 'get',
	});
}

export function GetActiveUsers() {
	return request({
		url: apiPrefix+'active_users/',
		method: 'get',
	});
}

/* 待处理接口 /api/system/borrow/application/dashboard_statistics/*/

export function dashboardStatistics() {
	return request({
		url: '/api/system/borrow/application/dashboard_statistics/',
		// url: apiPrefix+'borrow_trends/',
		method: 'get',
	});
}



