import axiosInstance from "@/api/axios.ts";
import type {ISystemInfoVo} from "@/interface/page/home/ISystemInfoVo.ts";

export default class HomeApi {

    // 获取服务器数据
    static queryServeData() {
        return axiosInstance.get<ISystemInfoVo>('/app/system/querySystemInfo');
    };
    // 创建消息通知连接
    static createNoticeConnect() {
        return new EventSource(axiosInstance.defaults.baseURL + '/app/system/acceptInfo')
    };
    // 查询库存占用率
    static queryStockOccupancyRate() {
        return axiosInstance.get('/app/system/queryStockUsage');
    };
    // 查询今天出入库数量
    static queryTodayInOutStock() {
        return axiosInstance.get('/app/system/queryTodayInOutCount');
    };
    // 查询近七日设备故障数量
    static querySevenDaysDeviceFailure() {
        return axiosInstance.get('/app/system/querySevenDaysDeviceFailure');
    };
    // 查询近七日出入库数量
    static querySevenDaysInOutStock() {
        return axiosInstance.get('/app/system/querySevenDaysInOutCount');
    }
}