新增获取设备属性参数&修改返回数据结构

This commit is contained in:
2025-09-03 14:42:25 +08:00
parent dd6b5e9041
commit c6e1c36364
3 changed files with 118 additions and 34 deletions

View File

@@ -41,3 +41,28 @@ type Result[D any] struct {
Message string `json:"message"`
Data D `json:"data"`
}
// 设备详情
type DeviceDetail struct {
Type uint8 `json:"type"`
ConnectType uint8 `json:"connect_type"`
Secret string `json:"secret"`
PId uint32 `json:"p_id"`
DataId uint32 `json:"data_id"`
}
// 设备属性参数
type DeviceAttributeOption struct {
Type uint8 `json:"type"`
ContentType uint8 `json:"content_type"`
Attribute []struct {
Type uint8 `json:"type"`
Name string `json:"name"`
Flag uint8 `json:"flag"`
Field string `json:"field"`
Readonly bool `json:"readonly"`
AllowItem *[]int `json:"allow_item,omitempty"`
Min *uint32 `json:"min,omitempty"`
Max *uint32 `json:"max,omitempty"`
} `json:"attribute"`
}