From 6a35ca729006c8c4be8001d60376cb989be9fa2c Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 1 Oct 2024 19:39:12 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E3=80=91IoT=EF=BC=9A=E4=BA=A7=E5=93=81=E3=80=81=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E3=80=81=E7=89=A9=E6=A8=A1=E5=9E=8B=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../product/IotProductFunctionTypeEnum.java | 11 +-------- .../admin/device/IotDeviceController.java | 2 +- .../admin/product/IotProductController.java | 3 ++- .../IotThinkModelFunctionController.java | 23 +++++++++---------- .../IotThinkModelFunctionMapper.java | 2 +- .../iot/service/device/DeviceServiceImpl.java | 15 ++++-------- .../iot/service/device/IotDeviceService.java | 2 +- .../service/product/IotProductService.java | 2 +- .../product/IotProductServiceImpl.java | 2 +- .../IotThinkModelFunctionService.java | 1 + 10 files changed, 25 insertions(+), 38 deletions(-) diff --git a/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/enums/product/IotProductFunctionTypeEnum.java b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/enums/product/IotProductFunctionTypeEnum.java index 9ba3d81b4..7a924997a 100644 --- a/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/enums/product/IotProductFunctionTypeEnum.java +++ b/yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/enums/product/IotProductFunctionTypeEnum.java @@ -7,7 +7,7 @@ import lombok.Getter; import java.util.Arrays; /** - * IOT 产品功能类型枚举类 + * IOT 产品功能(物模型)类型枚举类 * * @author ahh */ @@ -15,17 +15,8 @@ import java.util.Arrays; @Getter public enum IotProductFunctionTypeEnum implements IntArrayValuable { - /** - * 属性 - */ PROPERTY(1, "属性"), - /** - * 服务 - */ SERVICE(2, "服务"), - /** - * 事件 - */ EVENT(3, "事件"); public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(IotProductFunctionTypeEnum::getType).toArray(); diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/device/IotDeviceController.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/device/IotDeviceController.java index f6185a95f..6d75f1cdd 100644 --- a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/device/IotDeviceController.java +++ b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/device/IotDeviceController.java @@ -83,7 +83,7 @@ public class IotDeviceController { @Parameter(name = "productId", description = "产品编号", example = "1") @PreAuthorize("@ss.hasPermission('iot:device:query')") public CommonResult getDeviceCount(@RequestParam("productId") Long productId) { - return success(deviceService.getDeviceCount(productId)); + return success(deviceService.getDeviceCountByProductId(productId)); } } \ No newline at end of file diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/product/IotProductController.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/product/IotProductController.java index 80cc2c4e5..5b0ecb27a 100644 --- a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/product/IotProductController.java +++ b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/product/IotProductController.java @@ -83,11 +83,12 @@ public class IotProductController { return success(BeanUtils.toBean(pageResult, IotProductRespVO.class)); } + // TODO @haohao:改成 simple-list 哈 @GetMapping("/list-all-simple") @Operation(summary = "获得所有产品列表") @PreAuthorize("@ss.hasPermission('iot:product:query')") public CommonResult> listAllSimpleProducts() { - List list = productService.listAllProducts(); + List list = productService.getProductList(); return success(BeanUtils.toBean(list, IotProductSimpleRespVO.class)); } diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/thinkmodelfunction/IotThinkModelFunctionController.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/thinkmodelfunction/IotThinkModelFunctionController.java index 6bf516378..4f48f3628 100644 --- a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/thinkmodelfunction/IotThinkModelFunctionController.java +++ b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/thinkmodelfunction/IotThinkModelFunctionController.java @@ -32,14 +32,14 @@ public class IotThinkModelFunctionController { private IotThinkModelFunctionService thinkModelFunctionService; @PostMapping("/create") - @Operation(summary = "创建IoT 产品物模型") + @Operation(summary = "创建产品物模型") @PreAuthorize("@ss.hasPermission('iot:think-model-function:create')") public CommonResult createThinkModelFunction(@Valid @RequestBody IotThinkModelFunctionSaveReqVO createReqVO) { return success(thinkModelFunctionService.createThinkModelFunction(createReqVO)); } @PutMapping("/update") - @Operation(summary = "更新IoT 产品物模型") + @Operation(summary = "更新产品物模型") @PreAuthorize("@ss.hasPermission('iot:think-model-function:update')") public CommonResult updateThinkModelFunction(@Valid @RequestBody IotThinkModelFunctionSaveReqVO updateReqVO) { thinkModelFunctionService.updateThinkModelFunction(updateReqVO); @@ -47,7 +47,7 @@ public class IotThinkModelFunctionController { } @DeleteMapping("/delete") - @Operation(summary = "删除IoT 产品物模型") + @Operation(summary = "删除产品物模型") @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('iot:think-model-function:delete')") public CommonResult deleteThinkModelFunction(@RequestParam("id") Long id) { @@ -56,30 +56,29 @@ public class IotThinkModelFunctionController { } @GetMapping("/get") - @Operation(summary = "获得IoT 产品物模型") + @Operation(summary = "获得产品物模型") @Parameter(name = "id", description = "编号", required = true) @PreAuthorize("@ss.hasPermission('iot:think-model-function:query')") public CommonResult getThinkModelFunction(@RequestParam("id") Long id) { - IotThinkModelFunctionDO thinkModelFunction = thinkModelFunctionService.getThinkModelFunction(id); - IotThinkModelFunctionRespVO respVO = IotThinkModelFunctionConvert.INSTANCE.convert(thinkModelFunction); - return success(respVO); + IotThinkModelFunctionDO function = thinkModelFunctionService.getThinkModelFunction(id); + return success(IotThinkModelFunctionConvert.INSTANCE.convert(function)); } @GetMapping("/list-by-product-id") - @Operation(summary = "获得IoT 产品物模型") + @Operation(summary = "获得产品物模型") @Parameter(name = "productId", description = "产品ID", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('iot:think-model-function:query')") public CommonResult> getThinkModelFunctionListByProductId(@RequestParam("productId") Long productId) { - List thinkModelFunctionListByProductId = thinkModelFunctionService.getThinkModelFunctionListByProductId(productId); - List respVO = IotThinkModelFunctionConvert.INSTANCE.convertList(thinkModelFunctionListByProductId); - return success(respVO); + List list = thinkModelFunctionService.getThinkModelFunctionListByProductId(productId); + return success(IotThinkModelFunctionConvert.INSTANCE.convertList(list)); } @GetMapping("/page") - @Operation(summary = "获得IoT 产品物模型分页") + @Operation(summary = "获得产品物模型分页") @PreAuthorize("@ss.hasPermission('iot:think-model-function:query')") public CommonResult> getThinkModelFunctionPage(@Valid IotThinkModelFunctionPageReqVO pageReqVO) { PageResult pageResult = thinkModelFunctionService.getThinkModelFunctionPage(pageReqVO); return success(BeanUtils.toBean(pageResult, IotThinkModelFunctionRespVO.class)); } + } diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/mysql/thinkmodelfunction/IotThinkModelFunctionMapper.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/mysql/thinkmodelfunction/IotThinkModelFunctionMapper.java index 25459072b..e8b96e022 100644 --- a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/mysql/thinkmodelfunction/IotThinkModelFunctionMapper.java +++ b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/mysql/thinkmodelfunction/IotThinkModelFunctionMapper.java @@ -27,7 +27,6 @@ public interface IotThinkModelFunctionMapper extends BaseMapperX listAllProducts(); + List getProductList(); } \ No newline at end of file diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/product/IotProductServiceImpl.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/product/IotProductServiceImpl.java index 0ebe24933..15391f70b 100644 --- a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/product/IotProductServiceImpl.java +++ b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/product/IotProductServiceImpl.java @@ -115,7 +115,7 @@ public class IotProductServiceImpl implements IotProductService { } @Override - public List listAllProducts() { + public List getProductList() { return productMapper.selectList(); } diff --git a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/thinkmodelfunction/IotThinkModelFunctionService.java b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/thinkmodelfunction/IotThinkModelFunctionService.java index 7e7ab5916..ce8e472f5 100644 --- a/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/thinkmodelfunction/IotThinkModelFunctionService.java +++ b/yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/thinkmodelfunction/IotThinkModelFunctionService.java @@ -61,4 +61,5 @@ public interface IotThinkModelFunctionService { * @return 产品物模型分页 */ PageResult getThinkModelFunctionPage(IotThinkModelFunctionPageReqVO pageReqVO); + } \ No newline at end of file