【代码评审】IoT:数据桥梁的接入

This commit is contained in:
YunaiV
2025-03-16 23:44:56 +08:00
parent 79507aef6d
commit c87ed7fe17
12 changed files with 52 additions and 39 deletions

View File

@@ -11,27 +11,27 @@ export interface DeviceGroupVO {
// IoT 设备分组 API
export const DeviceGroupApi = {
// 查询IoT 设备分组分页
// 查询设备分组分页
getDeviceGroupPage: async (params: any) => {
return await request.get({ url: `/iot/device-group/page`, params })
},
// 查询IoT 设备分组详情
// 查询设备分组详情
getDeviceGroup: async (id: number) => {
return await request.get({ url: `/iot/device-group/get?id=` + id })
},
// 新增IoT 设备分组
// 新增设备分组
createDeviceGroup: async (data: DeviceGroupVO) => {
return await request.post({ url: `/iot/device-group/create`, data })
},
// 修改IoT 设备分组
// 修改设备分组
updateDeviceGroup: async (data: DeviceGroupVO) => {
return await request.put({ url: `/iot/device-group/update`, data })
},
// 删除IoT 设备分组
// 删除设备分组
deleteDeviceGroup: async (id: number) => {
return await request.delete({ url: `/iot/device-group/delete?id=` + id })
},

View File

@@ -1,6 +1,6 @@
import request from '@/config/axios'
/** 统计数据类型 */
/** IoT 统计数据类型 */
export interface IotStatisticsSummaryRespVO {
productCategoryCount: number
productCount: number
@@ -16,7 +16,7 @@ export interface IotStatisticsSummaryRespVO {
productCategoryDeviceCounts: Record<string, number>
}
/** 消息统计数据类型 */
/** IoT 消息统计数据类型 */
export interface IotStatisticsDeviceMessageSummaryRespVO {
upstreamCounts: Record<number, number>
downstreamCounts: Record<number, number>
@@ -24,21 +24,18 @@ export interface IotStatisticsDeviceMessageSummaryRespVO {
// IoT 数据统计 API
export const ProductCategoryApi = {
// 查询IoT基础数据统计
// 查询基础数据统计
getIotStatisticsSummary: async () => {
return await request.get<IotStatisticsSummaryRespVO>({
return await request.get<IotStatisticsSummaryRespVO>({
url: `/iot/statistics/get-summary`
})
},
// 查询IoT上下行消息数据统计
getIotStatisticsDeviceMessageSummary: async (params: {
startTime: number
endTime: number
}) => {
return await request.get<IotStatisticsDeviceMessageSummaryRespVO>({
url: `/iot/statistics/get-log-summary`,
params
// 查询设备上下行消息数据统计
getIotStatisticsDeviceMessageSummary: async (params: { startTime: number; endTime: number }) => {
return await request.get<IotStatisticsDeviceMessageSummaryRespVO>({
url: `/iot/statistics/get-log-summary`,
params
})
}
}
}