【代码优化】IoT:去除 Simulation 关键字,定义更清晰

This commit is contained in:
YunaiV
2025-01-31 22:47:11 +08:00
parent d27cb80065
commit 7be9c3e80e
2 changed files with 13 additions and 19 deletions

View File

@ -56,16 +56,16 @@ export enum DeviceStateEnum {
OFFLINE = 2 // 离线
}
// IoT 模拟设备上行数据 Request VO
export interface IotDeviceSimulationUpstreamReqVO {
// IoT 设备上行 Request VO
export interface IotDeviceUpstreamReqVO {
id: number // 设备编号
type: string // 消息类型
identifier: string // 标识符
data: any // 请求参数
}
// IoT 模拟设备下行数据 Request VO
export interface IotDeviceSimulationDownstreamReqVO {
// IoT 设备下行 Request VO
export interface IotDeviceDownstreamReqVO {
id: number // 设备编号
type: string // 消息类型
identifier: string // 标识符
@ -129,14 +129,14 @@ export const DeviceApi = {
return await request.download({ url: `/iot/device/get-import-template` })
},
// 模拟设备上行
simulationDeviceUpstream: async (data: IotDeviceSimulationUpstreamReqVO) => {
return await request.post({ url: `/iot/device/simulation-upstream`, data })
// 设备上行
upstreamDevice: async (data: IotDeviceUpstreamReqVO) => {
return await request.post({ url: `/iot/device/upstream`, data })
},
// 模拟设备下行
simulationDeviceDownstream: async (data: IotDeviceSimulationDownstreamReqVO) => {
return await request.post({ url: `/iot/device/simulation-downstream`, data })
// 设备下行
downstreamDevice: async (data: IotDeviceDownstreamReqVO) => {
return await request.post({ url: `/iot/device/downstream`, data })
},
// 获取设备属性最新数据