mirror of
https://github.com/yudaocode/yudao-ui-admin-vue3.git
synced 2026-05-09 00:48:27 +00:00
【代码评审】IoT:产品、设备、物模型的代码
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 设备 VO
|
||||
// IoT 设备 VO
|
||||
export interface DeviceVO {
|
||||
id: number // 设备 ID,主键,自增
|
||||
deviceKey: string // 设备唯一标识符,全局唯一,用于识别设备
|
||||
deviceName: string // 设备名称,在产品内唯一,用于标识设备
|
||||
productId: number // 产品 ID,关联 iot_product 表的 id
|
||||
productKey: string // 产品 Key,关联 iot_product 表的 product_key
|
||||
deviceType: number // 设备类型:0 - 直连设备,1 - 网关子设备,2 - 网关设备
|
||||
nickname: string // 设备备注名称,供用户自定义备注
|
||||
gatewayId: number // 网关设备 ID,子设备需要关联的网关设备 ID
|
||||
status: number // 设备状态:0 - 未激活,1 - 在线,2 - 离线,3 - 已禁用
|
||||
deviceKey: string // 设备唯一标识符
|
||||
deviceName: string // 设备名称
|
||||
productId: number // 产品编号
|
||||
productKey: string // 产品标识
|
||||
deviceType: number // 设备类型
|
||||
nickname: string // 设备备注名称
|
||||
gatewayId: number // 网关设备 ID
|
||||
status: number // 设备状态
|
||||
statusLastUpdateTime: Date // 设备状态最后更新时间
|
||||
lastOnlineTime: Date // 最后上线时间
|
||||
lastOfflineTime: Date // 最后离线时间
|
||||
@@ -22,17 +22,17 @@ export interface DeviceVO {
|
||||
mqttClientId: string // MQTT 客户端 ID
|
||||
mqttUsername: string // MQTT 用户名
|
||||
mqttPassword: string // MQTT 密码
|
||||
authType: string // 认证类型(如一机一密、动态注册)
|
||||
latitude: number // 设备位置的纬度,范围 -90.000000 ~ 90.000000
|
||||
longitude: number // 设备位置的经度,范围 -180.000000 ~ 180.000000
|
||||
areaId: number // 地区编码,符合国家地区编码标准,关联地区表
|
||||
authType: string // 认证类型
|
||||
latitude: number // 设备位置的纬度
|
||||
longitude: number // 设备位置的经度
|
||||
areaId: number // 地区编码
|
||||
address: string // 设备详细地址
|
||||
serialNumber: string // 设备序列号
|
||||
}
|
||||
|
||||
export interface DeviceUpdateStatusVO {
|
||||
id: number // 设备 ID,主键,自增
|
||||
status: number // 设备状态:0 - 未激活,1 - 在线,2 - 离线,3 - 已禁用
|
||||
status: number // 设备状态
|
||||
}
|
||||
|
||||
// 设备 API
|
||||
|
||||
Reference in New Issue
Block a user