[优化] 规则链优化

This commit is contained in:
PandaX
2024-02-25 13:56:14 +08:00
parent 6f7132a009
commit 4eca198425
9 changed files with 112 additions and 76 deletions

View File

@@ -21,7 +21,11 @@ func BuildRunDeviceRpc(deviceId, mode string, msgData map[string]interface{}) er
if device.LinkStatus != global.ONLINE {
return errors.New("设备不在线无法设置属性")
}
findOne := ruleService.RuleChainModelDao.FindOne(device.Product.RuleChainId)
findOne, err := ruleService.RuleChainModelDao.FindOne(device.Product.RuleChainId)
if err != nil {
global.Log.Error("查询规则链数据失败", err)
return errors.New("查询规则链数据失败")
}
ruleData := ruleEntity.RuleDataJson{}
err = tool.StringToStruct(findOne.RuleDataJson, &ruleData)
if err != nil {