增加设备类型详情方法

This commit is contained in:
2026-03-10 10:07:35 +08:00
parent 0f0795944c
commit 84655ceebd
2 changed files with 29 additions and 0 deletions

View File

@@ -8,6 +8,22 @@ import (
// 设备相关RPC
type Device struct{}
// 获取设备类型详情
func (d *Device) GetTypeDetail(deviceTypeId uint32) (*DeviceTypeDetail, error) {
body := map[string]any{
"device_type_id": deviceTypeId,
"field_list": []string{},
}
result := &Result[DeviceTypeDetail]{}
if err := GetRequest().Send("device.get_type_detail", body, result); err != nil {
return nil, err
}
if result.Code != 0 {
return nil, fmt.Errorf("%s", result.Message)
}
return &result.Data, nil
}
// 获取设备详情
func (d *Device) GetDetail(deviceId uint32) (*DeviceDetail, error) {
body := map[string]any{