解析device和task的配置全部用内置方法处理
This commit is contained in:
@@ -77,7 +77,7 @@ func newDeviceResponse(device *models.Device) (*DeviceResponse, error) {
|
||||
|
||||
var props map[string]interface{}
|
||||
if len(device.Properties) > 0 && string(device.Properties) != "null" {
|
||||
if err := json.Unmarshal(device.Properties, &props); err != nil {
|
||||
if err := device.ParseProperties(&props); err != nil {
|
||||
return nil, fmt.Errorf("解析设备属性失败 (ID: %d): %w", device.ID, err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user