Commit afda934c1db59d9187e4f3f7a67a221ec2f6591c

Authored by YunaiV
1 parent 1f5dff77

reactor:【IoT 物联网】调整数据流转的包结构

Showing 42 changed files with 352 additions and 433 deletions
yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/enums/rule/IotDataBridgeDirectionEnum.java deleted
1   -package cn.iocoder.yudao.module.iot.enums.rule;
2   -
3   -import cn.iocoder.yudao.framework.common.core.ArrayValuable;
4   -import lombok.Getter;
5   -import lombok.RequiredArgsConstructor;
6   -
7   -import java.util.Arrays;
8   -
9   -/**
10   - * IoT 数据桥接的方向枚举
11   - *
12   - * @author 芋道源码
13   - */
14   -@RequiredArgsConstructor
15   -@Getter
16   -public enum IotDataBridgeDirectionEnum implements ArrayValuable<Integer> {
17   -
18   - INPUT(1), // 输入
19   - OUTPUT(2); // 输出
20   -
21   - private final Integer type;
22   -
23   - public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotDataBridgeDirectionEnum::getType).toArray(Integer[]::new);
24   -
25   - @Override
26   - public Integer[] array() {
27   - return ARRAYS;
28   - }
29   -
30   -}
yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/enums/rule/IotDataRuleSinkTypeEnum.java renamed to yudao-module-iot/yudao-module-iot-api/src/main/java/cn/iocoder/yudao/module/iot/enums/rule/IotDataSinkTypeEnum.java
... ... @@ -7,32 +7,33 @@ import lombok.RequiredArgsConstructor;
7 7 import java.util.Arrays;
8 8  
9 9 /**
10   - * IoT 数据流转的数据目的的类型枚举
  10 + * IoT 数据目的的类型枚举
11 11 *
12 12 * @author 芋道源码
13 13 */
14 14 @RequiredArgsConstructor
15 15 @Getter
16   -public enum IotDataRuleSinkTypeEnum implements ArrayValuable<Integer> {
  16 +public enum IotDataSinkTypeEnum implements ArrayValuable<Integer> {
17 17  
18 18 HTTP(1, "HTTP"),
19 19 TCP(2, "TCP"),
20   - WEBSOCKET(3, "WEBSOCKET"),
  20 + WEBSOCKET(3, "WebSocket"),
21 21  
22 22 MQTT(10, "MQTT"),
23 23  
24   - DATABASE(20, "DATABASE"),
25   - REDIS_STREAM(21, "REDIS_STREAM"),
  24 + DATABASE(20, "Database"),
  25 + // TODO @芋艿:改成 Redis;通过 execute 通用化;
  26 + REDIS_STREAM(21, "Redis Stream"),
26 27  
27   - ROCKETMQ(30, "ROCKETMQ"),
28   - RABBITMQ(31, "RABBITMQ"),
29   - KAFKA(32, "KAFKA");
  28 + ROCKETMQ(30, "RocketMQ"),
  29 + RABBITMQ(31, "RabbitMQ"),
  30 + KAFKA(32, "Kafka");
30 31  
31 32 private final Integer type;
32 33  
33 34 private final String name;
34 35  
35   - public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotDataRuleSinkTypeEnum::getType).toArray(Integer[]::new);
  36 + public static final Integer[] ARRAYS = Arrays.stream(values()).map(IotDataSinkTypeEnum::getType).toArray(Integer[]::new);
36 37  
37 38 @Override
38 39 public Integer[] array() {
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/rule/IotDataBridgeController.java deleted
1   -package cn.iocoder.yudao.module.iot.controller.admin.rule;
2   -
3   -import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
4   -import cn.iocoder.yudao.framework.common.pojo.CommonResult;
5   -import cn.iocoder.yudao.framework.common.pojo.PageResult;
6   -import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
7   -import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.IotDataBridgePageReqVO;
8   -import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.IotDataBridgeRespVO;
9   -import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.IotDataBridgeSaveReqVO;
10   -import cn.iocoder.yudao.module.iot.dal.dataobject.rule.IotDataRuleSinkDO;
11   -import cn.iocoder.yudao.module.iot.service.rule.IotDataBridgeService;
12   -import io.swagger.v3.oas.annotations.Operation;
13   -import io.swagger.v3.oas.annotations.Parameter;
14   -import io.swagger.v3.oas.annotations.tags.Tag;
15   -import jakarta.annotation.Resource;
16   -import jakarta.validation.Valid;
17   -import org.springframework.security.access.prepost.PreAuthorize;
18   -import org.springframework.validation.annotation.Validated;
19   -import org.springframework.web.bind.annotation.*;
20   -
21   -import java.util.List;
22   -
23   -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
24   -import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
25   -
26   -@Tag(name = "管理后台 - IoT 数据桥梁")
27   -@RestController
28   -@RequestMapping("/iot/data-bridge")
29   -@Validated
30   -public class IotDataBridgeController {
31   -
32   - @Resource
33   - private IotDataBridgeService dataBridgeService;
34   -
35   - @PostMapping("/create")
36   - @Operation(summary = "创建数据桥梁")
37   - @PreAuthorize("@ss.hasPermission('iot:data-bridge:create')")
38   - public CommonResult<Long> createDataBridge(@Valid @RequestBody IotDataBridgeSaveReqVO createReqVO) {
39   - return success(dataBridgeService.createDataBridge(createReqVO));
40   - }
41   -
42   - @PutMapping("/update")
43   - @Operation(summary = "更新数据桥梁")
44   - @PreAuthorize("@ss.hasPermission('iot:data-bridge:update')")
45   - public CommonResult<Boolean> updateDataBridge(@Valid @RequestBody IotDataBridgeSaveReqVO updateReqVO) {
46   - dataBridgeService.updateDataBridge(updateReqVO);
47   - return success(true);
48   - }
49   -
50   - @DeleteMapping("/delete")
51   - @Operation(summary = "删除数据桥梁")
52   - @Parameter(name = "id", description = "编号", required = true)
53   - @PreAuthorize("@ss.hasPermission('iot:data-bridge:delete')")
54   - public CommonResult<Boolean> deleteDataBridge(@RequestParam("id") Long id) {
55   - dataBridgeService.deleteDataBridge(id);
56   - return success(true);
57   - }
58   -
59   - @GetMapping("/get")
60   - @Operation(summary = "获得数据桥梁")
61   - @Parameter(name = "id", description = "编号", required = true, example = "1024")
62   - @PreAuthorize("@ss.hasPermission('iot:data-bridge:query')")
63   - public CommonResult<IotDataBridgeRespVO> getDataBridge(@RequestParam("id") Long id) {
64   - IotDataRuleSinkDO dataBridge = dataBridgeService.getDataBridge(id);
65   - return success(BeanUtils.toBean(dataBridge, IotDataBridgeRespVO.class));
66   - }
67   -
68   - @GetMapping("/page")
69   - @Operation(summary = "获得数据桥梁分页")
70   - @PreAuthorize("@ss.hasPermission('iot:data-bridge:query')")
71   - public CommonResult<PageResult<IotDataBridgeRespVO>> getDataBridgePage(@Valid IotDataBridgePageReqVO pageReqVO) {
72   - PageResult<IotDataRuleSinkDO> pageResult = dataBridgeService.getDataBridgePage(pageReqVO);
73   - return success(BeanUtils.toBean(pageResult, IotDataBridgeRespVO.class));
74   - }
75   -
76   - @GetMapping("/simple-list")
77   - @Operation(summary = "获取数据桥梁的精简信息列表", description = "主要用于前端的下拉选项")
78   - public CommonResult<List<IotDataBridgeRespVO>> getSimpleDataBridgeList() {
79   - List<IotDataRuleSinkDO> list = dataBridgeService.getDataBridgeList(CommonStatusEnum.ENABLE.getStatus());
80   - return success(convertList(list, dataBridge -> // 只返回 id、name 字段
81   - new IotDataBridgeRespVO().setId(dataBridge.getId()).setName(dataBridge.getName())));
82   - }
83   -
84   -}
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/rule/IotDataSinkController.java 0 → 100644
  1 +package cn.iocoder.yudao.module.iot.controller.admin.rule;
  2 +
  3 +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
  4 +import cn.iocoder.yudao.framework.common.pojo.CommonResult;
  5 +import cn.iocoder.yudao.framework.common.pojo.PageResult;
  6 +import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
  7 +import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.data.sink.IotDataSinkPageReqVO;
  8 +import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.data.sink.IotDataSinkRespVO;
  9 +import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.data.sink.IotDataSinkSaveReqVO;
  10 +import cn.iocoder.yudao.module.iot.dal.dataobject.rule.IotDataSinkDO;
  11 +import cn.iocoder.yudao.module.iot.service.rule.data.IotDataSinkService;
  12 +import io.swagger.v3.oas.annotations.Operation;
  13 +import io.swagger.v3.oas.annotations.Parameter;
  14 +import io.swagger.v3.oas.annotations.tags.Tag;
  15 +import jakarta.annotation.Resource;
  16 +import jakarta.validation.Valid;
  17 +import org.springframework.security.access.prepost.PreAuthorize;
  18 +import org.springframework.validation.annotation.Validated;
  19 +import org.springframework.web.bind.annotation.*;
  20 +
  21 +import java.util.List;
  22 +
  23 +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
  24 +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
  25 +
  26 +@Tag(name = "管理后台 - IoT 数据流转目的")
  27 +@RestController
  28 +@RequestMapping("/iot/data-sink")
  29 +@Validated
  30 +public class IotDataSinkController {
  31 +
  32 + @Resource
  33 + private IotDataSinkService dataSinkService;
  34 +
  35 + @PostMapping("/create")
  36 + @Operation(summary = "创建数据目的")
  37 + @PreAuthorize("@ss.hasPermission('iot:data-sink:create')")
  38 + public CommonResult<Long> createDataSink(@Valid @RequestBody IotDataSinkSaveReqVO createReqVO) {
  39 + return success(dataSinkService.createDataSink(createReqVO));
  40 + }
  41 +
  42 + @PutMapping("/update")
  43 + @Operation(summary = "更新数据目的")
  44 + @PreAuthorize("@ss.hasPermission('iot:data-sink:update')")
  45 + public CommonResult<Boolean> updateDataSink(@Valid @RequestBody IotDataSinkSaveReqVO updateReqVO) {
  46 + dataSinkService.updateDataSink(updateReqVO);
  47 + return success(true);
  48 + }
  49 +
  50 + @DeleteMapping("/delete")
  51 + @Operation(summary = "删除数据目的")
  52 + @Parameter(name = "id", description = "编号", required = true)
  53 + @PreAuthorize("@ss.hasPermission('iot:data-sink:delete')")
  54 + public CommonResult<Boolean> deleteDataSink(@RequestParam("id") Long id) {
  55 + dataSinkService.deleteDataSink(id);
  56 + return success(true);
  57 + }
  58 +
  59 + @GetMapping("/get")
  60 + @Operation(summary = "获得数据目的")
  61 + @Parameter(name = "id", description = "编号", required = true, example = "1024")
  62 + @PreAuthorize("@ss.hasPermission('iot:data-sink:query')")
  63 + public CommonResult<IotDataSinkRespVO> getDataSink(@RequestParam("id") Long id) {
  64 + IotDataSinkDO sink = dataSinkService.getDataSink(id);
  65 + return success(BeanUtils.toBean(sink, IotDataSinkRespVO.class));
  66 + }
  67 +
  68 + @GetMapping("/page")
  69 + @Operation(summary = "获得数据目的分页")
  70 + @PreAuthorize("@ss.hasPermission('iot:data-sink:query')")
  71 + public CommonResult<PageResult<IotDataSinkRespVO>> getDataSinkPage(@Valid IotDataSinkPageReqVO pageReqVO) {
  72 + PageResult<IotDataSinkDO> pageResult = dataSinkService.getDataSinkPage(pageReqVO);
  73 + return success(BeanUtils.toBean(pageResult, IotDataSinkRespVO.class));
  74 + }
  75 +
  76 + @GetMapping("/simple-list")
  77 + @Operation(summary = "获取数据目的的精简信息列表", description = "主要用于前端的下拉选项")
  78 + public CommonResult<List<IotDataSinkRespVO>> getSimpleDataSinkList() {
  79 + List<IotDataSinkDO> list = dataSinkService.getDataSinkListByStatus(CommonStatusEnum.ENABLE.getStatus());
  80 + return success(convertList(list, sink -> // 只返回 id、name 字段
  81 + new IotDataSinkRespVO().setId(sink.getId()).setName(sink.getName())));
  82 + }
  83 +
  84 +}
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/rule/IotRuleSceneController.java
... ... @@ -7,7 +7,7 @@ import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.scene.IotRuleScenePa
7 7 import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.scene.IotRuleSceneRespVO;
8 8 import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.scene.IotRuleSceneSaveReqVO;
9 9 import cn.iocoder.yudao.module.iot.dal.dataobject.rule.IotRuleSceneDO;
10   -import cn.iocoder.yudao.module.iot.service.rule.IotRuleSceneService;
  10 +import cn.iocoder.yudao.module.iot.service.rule.scene.IotRuleSceneService;
11 11 import io.swagger.v3.oas.annotations.Operation;
12 12 import io.swagger.v3.oas.annotations.Parameter;
13 13 import io.swagger.v3.oas.annotations.tags.Tag;
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/rule/vo/data/package-info.java 0 → 100644
  1 +package cn.iocoder.yudao.module.iot.controller.admin.rule.vo.data;
0 2 \ No newline at end of file
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/rule/vo/databridge/IotDataBridgePageReqVO.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/rule/vo/data/sink/IotDataSinkPageReqVO.java
1   -package cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge;
  1 +package cn.iocoder.yudao.module.iot.controller.admin.rule.vo.data.sink;
2 2  
3 3 import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
4 4 import cn.iocoder.yudao.framework.common.pojo.PageParam;
... ... @@ -11,14 +11,14 @@ import java.time.LocalDateTime;
11 11  
12 12 import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
13 13  
14   -@Schema(description = "管理后台 - IoT 数据桥梁分页 Request VO")
  14 +@Schema(description = "管理后台 - IoT 数据流转目的分页 Request VO")
15 15 @Data
16   -public class IotDataBridgePageReqVO extends PageParam {
  16 +public class IotDataSinkPageReqVO extends PageParam {
17 17  
18   - @Schema(description = "桥梁名称", example = "赵六")
  18 + @Schema(description = "数据目的名称", example = "赵六")
19 19 private String name;
20 20  
21   - @Schema(description = "桥梁状态", example = "1")
  21 + @Schema(description = "数据目的状态", example = "2")
22 22 @InEnum(CommonStatusEnum.class)
23 23 private Integer status;
24 24  
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/rule/vo/data/sink/IotDataSinkRespVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.iot.controller.admin.rule.vo.data.sink;
  2 +
  3 +import cn.iocoder.yudao.module.iot.dal.dataobject.rule.config.IotDataBridgeAbstractConfig;
  4 +import io.swagger.v3.oas.annotations.media.Schema;
  5 +import lombok.Data;
  6 +
  7 +import java.time.LocalDateTime;
  8 +
  9 +@Schema(description = "管理后台 - IoT 数据流转目的 Response VO")
  10 +@Data
  11 +public class IotDataSinkRespVO {
  12 +
  13 + @Schema(description = "数据目的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "18564")
  14 + private Long id;
  15 +
  16 + @Schema(description = "数据目的名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
  17 + private String name;
  18 +
  19 + @Schema(description = "数据目的描述", example = "随便")
  20 + private String description;
  21 +
  22 + @Schema(description = "数据目的状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
  23 + private Integer status;
  24 +
  25 + @Schema(description = "数据目的类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
  26 + private Integer type;
  27 +
  28 + @Schema(description = "数据目的配置")
  29 + private IotDataBridgeAbstractConfig config;
  30 +
  31 + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
  32 + private LocalDateTime createTime;
  33 +
  34 +}
0 35 \ No newline at end of file
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/rule/vo/data/sink/IotDataSinkSaveReqVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.iot.controller.admin.rule.vo.data.sink;
  2 +
  3 +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
  4 +import cn.iocoder.yudao.framework.common.validation.InEnum;
  5 +import cn.iocoder.yudao.module.iot.dal.dataobject.rule.config.IotDataBridgeAbstractConfig;
  6 +import cn.iocoder.yudao.module.iot.enums.rule.IotDataSinkTypeEnum;
  7 +import io.swagger.v3.oas.annotations.media.Schema;
  8 +import jakarta.validation.constraints.NotEmpty;
  9 +import jakarta.validation.constraints.NotNull;
  10 +import lombok.Data;
  11 +
  12 +@Schema(description = "管理后台 - IoT 数据流转目的新增/修改 Request VO")
  13 +@Data
  14 +public class IotDataSinkSaveReqVO {
  15 +
  16 + @Schema(description = "数据目的编号", example = "18564")
  17 + private Long id;
  18 +
  19 + @Schema(description = "数据目的名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
  20 + @NotEmpty(message = "数据目的名称不能为空")
  21 + private String name;
  22 +
  23 + @Schema(description = "数据目的描述", example = "随便")
  24 + private String description;
  25 +
  26 + @Schema(description = "数据目的状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
  27 + @NotNull(message = "数据目的状态不能为空")
  28 + @InEnum(CommonStatusEnum.class)
  29 + private Integer status;
  30 +
  31 + @Schema(description = "数据目的类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
  32 + @NotNull(message = "数据目的类型不能为空")
  33 + @InEnum(IotDataSinkTypeEnum.class)
  34 + private Integer type;
  35 +
  36 + @Schema(description = "数据目的配置")
  37 + @NotNull(message = "数据目的配置不能为空")
  38 + private IotDataBridgeAbstractConfig config;
  39 +
  40 +}
0 41 \ No newline at end of file
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/rule/vo/databridge/IotDataBridgeRespVO.java deleted
1   -package cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge;
2   -
3   -import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.config.IotDataBridgeAbstractConfig;
4   -import io.swagger.v3.oas.annotations.media.Schema;
5   -import lombok.Data;
6   -
7   -import java.time.LocalDateTime;
8   -
9   -@Schema(description = "管理后台 - IoT 数据桥梁 Response VO")
10   -@Data
11   -public class IotDataBridgeRespVO {
12   -
13   - @Schema(description = "桥梁编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "18564")
14   - private Long id;
15   -
16   - @Schema(description = "桥梁名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
17   - private String name;
18   -
19   - @Schema(description = "桥梁描述", example = "随便")
20   - private String description;
21   -
22   - @Schema(description = "桥梁状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
23   - private Integer status;
24   -
25   - @Schema(description = "桥梁方向", requiredMode = Schema.RequiredMode.REQUIRED)
26   - private Integer direction;
27   -
28   - @Schema(description = "桥梁类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
29   - private Integer type;
30   -
31   - @Schema(description = "桥梁配置")
32   - private IotDataBridgeAbstractConfig config;
33   -
34   - @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
35   - private LocalDateTime createTime;
36   -
37   -}
38 0 \ No newline at end of file
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/rule/vo/databridge/IotDataBridgeSaveReqVO.java deleted
1   -package cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge;
2   -
3   -import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
4   -import cn.iocoder.yudao.framework.common.validation.InEnum;
5   -import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.config.IotDataBridgeAbstractConfig;
6   -import cn.iocoder.yudao.module.iot.enums.rule.IotDataBridgeDirectionEnum;
7   -import cn.iocoder.yudao.module.iot.enums.rule.IotDataRuleSinkTypeEnum;
8   -import io.swagger.v3.oas.annotations.media.Schema;
9   -import jakarta.validation.constraints.NotEmpty;
10   -import jakarta.validation.constraints.NotNull;
11   -import lombok.Data;
12   -
13   -@Schema(description = "管理后台 - IoT 数据桥梁新增/修改 Request VO")
14   -@Data
15   -public class IotDataBridgeSaveReqVO {
16   -
17   - @Schema(description = "桥梁编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "18564")
18   - private Long id;
19   -
20   - @Schema(description = "桥梁名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
21   - @NotEmpty(message = "桥梁名称不能为空")
22   - private String name;
23   -
24   - @Schema(description = "桥梁描述", example = "随便")
25   - private String description;
26   -
27   - @Schema(description = "桥梁状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
28   - @NotNull(message = "桥梁状态不能为空")
29   - @InEnum(CommonStatusEnum.class)
30   - private Integer status;
31   -
32   - @Schema(description = "桥梁方向", requiredMode = Schema.RequiredMode.REQUIRED)
33   - @NotNull(message = "桥梁方向不能为空")
34   - @InEnum(IotDataBridgeDirectionEnum.class)
35   - private Integer direction;
36   -
37   - @Schema(description = "桥梁类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
38   - @NotNull(message = "桥梁类型不能为空")
39   - @InEnum(IotDataRuleSinkTypeEnum.class)
40   - private Integer type;
41   -
42   - @Schema(description = "桥梁配置")
43   - @NotNull(message = "桥梁配置不能为空")
44   - private IotDataBridgeAbstractConfig config;
45   -
46   -}
47 0 \ No newline at end of file
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/thingmodel/model/ThingModelEvent.java
... ... @@ -9,6 +9,7 @@ import lombok.Data;
9 9  
10 10 import java.util.List;
11 11  
  12 +// TODO @puhui999:感觉这个,是不是放到 dal 里会好点?(讨论下,先不改哈)
12 13 /**
13 14 * IoT 物模型中的事件
14 15 *
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/rule/IotDataRuleDO.java
1 1 package cn.iocoder.yudao.module.iot.dal.dataobject.rule;
2 2  
3 3 import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
  4 +import cn.iocoder.yudao.framework.mybatis.core.type.LongListTypeHandler;
  5 +import cn.iocoder.yudao.module.iot.core.enums.IotDeviceMessageMethodEnum;
  6 +import cn.iocoder.yudao.module.iot.dal.dataobject.device.IotDeviceDO;
  7 +import cn.iocoder.yudao.module.iot.dal.dataobject.product.IotProductDO;
  8 +import cn.iocoder.yudao.module.iot.dal.dataobject.thingmodel.IotThingModelDO;
4 9 import com.baomidou.mybatisplus.annotation.KeySequence;
  10 +import com.baomidou.mybatisplus.annotation.TableField;
5 11 import com.baomidou.mybatisplus.annotation.TableName;
  12 +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
6 13 import lombok.AllArgsConstructor;
7 14 import lombok.Builder;
8 15 import lombok.Data;
... ... @@ -11,9 +18,9 @@ import lombok.NoArgsConstructor;
11 18 import java.util.List;
12 19  
13 20 /**
14   - * IoT 数据流转 DO
  21 + * IoT 数据流转规则 DO
15 22 *
16   - * 组合 {@link IotDataRuleSourceDO} => {@link IotDataRuleSinkDO}
  23 + * 监听 {@link SourceConfig} 数据源,转发到 {@link IotDataSinkDO} 数据目的
17 24 *
18 25 * @author 芋道源码
19 26 */
... ... @@ -45,18 +52,54 @@ public class IotDataRuleDO {
45 52 private Integer status;
46 53  
47 54 /**
48   - * 数据源编号
49   - *
50   - * 关联 {@link IotDataRuleSourceDO#getId()}
  55 + * 数据源配置数组
51 56 */
52   - private List<Long> sourceIds;
  57 + @TableField(typeHandler = JacksonTypeHandler.class)
  58 + private List<SourceConfig> sourceConfigs;
53 59 /**
54 60 * 数据目的编号
55 61 *
56   - * 关联 {@link IotDataRuleSinkDO#getId()}
  62 + * 关联 {@link IotDataSinkDO#getId()}
57 63 */
  64 + @TableField(typeHandler = LongListTypeHandler.class)
58 65 private List<Long> sinkIds;
59 66  
60 67 // TODO @芋艿:未来考虑使用 groovy;支持数据处理;
61 68  
  69 + /**
  70 + * 数据源配置
  71 + */
  72 + @Data
  73 + public static class SourceConfig {
  74 +
  75 + /**
  76 + * 消息方法
  77 + *
  78 + * 枚举 {@link IotDeviceMessageMethodEnum} 中的 upstream 上行部分
  79 + */
  80 + private String method;
  81 +
  82 + /**
  83 + * 产品编号
  84 + *
  85 + * 关联 {@link IotProductDO#getId()}
  86 + */
  87 + private Long productId;
  88 + /**
  89 + * 设备编号
  90 + *
  91 + * 关联 {@link IotDeviceDO#getId()}
  92 + * 特殊:如果为 {@link IotDeviceDO#DEVICE_ID_ALL} 时,则是全部设备
  93 + */
  94 + private Long deviceId;
  95 +
  96 + /**
  97 + * 标识符
  98 + *
  99 + * 1. 物模型时,对应:{@link IotThingModelDO#getIdentifier()}
  100 + */
  101 + private String identifier;
  102 +
  103 + }
  104 +
62 105 }
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/rule/IotDataRuleSourceDO.java deleted
1   -package cn.iocoder.yudao.module.iot.dal.dataobject.rule;
2   -
3   -import cn.iocoder.yudao.module.iot.core.enums.IotDeviceMessageMethodEnum;
4   -import cn.iocoder.yudao.module.iot.dal.dataobject.device.IotDeviceDO;
5   -import cn.iocoder.yudao.module.iot.dal.dataobject.product.IotProductDO;
6   -import cn.iocoder.yudao.module.iot.dal.dataobject.thingmodel.IotThingModelDO;
7   -import com.baomidou.mybatisplus.annotation.KeySequence;
8   -import com.baomidou.mybatisplus.annotation.TableName;
9   -import lombok.AllArgsConstructor;
10   -import lombok.Builder;
11   -import lombok.Data;
12   -import lombok.NoArgsConstructor;
13   -
14   -import java.util.List;
15   -
16   -/**
17   - * IoT 数据流转的数据源 DO
18   - *
19   - * @author 芋道源码
20   - */
21   -@TableName(value = "iot_data_flow_source", autoResultMap = true)
22   -@KeySequence("iot_data_flow_source_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
23   -@Data
24   -@Builder
25   -@NoArgsConstructor
26   -@AllArgsConstructor
27   -public class IotDataRuleSourceDO {
28   -
29   - /**
30   - * 数据源编号
31   - */
32   - private Long id;
33   - /**
34   - * 数据源名称
35   - */
36   - private String name;
37   -
38   - /**
39   - * 配置数组
40   - */
41   - private List<Config> configs;
42   -
43   - /**
44   - * 配置
45   - */
46   - @Data
47   - public static class Config {
48   -
49   - /**
50   - * 消息方法
51   - *
52   - * 枚举 {@link IotDeviceMessageMethodEnum} 中的 upstream 上行部分
53   - */
54   - private String method;
55   -
56   - /**
57   - * 产品编号
58   - *
59   - * 关联 {@link IotProductDO#getId()}
60   - */
61   - private Long productId;
62   - /**
63   - * 设备编号
64   - *
65   - * 关联 {@link IotDeviceDO#getId()}
66   - * 特殊:如果为 {@link IotDeviceDO#DEVICE_ID_ALL} 时,则是全部设备
67   - */
68   - private Long deviceId;
69   -
70   - /**
71   - * 标识符
72   - *
73   - * 1. 物模型时,对应:{@link IotThingModelDO#getIdentifier()}
74   - */
75   - private String identifier;
76   -
77   - }
78   -
79   -}
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/rule/IotDataRuleSinkDO.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/rule/IotDataSinkDO.java
... ... @@ -2,28 +2,30 @@ package cn.iocoder.yudao.module.iot.dal.dataobject.rule;
2 2  
3 3 import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
4 4 import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
5   -import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.config.IotDataBridgeAbstractConfig;
6   -import cn.iocoder.yudao.module.iot.enums.rule.IotDataBridgeDirectionEnum;
7   -import cn.iocoder.yudao.module.iot.enums.rule.IotDataRuleSinkTypeEnum;
  5 +import cn.iocoder.yudao.module.iot.dal.dataobject.rule.config.IotDataBridgeAbstractConfig;
  6 +import cn.iocoder.yudao.module.iot.enums.rule.IotDataSinkTypeEnum;
8 7 import com.baomidou.mybatisplus.annotation.KeySequence;
9 8 import com.baomidou.mybatisplus.annotation.TableField;
10 9 import com.baomidou.mybatisplus.annotation.TableId;
11 10 import com.baomidou.mybatisplus.annotation.TableName;
12 11 import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
13   -import lombok.*;
  12 +import lombok.AllArgsConstructor;
  13 +import lombok.Builder;
  14 +import lombok.Data;
  15 +import lombok.NoArgsConstructor;
14 16  
15 17 /**
16   - * IoT 数据流转的数据目的 DO
  18 + * IoT 数据流转目的 DO
17 19 *
18 20 * @author 芋道源码
19 21 */
20   -@TableName(value = "iot_data_bridge", autoResultMap = true)
  22 +@TableName(value = "iot_data_sink", autoResultMap = true)
21 23 @KeySequence("iot_data_bridge_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
22 24 @Data
23 25 @Builder
24 26 @NoArgsConstructor
25 27 @AllArgsConstructor
26   -public class IotDataRuleSinkDO extends BaseDO {
  28 +public class IotDataSinkDO extends BaseDO {
27 29  
28 30 /**
29 31 * 数据目的编号
... ... @@ -39,27 +41,18 @@ public class IotDataRuleSinkDO extends BaseDO {
39 41 */
40 42 private String description;
41 43 /**
42   - * 桥梁状态
  44 + * 数据目的状态
43 45 *
44   - * 枚举 {@link CommonStatusEnum}
  46 + * 枚举 {@link CommonStatusEnum}
45 47 */
46   - @Deprecated // TODO @puhui999:这个删除
47 48 private Integer status;
48   - /**
49   - * 桥梁方向
50   - *
51   - * 枚举 {@link IotDataBridgeDirectionEnum}
52   - */
53   - @Deprecated // TODO @puhui999:这个删除
54   - private Integer direction;
55 49  
56 50 /**
57 51 * 数据目的类型
58 52 *
59   - * 枚举 {@link IotDataRuleSinkTypeEnum}
  53 + * 枚举 {@link IotDataSinkTypeEnum}
60 54 */
61 55 private Integer type;
62   -
63 56 /**
64 57 * 数据目的配置
65 58 */
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/rule/IotRuleSceneDO.java
... ... @@ -201,7 +201,7 @@ public class IotRuleSceneDO extends TenantBaseDO {
201 201 * 数据桥接编号
202 202 *
203 203 * 必填:当 {@link #type} 为 {@link IotRuleSceneActionTypeEnum#DATA_BRIDGE} 时
204   - * 关联:{@link IotDataRuleSinkDO#getId()}
  204 + * 关联:{@link IotDataSinkDO#getId()}
205 205 */
206 206 private Long dataBridgeId;
207 207  
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/rule/vo/databridge/config/IotDataBridgeAbstractConfig.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/rule/config/IotDataBridgeAbstractConfig.java
1   -package cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.config;
  1 +package cn.iocoder.yudao.module.iot.dal.dataobject.rule.config;
2 2  
3   -import cn.iocoder.yudao.module.iot.enums.rule.IotDataRuleSinkTypeEnum;
  3 +import cn.iocoder.yudao.module.iot.enums.rule.IotDataSinkTypeEnum;
4 4 import com.fasterxml.jackson.annotation.JsonSubTypes;
5 5 import com.fasterxml.jackson.annotation.JsonTypeInfo;
6 6 import lombok.Data;
... ... @@ -8,7 +8,7 @@ import lombok.Data;
8 8 /**
9 9 * IoT IotDataBridgeConfig 抽象类
10 10 *
11   - * 用于表示数据桥梁配置数据的通用类型,根据具体的 "type" 字段动态映射到对应的子类
  11 + * 用于表示数据目的配置数据的通用类型,根据具体的 "type" 字段动态映射到对应的子类
12 12 * 提供多态支持,适用于不同类型的数据结构序列化和反序列化场景。
13 13 *
14 14 * @author HUIHUI
... ... @@ -28,7 +28,7 @@ public abstract class IotDataBridgeAbstractConfig {
28 28 /**
29 29 * 配置类型
30 30 *
31   - * 枚举 {@link IotDataRuleSinkTypeEnum#getType()}
  31 + * 枚举 {@link IotDataSinkTypeEnum#getType()}
32 32 */
33 33 private String type;
34 34  
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/rule/vo/databridge/config/IotDataBridgeHttpConfig.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/rule/config/IotDataBridgeHttpConfig.java
1   -package cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.config;
  1 +package cn.iocoder.yudao.module.iot.dal.dataobject.rule.config;
2 2  
3 3 import lombok.Data;
4 4  
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/rule/vo/databridge/config/IotDataBridgeKafkaMQConfig.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/rule/config/IotDataBridgeKafkaMQConfig.java
1   -package cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.config;
  1 +package cn.iocoder.yudao.module.iot.dal.dataobject.rule.config;
2 2  
3 3 import lombok.Data;
4 4  
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/rule/vo/databridge/config/IotDataBridgeMqttConfig.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/rule/config/IotDataBridgeMqttConfig.java
1   -package cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.config;
  1 +package cn.iocoder.yudao.module.iot.dal.dataobject.rule.config;
2 2  
3 3 import lombok.Data;
4 4  
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/rule/vo/databridge/config/IotDataBridgeRabbitMQConfig.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/rule/config/IotDataBridgeRabbitMQConfig.java
1   -package cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.config;
  1 +package cn.iocoder.yudao.module.iot.dal.dataobject.rule.config;
2 2  
3 3 import lombok.Data;
4 4  
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/rule/vo/databridge/config/IotDataBridgeRedisStreamConfig.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/rule/config/IotDataBridgeRedisStreamConfig.java
1   -package cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.config;
  1 +package cn.iocoder.yudao.module.iot.dal.dataobject.rule.config;
2 2  
3 3 import lombok.Data;
4 4  
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/controller/admin/rule/vo/databridge/config/IotDataBridgeRocketMQConfig.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/dataobject/rule/config/IotDataBridgeRocketMQConfig.java
1   -package cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.config;
  1 +package cn.iocoder.yudao.module.iot.dal.dataobject.rule.config;
2 2  
3 3 import lombok.Data;
4 4  
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/mysql/rule/IotDataBridgeMapper.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/mysql/rule/IotDataSinkMapper.java
... ... @@ -3,32 +3,30 @@ package cn.iocoder.yudao.module.iot.dal.mysql.rule;
3 3 import cn.iocoder.yudao.framework.common.pojo.PageResult;
4 4 import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
5 5 import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
6   -import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.IotDataBridgePageReqVO;
7   -import cn.iocoder.yudao.module.iot.dal.dataobject.rule.IotDataRuleSinkDO;
  6 +import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.data.sink.IotDataSinkPageReqVO;
  7 +import cn.iocoder.yudao.module.iot.dal.dataobject.rule.IotDataSinkDO;
8 8 import org.apache.ibatis.annotations.Mapper;
9 9  
10 10 import java.util.List;
11 11  
12 12 /**
13   - * IoT 数据桥梁 Mapper
  13 + * IoT 数据流转目的 Mapper
14 14 *
15 15 * @author HUIHUI
16 16 */
17 17 @Mapper
18   -public interface IotDataBridgeMapper extends BaseMapperX<IotDataRuleSinkDO> {
  18 +public interface IotDataSinkMapper extends BaseMapperX<IotDataSinkDO> {
19 19  
20   - default PageResult<IotDataRuleSinkDO> selectPage(IotDataBridgePageReqVO reqVO) {
21   - return selectPage(reqVO, new LambdaQueryWrapperX<IotDataRuleSinkDO>()
22   - .likeIfPresent(IotDataRuleSinkDO::getName, reqVO.getName())
23   - .eqIfPresent(IotDataRuleSinkDO::getStatus, reqVO.getStatus())
24   - .betweenIfPresent(IotDataRuleSinkDO::getCreateTime, reqVO.getCreateTime())
25   - .orderByDesc(IotDataRuleSinkDO::getId));
  20 + default PageResult<IotDataSinkDO> selectPage(IotDataSinkPageReqVO reqVO) {
  21 + return selectPage(reqVO, new LambdaQueryWrapperX<IotDataSinkDO>()
  22 + .likeIfPresent(IotDataSinkDO::getName, reqVO.getName())
  23 + .eqIfPresent(IotDataSinkDO::getStatus, reqVO.getStatus())
  24 + .betweenIfPresent(IotDataSinkDO::getCreateTime, reqVO.getCreateTime())
  25 + .orderByDesc(IotDataSinkDO::getId));
26 26 }
27 27  
28   - default List<IotDataRuleSinkDO> selectList(Integer status) {
29   - return selectList(new LambdaQueryWrapperX<IotDataRuleSinkDO>()
30   - .eqIfPresent(IotDataRuleSinkDO::getStatus, status)
31   - .orderByDesc(IotDataRuleSinkDO::getId));
  28 + default List<IotDataSinkDO> selectListByStatus(Integer status) {
  29 + return selectList(IotDataSinkDO::getStatus, status);
32 30 }
33 31  
34 32 }
35 33 \ No newline at end of file
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/job/rule/IotRuleSceneJob.java
... ... @@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.iot.job.rule;
2 2  
3 3 import cn.hutool.core.map.MapUtil;
4 4 import cn.iocoder.yudao.module.iot.enums.rule.IotRuleSceneTriggerTypeEnum;
5   -import cn.iocoder.yudao.module.iot.service.rule.IotRuleSceneService;
  5 +import cn.iocoder.yudao.module.iot.service.rule.scene.IotRuleSceneService;
6 6 import jakarta.annotation.Resource;
7 7 import lombok.extern.slf4j.Slf4j;
8 8 import org.quartz.JobExecutionContext;
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/mq/consumer/rule/IotRuleSceneMessageHandler.java
... ... @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.iot.mq.consumer.rule;
3 3 import cn.iocoder.yudao.module.iot.core.messagebus.core.IotMessageBus;
4 4 import cn.iocoder.yudao.module.iot.core.messagebus.core.IotMessageSubscriber;
5 5 import cn.iocoder.yudao.module.iot.core.mq.message.IotDeviceMessage;
6   -import cn.iocoder.yudao.module.iot.service.rule.IotRuleSceneService;
  6 +import cn.iocoder.yudao.module.iot.service.rule.scene.IotRuleSceneService;
7 7 import jakarta.annotation.PostConstruct;
8 8 import jakarta.annotation.Resource;
9 9 import lombok.extern.slf4j.Slf4j;
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/IotDataBridgeService.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/data/IotDataSinkService.java
1   -package cn.iocoder.yudao.module.iot.service.rule;
  1 +package cn.iocoder.yudao.module.iot.service.rule.data;
2 2  
3 3 import cn.iocoder.yudao.framework.common.pojo.PageResult;
4   -import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.IotDataBridgePageReqVO;
5   -import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.IotDataBridgeSaveReqVO;
6   -import cn.iocoder.yudao.module.iot.dal.dataobject.rule.IotDataRuleSinkDO;
  4 +import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.data.sink.IotDataSinkPageReqVO;
  5 +import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.data.sink.IotDataSinkSaveReqVO;
  6 +import cn.iocoder.yudao.module.iot.dal.dataobject.rule.IotDataSinkDO;
7 7 import jakarta.validation.Valid;
8 8  
9 9 import java.util.List;
10 10  
11 11 /**
12   - * IoT 数据桥梁 Service 接口
  12 + * IoT 数据流转目的 Service 接口
13 13 *
14 14 * @author HUIHUI
15 15 */
16   -public interface IotDataBridgeService {
  16 +public interface IotDataSinkService {
17 17  
18 18 /**
19   - * 创建数据桥梁
  19 + * 创建数据目的
20 20 *
21 21 * @param createReqVO 创建信息
22 22 * @return 编号
23 23 */
24   - Long createDataBridge(@Valid IotDataBridgeSaveReqVO createReqVO);
  24 + Long createDataSink(@Valid IotDataSinkSaveReqVO createReqVO);
25 25  
26 26 /**
27   - * 更新数据桥梁
  27 + * 更新数据目的
28 28 *
29 29 * @param updateReqVO 更新信息
30 30 */
31   - void updateDataBridge(@Valid IotDataBridgeSaveReqVO updateReqVO);
  31 + void updateDataSink(@Valid IotDataSinkSaveReqVO updateReqVO);
32 32  
33 33 /**
34   - * 删除数据桥梁
  34 + * 删除数据目的
35 35 *
36 36 * @param id 编号
37 37 */
38   - void deleteDataBridge(Long id);
  38 + void deleteDataSink(Long id);
39 39  
40 40 /**
41   - * 获得数据桥梁
  41 + * 获得数据目的
42 42 *
43 43 * @param id 编号
44   - * @return 数据桥梁
  44 + * @return 数据目的
45 45 */
46   - IotDataRuleSinkDO getDataBridge(Long id);
  46 + IotDataSinkDO getDataSink(Long id);
47 47  
48 48 /**
49   - * 获得数据桥梁分页
  49 + * 获得数据目的分页
50 50 *
51 51 * @param pageReqVO 分页查询
52   - * @return 数据桥梁分页
  52 + * @return 数据目的分页
53 53 */
54   - PageResult<IotDataRuleSinkDO> getDataBridgePage(IotDataBridgePageReqVO pageReqVO);
  54 + PageResult<IotDataSinkDO> getDataSinkPage(IotDataSinkPageReqVO pageReqVO);
55 55  
56 56 /**
57   - * 获取数据桥梁列表
  57 + * 获取数据目的列表
58 58 *
59 59 * @param status 状态,如果为空,则不进行筛选
60   - * @return 数据桥梁列表
  60 + * @return 数据目的列表
61 61 */
62   - List<IotDataRuleSinkDO> getDataBridgeList(Integer status);
  62 + List<IotDataSinkDO> getDataSinkListByStatus(Integer status);
63 63  
64 64 }
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/IotDataBridgeServiceImpl.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/data/IotDataSinkServiceImpl.java
1   -package cn.iocoder.yudao.module.iot.service.rule;
  1 +package cn.iocoder.yudao.module.iot.service.rule.data;
2 2  
3 3 import cn.iocoder.yudao.framework.common.pojo.PageResult;
4 4 import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
5   -import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.IotDataBridgePageReqVO;
6   -import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.IotDataBridgeSaveReqVO;
7   -import cn.iocoder.yudao.module.iot.dal.dataobject.rule.IotDataRuleSinkDO;
8   -import cn.iocoder.yudao.module.iot.dal.mysql.rule.IotDataBridgeMapper;
  5 +import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.data.sink.IotDataSinkPageReqVO;
  6 +import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.data.sink.IotDataSinkSaveReqVO;
  7 +import cn.iocoder.yudao.module.iot.dal.dataobject.rule.IotDataSinkDO;
  8 +import cn.iocoder.yudao.module.iot.dal.mysql.rule.IotDataSinkMapper;
9 9 import jakarta.annotation.Resource;
10 10 import org.springframework.stereotype.Service;
11 11 import org.springframework.validation.annotation.Validated;
... ... @@ -16,62 +16,60 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU
16 16 import static cn.iocoder.yudao.module.iot.enums.ErrorCodeConstants.DATA_BRIDGE_NOT_EXISTS;
17 17  
18 18 /**
19   - * IoT 数据桥梁 Service 实现类
  19 + * IoT 数据流转目的 Service 实现类
20 20 *
21 21 * @author HUIHUI
22 22 */
23 23 @Service
24 24 @Validated
25   -public class IotDataBridgeServiceImpl implements IotDataBridgeService {
  25 +public class IotDataSinkServiceImpl implements IotDataSinkService {
26 26  
27 27 @Resource
28   - private IotDataBridgeMapper dataBridgeMapper;
  28 + private IotDataSinkMapper dataSinkMapper;
29 29  
30 30 @Override
31   - public Long createDataBridge(IotDataBridgeSaveReqVO createReqVO) {
32   - // 插入
33   - IotDataRuleSinkDO dataBridge = BeanUtils.toBean(createReqVO, IotDataRuleSinkDO.class);
34   - dataBridgeMapper.insert(dataBridge);
35   - // 返回
  31 + public Long createDataSink(IotDataSinkSaveReqVO createReqVO) {
  32 + IotDataSinkDO dataBridge = BeanUtils.toBean(createReqVO, IotDataSinkDO.class);
  33 + dataSinkMapper.insert(dataBridge);
36 34 return dataBridge.getId();
37 35 }
38 36  
39 37 @Override
40   - public void updateDataBridge(IotDataBridgeSaveReqVO updateReqVO) {
  38 + public void updateDataSink(IotDataSinkSaveReqVO updateReqVO) {
41 39 // 校验存在
42 40 validateDataBridgeExists(updateReqVO.getId());
43 41 // 更新
44   - IotDataRuleSinkDO updateObj = BeanUtils.toBean(updateReqVO, IotDataRuleSinkDO.class);
45   - dataBridgeMapper.updateById(updateObj);
  42 + IotDataSinkDO updateObj = BeanUtils.toBean(updateReqVO, IotDataSinkDO.class);
  43 + dataSinkMapper.updateById(updateObj);
46 44 }
47 45  
48 46 @Override
49   - public void deleteDataBridge(Long id) {
  47 + public void deleteDataSink(Long id) {
50 48 // 校验存在
51 49 validateDataBridgeExists(id);
52 50 // 删除
53   - dataBridgeMapper.deleteById(id);
  51 + dataSinkMapper.deleteById(id);
54 52 }
55 53  
56 54 private void validateDataBridgeExists(Long id) {
57   - if (dataBridgeMapper.selectById(id) == null) {
  55 + if (dataSinkMapper.selectById(id) == null) {
58 56 throw exception(DATA_BRIDGE_NOT_EXISTS);
59 57 }
60 58 }
61 59  
62 60 @Override
63   - public IotDataRuleSinkDO getDataBridge(Long id) {
64   - return dataBridgeMapper.selectById(id);
  61 + public IotDataSinkDO getDataSink(Long id) {
  62 + return dataSinkMapper.selectById(id);
65 63 }
66 64  
67 65 @Override
68   - public PageResult<IotDataRuleSinkDO> getDataBridgePage(IotDataBridgePageReqVO pageReqVO) {
69   - return dataBridgeMapper.selectPage(pageReqVO);
  66 + public PageResult<IotDataSinkDO> getDataSinkPage(IotDataSinkPageReqVO pageReqVO) {
  67 + return dataSinkMapper.selectPage(pageReqVO);
70 68 }
71 69  
72 70 @Override
73   - public List<IotDataRuleSinkDO> getDataBridgeList(Integer status) {
74   - return dataBridgeMapper.selectList(status);
  71 + public List<IotDataSinkDO> getDataSinkListByStatus(Integer status) {
  72 + return dataSinkMapper.selectListByStatus(status);
75 73 }
76 74  
77 75 }
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/action/IotRuleSceneDataBridgeAction.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/data/IotRuleSceneDataBridgeAction.java
1   -package cn.iocoder.yudao.module.iot.service.rule.action;
  1 +package cn.iocoder.yudao.module.iot.service.rule.data;
2 2  
3 3 import cn.hutool.core.lang.Assert;
4 4 import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
5 5 import cn.iocoder.yudao.module.iot.core.mq.message.IotDeviceMessage;
6   -import cn.iocoder.yudao.module.iot.dal.dataobject.rule.IotDataRuleSinkDO;
  6 +import cn.iocoder.yudao.module.iot.dal.dataobject.rule.IotDataSinkDO;
7 7 import cn.iocoder.yudao.module.iot.dal.dataobject.rule.IotRuleSceneDO;
8 8 import cn.iocoder.yudao.module.iot.enums.rule.IotRuleSceneActionTypeEnum;
9   -import cn.iocoder.yudao.module.iot.service.rule.IotDataBridgeService;
10   -import cn.iocoder.yudao.module.iot.service.rule.action.databridge.IotDataBridgeExecute;
  9 +import cn.iocoder.yudao.module.iot.service.rule.data.action.IotDataBridgeExecute;
  10 +import cn.iocoder.yudao.module.iot.service.rule.scene.action.IotRuleSceneAction;
11 11 import jakarta.annotation.Resource;
12 12 import lombok.extern.slf4j.Slf4j;
13 13 import org.springframework.stereotype.Component;
... ... @@ -19,12 +19,13 @@ import java.util.List;
19 19 *
20 20 * @author 芋道源码
21 21 */
  22 +@Deprecated
22 23 @Component
23 24 @Slf4j
24 25 public class IotRuleSceneDataBridgeAction implements IotRuleSceneAction {
25 26  
26 27 @Resource
27   - private IotDataBridgeService dataBridgeService;
  28 + private IotDataSinkService dataBridgeService;
28 29 @Resource
29 30 private List<IotDataBridgeExecute<?>> dataBridgeExecutes;
30 31  
... ... @@ -36,7 +37,7 @@ public class IotRuleSceneDataBridgeAction implements IotRuleSceneAction {
36 37 }
37 38 // 1.2 获得数据桥梁
38 39 Assert.notNull(config.getDataBridgeId(), "数据桥梁编号不能为空");
39   - IotDataRuleSinkDO dataBridge = dataBridgeService.getDataBridge(config.getDataBridgeId());
  40 + IotDataSinkDO dataBridge = dataBridgeService.getDataSink(config.getDataBridgeId());
40 41 if (dataBridge == null || dataBridge.getConfig() == null) {
41 42 log.error("[execute][message({}) config({}) 对应的数据桥梁不存在]", message, config);
42 43 return;
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/action/databridge/AbstractCacheableDataBridgeExecute.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/data/action/AbstractCacheableDataBridgeExecute.java
1   -package cn.iocoder.yudao.module.iot.service.rule.action.databridge;
  1 +package cn.iocoder.yudao.module.iot.service.rule.data.action;
2 2  
3 3 import cn.hutool.core.util.ObjUtil;
4 4 import cn.iocoder.yudao.module.iot.core.mq.message.IotDeviceMessage;
5   -import cn.iocoder.yudao.module.iot.dal.dataobject.rule.IotDataRuleSinkDO;
  5 +import cn.iocoder.yudao.module.iot.dal.dataobject.rule.IotDataSinkDO;
6 6 import com.google.common.cache.CacheBuilder;
7 7 import com.google.common.cache.CacheLoader;
8 8 import com.google.common.cache.LoadingCache;
... ... @@ -100,7 +100,7 @@ public abstract class AbstractCacheableDataBridgeExecute&lt;Config, Producer&gt; imple
100 100  
101 101 @Override
102 102 @SuppressWarnings({"unchecked"})
103   - public void execute(IotDeviceMessage message, IotDataRuleSinkDO dataBridge) {
  103 + public void execute(IotDeviceMessage message, IotDataSinkDO dataBridge) {
104 104 if (ObjUtil.notEqual(dataBridge.getType(), getType())) {
105 105 return;
106 106 }
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/action/databridge/IotDataBridgeExecute.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/data/action/IotDataBridgeExecute.java
1   -package cn.iocoder.yudao.module.iot.service.rule.action.databridge;
  1 +package cn.iocoder.yudao.module.iot.service.rule.data.action;
2 2  
3 3 import cn.iocoder.yudao.module.iot.core.mq.message.IotDeviceMessage;
4   -import cn.iocoder.yudao.module.iot.dal.dataobject.rule.IotDataRuleSinkDO;
  4 +import cn.iocoder.yudao.module.iot.dal.dataobject.rule.IotDataSinkDO;
5 5  
6 6 /**
7 7 * IoT 数据桥梁的执行器 execute 接口
... ... @@ -24,7 +24,7 @@ public interface IotDataBridgeExecute&lt;Config&gt; {
24 24 * @param dataBridge 数据桥梁
25 25 */
26 26 @SuppressWarnings({"unchecked"})
27   - default void execute(IotDeviceMessage message, IotDataRuleSinkDO dataBridge) throws Exception {
  27 + default void execute(IotDeviceMessage message, IotDataSinkDO dataBridge) throws Exception {
28 28 // 1.1 校验数据桥梁类型
29 29 if (!getType().equals(dataBridge.getType())) {
30 30 return;
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/action/databridge/IotHttpDataBridgeExecute.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/data/action/IotHttpDataBridgeExecute.java
1   -package cn.iocoder.yudao.module.iot.service.rule.action.databridge;
  1 +package cn.iocoder.yudao.module.iot.service.rule.data.action;
2 2  
3 3 import cn.hutool.core.collection.CollUtil;
4 4 import cn.iocoder.yudao.framework.common.util.http.HttpUtils;
5 5 import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
6   -import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.config.IotDataBridgeHttpConfig;
  6 +import cn.iocoder.yudao.module.iot.dal.dataobject.rule.config.IotDataBridgeHttpConfig;
7 7 import cn.iocoder.yudao.module.iot.core.mq.message.IotDeviceMessage;
8   -import cn.iocoder.yudao.module.iot.enums.rule.IotDataRuleSinkTypeEnum;
  8 +import cn.iocoder.yudao.module.iot.enums.rule.IotDataSinkTypeEnum;
9 9 import jakarta.annotation.Resource;
10 10 import lombok.extern.slf4j.Slf4j;
11 11 import org.springframework.http.*;
... ... @@ -30,7 +30,7 @@ public class IotHttpDataBridgeExecute implements IotDataBridgeExecute&lt;IotDataBri
30 30  
31 31 @Override
32 32 public Integer getType() {
33   - return IotDataRuleSinkTypeEnum.HTTP.getType();
  33 + return IotDataSinkTypeEnum.HTTP.getType();
34 34 }
35 35  
36 36 @Override
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/action/databridge/IotKafkaMQDataBridgeExecute.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/data/action/IotKafkaMQDataBridgeExecute.java
1   -package cn.iocoder.yudao.module.iot.service.rule.action.databridge;
  1 +package cn.iocoder.yudao.module.iot.service.rule.data.action;
2 2  
3   -import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.config.IotDataBridgeKafkaMQConfig;
  3 +import cn.iocoder.yudao.module.iot.dal.dataobject.rule.config.IotDataBridgeKafkaMQConfig;
4 4 import cn.iocoder.yudao.module.iot.core.mq.message.IotDeviceMessage;
5   -import cn.iocoder.yudao.module.iot.enums.rule.IotDataRuleSinkTypeEnum;
  5 +import cn.iocoder.yudao.module.iot.enums.rule.IotDataSinkTypeEnum;
6 6 import lombok.extern.slf4j.Slf4j;
7 7 import org.apache.kafka.clients.producer.ProducerConfig;
8 8 import org.apache.kafka.common.serialization.StringSerializer;
... ... @@ -31,7 +31,7 @@ public class IotKafkaMQDataBridgeExecute extends
31 31  
32 32 @Override
33 33 public Integer getType() {
34   - return IotDataRuleSinkTypeEnum.KAFKA.getType();
  34 + return IotDataSinkTypeEnum.KAFKA.getType();
35 35 }
36 36  
37 37 @Override
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/action/databridge/IotRabbitMQDataBridgeExecute.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/data/action/IotRabbitMQDataBridgeExecute.java
1   -package cn.iocoder.yudao.module.iot.service.rule.action.databridge;
  1 +package cn.iocoder.yudao.module.iot.service.rule.data.action;
2 2  
3   -import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.config.IotDataBridgeRabbitMQConfig;
  3 +import cn.iocoder.yudao.module.iot.dal.dataobject.rule.config.IotDataBridgeRabbitMQConfig;
4 4 import cn.iocoder.yudao.module.iot.core.mq.message.IotDeviceMessage;
5   -import cn.iocoder.yudao.module.iot.enums.rule.IotDataRuleSinkTypeEnum;
  5 +import cn.iocoder.yudao.module.iot.enums.rule.IotDataSinkTypeEnum;
6 6 import com.rabbitmq.client.Channel;
7 7 import com.rabbitmq.client.Connection;
8 8 import com.rabbitmq.client.ConnectionFactory;
... ... @@ -26,7 +26,7 @@ public class IotRabbitMQDataBridgeExecute extends
26 26  
27 27 @Override
28 28 public Integer getType() {
29   - return IotDataRuleSinkTypeEnum.RABBITMQ.getType();
  29 + return IotDataSinkTypeEnum.RABBITMQ.getType();
30 30 }
31 31  
32 32 @Override
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/action/databridge/IotRedisStreamDataBridgeExecute.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/data/action/IotRedisStreamDataBridgeExecute.java
1   -package cn.iocoder.yudao.module.iot.service.rule.action.databridge;
  1 +package cn.iocoder.yudao.module.iot.service.rule.data.action;
2 2  
3 3 import cn.hutool.core.util.StrUtil;
4   -import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.config.IotDataBridgeRedisStreamConfig;
  4 +import cn.iocoder.yudao.module.iot.dal.dataobject.rule.config.IotDataBridgeRedisStreamConfig;
5 5 import cn.iocoder.yudao.module.iot.core.mq.message.IotDeviceMessage;
6   -import cn.iocoder.yudao.module.iot.enums.rule.IotDataRuleSinkTypeEnum;
  6 +import cn.iocoder.yudao.module.iot.enums.rule.IotDataSinkTypeEnum;
7 7 import lombok.extern.slf4j.Slf4j;
8 8 import org.redisson.Redisson;
9 9 import org.redisson.api.RedissonClient;
... ... @@ -29,7 +29,7 @@ public class IotRedisStreamDataBridgeExecute extends
29 29  
30 30 @Override
31 31 public Integer getType() {
32   - return IotDataRuleSinkTypeEnum.REDIS_STREAM.getType();
  32 + return IotDataSinkTypeEnum.REDIS_STREAM.getType();
33 33 }
34 34  
35 35 @Override
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/action/databridge/IotRocketMQDataBridgeExecute.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/data/action/IotRocketMQDataBridgeExecute.java
1   -package cn.iocoder.yudao.module.iot.service.rule.action.databridge;
  1 +package cn.iocoder.yudao.module.iot.service.rule.data.action;
2 2  
3   -import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.config.IotDataBridgeRocketMQConfig;
  3 +import cn.iocoder.yudao.module.iot.dal.dataobject.rule.config.IotDataBridgeRocketMQConfig;
4 4 import cn.iocoder.yudao.module.iot.core.mq.message.IotDeviceMessage;
5   -import cn.iocoder.yudao.module.iot.enums.rule.IotDataRuleSinkTypeEnum;
  5 +import cn.iocoder.yudao.module.iot.enums.rule.IotDataSinkTypeEnum;
6 6 import lombok.extern.slf4j.Slf4j;
7 7 import org.apache.rocketmq.client.producer.DefaultMQProducer;
8 8 import org.apache.rocketmq.client.producer.SendResult;
... ... @@ -25,7 +25,7 @@ public class IotRocketMQDataBridgeExecute extends
25 25  
26 26 @Override
27 27 public Integer getType() {
28   - return IotDataRuleSinkTypeEnum.ROCKETMQ.getType();
  28 + return IotDataSinkTypeEnum.ROCKETMQ.getType();
29 29 }
30 30  
31 31 @Override
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/IotRuleSceneService.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/scene/IotRuleSceneService.java
1   -package cn.iocoder.yudao.module.iot.service.rule;
  1 +package cn.iocoder.yudao.module.iot.service.rule.scene;
2 2  
3 3 import cn.iocoder.yudao.framework.common.pojo.PageResult;
4 4 import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.scene.IotRuleScenePageReqVO;
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/IotRuleSceneServiceImpl.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/scene/IotRuleSceneServiceImpl.java
1   -package cn.iocoder.yudao.module.iot.service.rule;
  1 +package cn.iocoder.yudao.module.iot.service.rule.scene;
2 2  
3 3 import cn.hutool.core.collection.CollUtil;
4 4 import cn.hutool.core.collection.ListUtil;
... ... @@ -27,7 +27,7 @@ import cn.iocoder.yudao.module.iot.enums.rule.IotRuleSceneConditionOperatorEnum;
27 27 import cn.iocoder.yudao.module.iot.enums.rule.IotRuleSceneTriggerTypeEnum;
28 28 import cn.iocoder.yudao.module.iot.framework.job.core.IotSchedulerManager;
29 29 import cn.iocoder.yudao.module.iot.job.rule.IotRuleSceneJob;
30   -import cn.iocoder.yudao.module.iot.service.rule.action.IotRuleSceneAction;
  30 +import cn.iocoder.yudao.module.iot.service.rule.scene.action.IotRuleSceneAction;
31 31 import jakarta.annotation.Resource;
32 32 import lombok.SneakyThrows;
33 33 import lombok.extern.slf4j.Slf4j;
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/action/IotRuleSceneAction.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/scene/action/IotRuleSceneAction.java
1   -package cn.iocoder.yudao.module.iot.service.rule.action;
  1 +package cn.iocoder.yudao.module.iot.service.rule.scene.action;
2 2  
3 3 import cn.iocoder.yudao.module.iot.core.mq.message.IotDeviceMessage;
4 4 import cn.iocoder.yudao.module.iot.dal.dataobject.rule.IotRuleSceneDO;
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/action/IotRuleSceneAlertAction.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/scene/action/IotRuleSceneAlertAction.java
1   -package cn.iocoder.yudao.module.iot.service.rule.action;
  1 +package cn.iocoder.yudao.module.iot.service.rule.scene.action;
2 2  
3 3 import cn.iocoder.yudao.module.iot.core.mq.message.IotDeviceMessage;
4 4 import cn.iocoder.yudao.module.iot.dal.dataobject.rule.IotRuleSceneDO;
... ...
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/action/IotRuleSceneDeviceControlAction.java renamed to yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/rule/scene/action/IotRuleSceneDeviceControlAction.java
1   -package cn.iocoder.yudao.module.iot.service.rule.action;
  1 +package cn.iocoder.yudao.module.iot.service.rule.scene.action;
2 2  
3 3 import cn.hutool.core.lang.Assert;
4 4 import cn.iocoder.yudao.module.iot.core.mq.message.IotDeviceMessage;
... ...
yudao-module-iot/yudao-module-iot-biz/src/test/java/cn/iocoder/yudao/module/iot/service/rule/action/databridge/IotDataBridgeExecuteTest.java
1 1 package cn.iocoder.yudao.module.iot.service.rule.action.databridge;
2 2  
3 3 import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest;
4   -import cn.iocoder.yudao.module.iot.controller.admin.rule.vo.databridge.config.*;
5 4 import cn.iocoder.yudao.module.iot.core.mq.message.IotDeviceMessage;
6   -import cn.iocoder.yudao.module.iot.dal.dataobject.rule.IotDataRuleSinkDO;
  5 +import cn.iocoder.yudao.module.iot.dal.dataobject.rule.IotDataSinkDO;
  6 +import cn.iocoder.yudao.module.iot.dal.dataobject.rule.config.*;
  7 +import cn.iocoder.yudao.module.iot.service.rule.data.action.*;
7 8 import lombok.extern.slf4j.Slf4j;
8 9 import org.junit.jupiter.api.BeforeEach;
9 10 import org.junit.jupiter.api.Disabled;
... ... @@ -129,7 +130,7 @@ public class IotDataBridgeExecuteTest extends BaseMockitoUnitTest {
129 130  
130 131 // 3. 执行测试
131 132 log.info("[testHttpDataBridge][执行HTTP数据桥接测试]");
132   - httpDataBridgeExecute.execute(message, new IotDataRuleSinkDO()
  133 + httpDataBridgeExecute.execute(message, new IotDataSinkDO()
133 134 .setType(httpDataBridgeExecute.getType()).setConfig(config));
134 135 }
135 136  
... ... @@ -144,10 +145,10 @@ public class IotDataBridgeExecuteTest extends BaseMockitoUnitTest {
144 145 private void executeAndVerifyCache(IotDataBridgeExecute<?> action, IotDataBridgeAbstractConfig config, String type)
145 146 throws Exception {
146 147 log.info("[test{}DataBridge][第一次执行,应该会创建新的 producer]", type);
147   - action.execute(message, new IotDataRuleSinkDO().setType(action.getType()).setConfig(config));
  148 + action.execute(message, new IotDataSinkDO().setType(action.getType()).setConfig(config));
148 149  
149 150 log.info("[test{}DataBridge][第二次执行,应该会复用缓存的 producer]", type);
150   - action.execute(message, new IotDataRuleSinkDO().setType(action.getType()).setConfig(config));
  151 + action.execute(message, new IotDataSinkDO().setType(action.getType()).setConfig(config));
151 152 }
152 153  
153 154 }
... ...