增加设备类型详情方法
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user