refactor:【antd】【iot】更新首页必要的 ReqVO、RespVO
This commit is contained in:
@@ -1,21 +1,20 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace IotStatisticsApi {
|
||||
// TODO @haohao:需要跟后端对齐,必要的 ReqVO、RespVO
|
||||
/** 统计摘要数据 */
|
||||
export interface StatisticsSummary {
|
||||
productCategoryCount: number;
|
||||
productCount: number;
|
||||
deviceCount: number;
|
||||
deviceMessageCount: number;
|
||||
productCategoryTodayCount: number;
|
||||
productTodayCount: number;
|
||||
deviceTodayCount: number;
|
||||
deviceMessageTodayCount: number;
|
||||
deviceOnlineCount: number;
|
||||
deviceOfflineCount: number;
|
||||
deviceInactiveCount: number;
|
||||
productCategoryDeviceCounts: Record<string, number>;
|
||||
export interface StatisticsSummaryRespVO {
|
||||
productCategoryCount: number; // 品类数量
|
||||
productCount: number; // 产品数量
|
||||
deviceCount: number; // 设备数量
|
||||
deviceMessageCount: number; // 上报数量
|
||||
productCategoryTodayCount: number; // 今日新增品类数量
|
||||
productTodayCount: number; // 今日新增产品数量
|
||||
deviceTodayCount: number; // 今日新增设备数量
|
||||
deviceMessageTodayCount: number; // 今日新增上报数量
|
||||
deviceOnlineCount: number; // 在线数量
|
||||
deviceOfflineCount: number; // 离线数量
|
||||
deviceInactiveCount: number; // 待激活设备数量
|
||||
productCategoryDeviceCounts: Record<string, number>; // 按品类统计的设备数量
|
||||
}
|
||||
|
||||
/** 时间戳-数值的键值对类型 */
|
||||
@@ -30,15 +29,15 @@ export namespace IotStatisticsApi {
|
||||
downstreamCounts: TimeValueItem[];
|
||||
}
|
||||
|
||||
/** 消息统计数据项(按日期) */
|
||||
export interface DeviceMessageSummaryByDate {
|
||||
time: string;
|
||||
upstreamCount: number;
|
||||
downstreamCount: number;
|
||||
/** 设备消息数量统计(按日期) */
|
||||
export interface DeviceMessageSummaryByDateRespVO {
|
||||
time: string; // 时间轴
|
||||
upstreamCount: number; // 上行消息数量
|
||||
downstreamCount: number; // 下行消息数量
|
||||
}
|
||||
|
||||
/** 消息统计接口参数 */
|
||||
export interface DeviceMessageReq {
|
||||
/** 设备消息统计请求 */
|
||||
export interface DeviceMessageReqVO {
|
||||
interval: number;
|
||||
times?: string[];
|
||||
}
|
||||
@@ -46,26 +45,17 @@ export namespace IotStatisticsApi {
|
||||
|
||||
/** 获取 IoT 统计摘要数据 */
|
||||
export function getStatisticsSummary() {
|
||||
return requestClient.get<IotStatisticsApi.StatisticsSummary>(
|
||||
return requestClient.get<IotStatisticsApi.StatisticsSummaryRespVO>(
|
||||
'/iot/statistics/get-summary',
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取设备消息的数据统计(按日期) */
|
||||
export function getDeviceMessageSummaryByDate(
|
||||
params: IotStatisticsApi.DeviceMessageReq,
|
||||
params: IotStatisticsApi.DeviceMessageReqVO,
|
||||
) {
|
||||
return requestClient.get<IotStatisticsApi.DeviceMessageSummaryByDate[]>(
|
||||
return requestClient.get<IotStatisticsApi.DeviceMessageSummaryByDateRespVO[]>(
|
||||
'/iot/statistics/get-device-message-summary-by-date',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
// TODO @haohao:貌似这里,没用到?是不是后面哪里用,或者可以删除哈?
|
||||
/** 获取设备消息统计摘要 */
|
||||
export function getDeviceMessageSummary(statType: number) {
|
||||
return requestClient.get<IotStatisticsApi.DeviceMessageSummary>(
|
||||
'/iot/statistics/get-device-message-summary',
|
||||
{ params: { statType } },
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user