feat(iot): B1 新建 viewsh-module-iot-rule Maven 模块骨架
- 新增 viewsh-module-iot-rule/pom.xml(仅依赖 iot-api + iot-core + Aviator 5.3.3 + mybatis/redis starter) - 新增 package-info.java / ModuleSmokeTest.java / spring.factories 占位 - viewsh-module-iot/pom.xml <modules> 新增 rule(core 之后、server 之前) - viewsh-module-iot-server/pom.xml 新增 rule 依赖(core 之后、业务组件之前) - Known Pitfalls 落地: ⚠️ 评审 A3:依赖方向 rule → core → api,严禁反向(dependency:tree 验证) ⚠️ 评审 R6:server 对 rule 的依赖按项目一贯顺序插入 ⚠️ Aviator 5.3.3 首次引入,rule 模块 pom 内显式声明 version Acceptance Criteria 全 8 项通过(见任务卡 Notes §8.2026-04-23 执行记录) Co-Authored-By: Claude Sonnet (B1 subagent) <noreply@anthropic.com> Co-Authored-By: Claude Opus 4.7 (1M context, orchestrator) <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
<modules>
|
||||
<module>viewsh-module-iot-api</module>
|
||||
<module>viewsh-module-iot-core</module>
|
||||
<module>viewsh-module-iot-rule</module>
|
||||
<module>viewsh-module-iot-server</module>
|
||||
<module>viewsh-module-iot-gateway</module>
|
||||
</modules>
|
||||
|
||||
58
viewsh-module-iot/viewsh-module-iot-rule/pom.xml
Normal file
58
viewsh-module-iot/viewsh-module-iot-rule/pom.xml
Normal file
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>viewsh-module-iot</artifactId>
|
||||
<groupId>com.viewsh</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>viewsh-module-iot-rule</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>IoT 规则引擎独立模块(DAG + SPI + 抖动抑制 + Aviator 脚本)</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- 内部模块:只依赖 api(DTO/枚举)和 core(消息总线/影子接口) -->
|
||||
<dependency>
|
||||
<groupId>com.viewsh</groupId>
|
||||
<artifactId>viewsh-module-iot-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.viewsh</groupId>
|
||||
<artifactId>viewsh-module-iot-core</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 【关键】Aviator 表达式引擎 -->
|
||||
<dependency>
|
||||
<groupId>com.googlecode.aviator</groupId>
|
||||
<artifactId>aviator</artifactId>
|
||||
<version>5.3.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- DB 相关 -->
|
||||
<dependency>
|
||||
<groupId>com.viewsh</groupId>
|
||||
<artifactId>viewsh-spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 缓存相关 -->
|
||||
<dependency>
|
||||
<groupId>com.viewsh</groupId>
|
||||
<artifactId>viewsh-spring-boot-starter-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 测试 -->
|
||||
<dependency>
|
||||
<groupId>com.viewsh</groupId>
|
||||
<artifactId>viewsh-spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* viewsh-module-iot-rule —— IoT 规则引擎模块
|
||||
*
|
||||
* <p>职责:DAG 规则链执行器、SPI Provider(Trigger/Condition/Action)、抖动抑制、Aviator 脚本</p>
|
||||
* <p>依赖边界(见第 8 轮评审系统边界 A):
|
||||
* - 可依赖:iot-api(DTO/枚举)、iot-core(消息总线/影子接口)
|
||||
* - 不可依赖:iot-gateway(接入层)、iot-server(业务层)
|
||||
* </p>
|
||||
*/
|
||||
package com.viewsh.module.iot.rule;
|
||||
@@ -0,0 +1,4 @@
|
||||
# viewsh-module-iot-rule Spring Boot 自动配置
|
||||
# 后续任务(B2+)在此注册 AutoConfiguration 类
|
||||
# org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
# com.viewsh.module.iot.rule.config.IotRuleAutoConfiguration
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.viewsh.module.iot.rule;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class ModuleSmokeTest {
|
||||
@Test
|
||||
void moduleStructureOk() {
|
||||
// 仅断言模块可加载、包声明存在
|
||||
assertNotNull(ModuleSmokeTest.class.getPackage());
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,11 @@
|
||||
<artifactId>viewsh-module-iot-core</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.viewsh</groupId>
|
||||
<artifactId>viewsh-module-iot-rule</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 业务组件 -->
|
||||
<dependency>
|
||||
|
||||
Reference in New Issue
Block a user