feat;simulator

This commit is contained in:
alwayssuper
2025-01-05 22:57:10 +08:00
parent 5e8aad7703
commit b71fa84af3
3 changed files with 135 additions and 50 deletions

View File

@ -63,6 +63,16 @@ export enum DeviceStatusEnum {
DISABLED = 3 // 已禁用
}
// IoT 模拟设备数据
export interface SimulatorDataVO {
productKey: string
deviceKey: string
type: string
subType: string
reportTime: string
content: string // 存储 JSON 字符串
}
// 设备 API
export const DeviceApi = {
// 查询设备分页
@ -136,5 +146,10 @@ export const DeviceApi = {
// 获取导入模板
importDeviceTemplate: async () => {
return await request.download({ url: `/iot/device/get-import-template` })
},
// 模拟设备
simulatorDevice: async (data: SimulatorDataVO) => {
return await request.post({ url: `/iot/device/data/simulator`, data })
}
}