feat:【IoT 物联网】设备消息统计的代码优化

This commit is contained in:
YunaiV
2025-06-14 17:15:07 +08:00
parent 108782ba80
commit 69cf5d01db
8 changed files with 147 additions and 294 deletions

View File

@@ -28,19 +28,32 @@ export interface IotStatisticsDeviceMessageSummaryRespVO {
downstreamCounts: TimeValueItem[]
}
/** 新的消息统计数据项 */
export interface IotStatisticsDeviceMessageSummaryByDateRespVO {
time: string
upstreamCount: number
downstreamCount: number
}
/** 新的消息统计接口参数 */
export interface IotStatisticsDeviceMessageReqVO {
interval: number
times?: string[]
}
// IoT 数据统计 API
export const ProductCategoryApi = {
// 查询基础的数据统计
getIotStatisticsSummary: async () => {
export const StatisticsApi = {
// 查询全局的数据统计
getStatisticsSummary: async () => {
return await request.get<IotStatisticsSummaryRespVO>({
url: `/iot/statistics/get-summary`
})
},
// 查询设备上下行消息的数据统计
getIotStatisticsDeviceMessageSummary: async (params: { startTime: number; endTime: number }) => {
return await request.get<IotStatisticsDeviceMessageSummaryRespVO>({
url: `/iot/statistics/get-log-summary`,
// 获取设备消息的数据统计
getDeviceMessageSummaryByDate: async (params: IotStatisticsDeviceMessageReqVO) => {
return await request.get<IotStatisticsDeviceMessageSummaryByDateRespVO[]>({
url: `/iot/statistics/get-device-message-summary-by-date`,
params
})
}