【代码修复】IoT:网络组件相关

This commit is contained in:
YunaiV
2025-04-12 21:05:49 +08:00
parent 44b835bd4a
commit d83af87f9f
24 changed files with 54 additions and 25 deletions

View File

@@ -107,6 +107,7 @@ public class IotProductScriptController {
@PreAuthorize("@ss.hasPermission('iot:product-script:query')")
public CommonResult<String> getSampleScript(@RequestParam("type") Integer type) {
String sample;
// TODO @haohao要不枚举下
switch (type) {
case 1:
sample = scriptSamples.getPropertyParserSample();
@@ -118,6 +119,7 @@ public class IotProductScriptController {
sample = scriptSamples.getCommandEncoderSample();
break;
default:
// TODO @haohao不支持返回 error 会不会好点哈?例如说,参数不正确;
sample = "// 不支持的脚本类型";
}
return success(sample);

View File

@@ -17,6 +17,7 @@ import java.util.List;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.iot.enums.ErrorCodeConstants.*;
/**
* IoT 插件配置 Service 实现类
*