ai-engineering-init 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/.claude/hooks/skill-forced-eval.js +46 -62
  2. package/.claude/settings.json +10 -1
  3. package/.claude/skills/api-development/SKILL.md +179 -130
  4. package/.claude/skills/architecture-design/SKILL.md +102 -212
  5. package/.claude/skills/backend-annotations/SKILL.md +166 -220
  6. package/.claude/skills/bug-detective/SKILL.md +225 -186
  7. package/.claude/skills/code-patterns/SKILL.md +127 -244
  8. package/.claude/skills/collaborating-with-codex/SKILL.md +96 -113
  9. package/.claude/skills/crud-development/SKILL.md +226 -307
  10. package/.claude/skills/data-permission/SKILL.md +131 -202
  11. package/.claude/skills/database-ops/SKILL.md +158 -355
  12. package/.claude/skills/error-handler/SKILL.md +224 -285
  13. package/.claude/skills/file-oss-management/SKILL.md +174 -169
  14. package/.claude/skills/git-workflow/SKILL.md +123 -341
  15. package/.claude/skills/json-serialization/SKILL.md +121 -137
  16. package/.claude/skills/performance-doctor/SKILL.md +83 -89
  17. package/.claude/skills/redis-cache/SKILL.md +134 -185
  18. package/.claude/skills/scheduled-jobs/SKILL.md +187 -224
  19. package/.claude/skills/security-guard/SKILL.md +168 -276
  20. package/.claude/skills/sms-mail/SKILL.md +266 -228
  21. package/.claude/skills/social-login/SKILL.md +257 -195
  22. package/.claude/skills/tenant-management/SKILL.md +172 -188
  23. package/.claude/skills/utils-toolkit/SKILL.md +214 -222
  24. package/.claude/skills/websocket-sse/SKILL.md +251 -172
  25. package/.claude/skills/workflow-engine/SKILL.md +178 -250
  26. package/.codex/skills/api-development/SKILL.md +179 -130
  27. package/.codex/skills/architecture-design/SKILL.md +102 -212
  28. package/.codex/skills/backend-annotations/SKILL.md +166 -220
  29. package/.codex/skills/bug-detective/SKILL.md +225 -186
  30. package/.codex/skills/code-patterns/SKILL.md +127 -244
  31. package/.codex/skills/collaborating-with-codex/SKILL.md +96 -113
  32. package/.codex/skills/crud-development/SKILL.md +226 -307
  33. package/.codex/skills/data-permission/SKILL.md +131 -202
  34. package/.codex/skills/database-ops/SKILL.md +158 -355
  35. package/.codex/skills/error-handler/SKILL.md +224 -285
  36. package/.codex/skills/file-oss-management/SKILL.md +174 -169
  37. package/.codex/skills/git-workflow/SKILL.md +123 -341
  38. package/.codex/skills/json-serialization/SKILL.md +121 -137
  39. package/.codex/skills/performance-doctor/SKILL.md +83 -89
  40. package/.codex/skills/redis-cache/SKILL.md +134 -185
  41. package/.codex/skills/scheduled-jobs/SKILL.md +187 -224
  42. package/.codex/skills/security-guard/SKILL.md +168 -276
  43. package/.codex/skills/sms-mail/SKILL.md +266 -228
  44. package/.codex/skills/social-login/SKILL.md +257 -195
  45. package/.codex/skills/tenant-management/SKILL.md +172 -188
  46. package/.codex/skills/utils-toolkit/SKILL.md +214 -222
  47. package/.codex/skills/websocket-sse/SKILL.md +251 -172
  48. package/.codex/skills/workflow-engine/SKILL.md +178 -250
  49. package/.cursor/hooks/cursor-skill-eval.js +66 -6
  50. package/.cursor/skills/api-development/SKILL.md +179 -130
  51. package/.cursor/skills/architecture-design/SKILL.md +102 -212
  52. package/.cursor/skills/backend-annotations/SKILL.md +166 -220
  53. package/.cursor/skills/bug-detective/SKILL.md +225 -186
  54. package/.cursor/skills/code-patterns/SKILL.md +127 -244
  55. package/.cursor/skills/collaborating-with-codex/SKILL.md +96 -113
  56. package/.cursor/skills/crud-development/SKILL.md +226 -307
  57. package/.cursor/skills/data-permission/SKILL.md +131 -202
  58. package/.cursor/skills/database-ops/SKILL.md +158 -355
  59. package/.cursor/skills/error-handler/SKILL.md +224 -285
  60. package/.cursor/skills/file-oss-management/SKILL.md +174 -169
  61. package/.cursor/skills/git-workflow/SKILL.md +123 -341
  62. package/.cursor/skills/json-serialization/SKILL.md +121 -137
  63. package/.cursor/skills/performance-doctor/SKILL.md +83 -89
  64. package/.cursor/skills/redis-cache/SKILL.md +134 -185
  65. package/.cursor/skills/scheduled-jobs/SKILL.md +187 -224
  66. package/.cursor/skills/security-guard/SKILL.md +168 -276
  67. package/.cursor/skills/sms-mail/SKILL.md +266 -228
  68. package/.cursor/skills/social-login/SKILL.md +257 -195
  69. package/.cursor/skills/tenant-management/SKILL.md +172 -188
  70. package/.cursor/skills/utils-toolkit/SKILL.md +214 -222
  71. package/.cursor/skills/websocket-sse/SKILL.md +251 -172
  72. package/.cursor/skills/workflow-engine/SKILL.md +178 -250
  73. package/AGENTS.md +49 -540
  74. package/CLAUDE.md +73 -119
  75. package/README.md +37 -6
  76. package/bin/index.js +5 -1
  77. package/package.json +1 -1
  78. package/src/skills/api-development/SKILL.md +179 -130
  79. package/src/skills/architecture-design/SKILL.md +102 -212
  80. package/src/skills/backend-annotations/SKILL.md +166 -220
  81. package/src/skills/bug-detective/SKILL.md +225 -186
  82. package/src/skills/code-patterns/SKILL.md +127 -244
  83. package/src/skills/collaborating-with-codex/SKILL.md +96 -113
  84. package/src/skills/crud-development/SKILL.md +226 -307
  85. package/src/skills/data-permission/SKILL.md +131 -202
  86. package/src/skills/database-ops/SKILL.md +158 -355
  87. package/src/skills/error-handler/SKILL.md +224 -285
  88. package/src/skills/file-oss-management/SKILL.md +174 -169
  89. package/src/skills/git-workflow/SKILL.md +123 -341
  90. package/src/skills/json-serialization/SKILL.md +121 -137
  91. package/src/skills/performance-doctor/SKILL.md +83 -89
  92. package/src/skills/redis-cache/SKILL.md +134 -185
  93. package/src/skills/scheduled-jobs/SKILL.md +187 -224
  94. package/src/skills/security-guard/SKILL.md +168 -276
  95. package/src/skills/sms-mail/SKILL.md +266 -228
  96. package/src/skills/social-login/SKILL.md +257 -195
  97. package/src/skills/tenant-management/SKILL.md +172 -188
  98. package/src/skills/utils-toolkit/SKILL.md +214 -222
  99. package/src/skills/websocket-sse/SKILL.md +251 -172
  100. package/src/skills/workflow-engine/SKILL.md +178 -250
  101. package/.claude/skills/skill-creator/LICENSE.txt +0 -202
  102. package/.claude/skills/skill-creator/SKILL.md +0 -479
  103. package/.claude/skills/skill-creator/agents/analyzer.md +0 -274
  104. package/.claude/skills/skill-creator/agents/comparator.md +0 -202
  105. package/.claude/skills/skill-creator/agents/grader.md +0 -223
  106. package/.claude/skills/skill-creator/assets/eval_review.html +0 -146
  107. package/.claude/skills/skill-creator/eval-viewer/generate_review.py +0 -471
  108. package/.claude/skills/skill-creator/eval-viewer/viewer.html +0 -1325
  109. package/.claude/skills/skill-creator/references/schemas.md +0 -430
  110. package/.claude/skills/skill-creator/scripts/__init__.py +0 -0
  111. package/.claude/skills/skill-creator/scripts/aggregate_benchmark.py +0 -401
  112. package/.claude/skills/skill-creator/scripts/generate_report.py +0 -326
  113. package/.claude/skills/skill-creator/scripts/improve_description.py +0 -248
  114. package/.claude/skills/skill-creator/scripts/package_skill.py +0 -136
  115. package/.claude/skills/skill-creator/scripts/quick_validate.py +0 -103
  116. package/.claude/skills/skill-creator/scripts/run_eval.py +0 -310
  117. package/.claude/skills/skill-creator/scripts/run_loop.py +0 -332
  118. package/.claude/skills/skill-creator/scripts/utils.py +0 -47
@@ -1,262 +1,152 @@
1
1
  ---
2
2
  name: architecture-design
3
3
  description: |
4
- 系统架构设计、模块划分、代码重构、技术栈选型。核心内容:三层架构规范、业务模块划分、表设计规范、技术栈优先级决策。
5
-
6
- 触发场景:
7
- - 系统整体架构设计
8
- - 新业务模块的模块划分与结构规划
9
- - 代码分层与重构策略
10
- - 依赖关系梳理与解耦
11
- - 架构演进路径建议
12
- - 领域边界划分与包结构设计
13
- - 技术栈选型与方案决策
14
-
15
- 触发词:架构设计、模块划分、三层架构、分层、领域划分、重构、解耦、依赖管理、系统设计、代码组织、技术栈、架构演进
16
-
17
- 注意:
18
- 1. 具体技术对比(Redis vs 本地缓存)-> 使用 tech-decision
19
- 2. 开发具体 CRUD 模块 -> 使用 crud-development
20
- 3. 数据库建表与字典配置 -> 使用 database-ops
21
- 4. 本项目是纯后端项目(无前端代码)
4
+ 通用架构设计指南。涵盖分层架构、模块划分、依赖管理等架构决策方法论。
5
+ 触发场景:系统设计、模块拆分、架构评审、技术选型。
6
+ 触发词:架构设计、分层架构、模块划分、系统设计、技术选型。
7
+ 注意:如果项目有专属技能(如 `leniu-architecture`),优先使用专属版本。
22
8
  ---
23
9
 
24
10
  # 架构设计指南
25
11
 
26
- ## 核心技术栈
12
+ > 通用模板。如果项目有专属技能(如 `leniu-architecture`),优先使用。
27
13
 
28
- | 层级 | 技术栈 | 版本 |
29
- |------|--------|------|
30
- | 后端框架 | Spring Boot | 3.5.9 |
31
- | 开发语言 | Java | 17 |
32
- | ORM | MyBatis-Plus | 3.5.16 |
33
- | 安全 | Sa-Token | 1.44.0 |
34
- | 数据库 | MySQL | 8.0+ |
35
- | 缓存 | Redis + Redisson | 3.52.0 |
36
- | 文档 | SpringDoc | 2.8.15 |
37
- | 工具库 | Hutool | 5.8.43 |
38
- | 对象转换 | Mapstruct-Plus | 1.5.0 |
14
+ ## 核心规范
39
15
 
40
- ## 已集成技术栈(按优先级)
16
+ ### 分层架构对比
41
17
 
42
- ### 高优先级(优先选择)
43
-
44
- | 技术 | 使用场景 |
45
- |------|---------|
46
- | Redis + Redisson | 缓存、分布式锁、延迟队列、布隆过滤器 |
47
- | WebSocket | 实时推送、在线聊天、消息通知 |
48
- | Sa-Token | 权限控制、登录认证、单点登录 |
49
- | Lock4j | 分布式锁(基于 Redisson) |
50
- | SnailJob | 分布式定时任务、复杂调度 |
51
-
52
- ### 中优先级(按需使用)
53
-
54
- | 技术 | 使用场景 |
55
- |------|---------|
56
- | SSE | 服务端单向推送 |
57
- | FastExcel | Excel 导入导出 |
58
- | SMS4j | 多平台短信发送 |
59
- | JustAuth | 第三方 OAuth 登录(30+ 平台) |
60
- | AWS S3 | 对象存储(兼容 MinIO) |
61
- | MailSender | 邮件发送 |
62
- | Redis Streams | 轻量级消息队列 |
63
-
64
- ### 已集成扩展能力
65
-
66
- 数据加密、数据脱敏、防重复提交、国际化翻译、审计日志、接口限流
67
-
68
- ### 需自行扩展
69
-
70
- | 技术 | 使用场景 |
71
- |------|---------|
72
- | RocketMQ | 高吞吐消息队列、分布式事务 |
73
- | MQTT | 物联网设备通信 |
74
- | LangChain4j | AI 大模型集成 |
75
-
76
- ### 技术选型决策树
18
+ #### 三层架构(标准 Spring Boot)
77
19
 
78
20
  ```
79
- 需要实时通信?
80
- +-- 是 -> WebSocket(首选)
81
- +-- 否 -> 需要消息队列?
82
- +-- 是 -> Redis Streams(优先) / RocketMQ(高吞吐,自行引入)
83
- +-- 否 -> 需要定时任务?
84
- +-- 是 -> SnailJob(分布式) / @Scheduled(简单场景)
85
- +-- 否 -> 需要缓存?
86
- +-- 是 -> Redis + Redisson
21
+ Controller -> Service -> Mapper/Repository
22
+ (接口层) (业务层) (数据访问层)
87
23
  ```
88
24
 
89
- ---
90
-
91
- ## 三层架构(Controller -> Service -> Mapper)
25
+ - **适用场景**:中小型项目、业务逻辑相对简单
26
+ - **优点**:结构清晰、上手快、团队共识强
27
+ - **缺点**:Service 层容易膨胀为"上帝类"
92
28
 
93
- **没有独立的 DAO 层。** Service 直接调用 Mapper,`buildQueryWrapper()` 在 Service 实现类中。
29
+ #### 四层架构(增加编排层)
94
30
 
95
31
  ```
96
- Controller 层:接收 HTTP 请求、参数校验、返回 R<T>
97
- |
98
- Service 层:业务逻辑、事务管理、buildQueryWrapper()、直接注入 Mapper
99
- |
100
- Mapper 层:extends BaseMapperPlus<Entity, Vo>,ORM 映射
32
+ Controller -> Business/Facade -> Service -> Mapper/Repository
33
+ (接口层) (业务编排层) (领域服务) (数据访问层)
101
34
  ```
102
35
 
103
- ---
36
+ - **适用场景**:大型项目、复杂业务编排、跨 Service 协调
37
+ - **优点**:职责更细粒度、Service 保持纯净
38
+ - **缺点**:层次多、小项目过度设计
104
39
 
105
- ## 模块划分与表前缀
40
+ #### 选择建议
106
41
 
107
- **包名必须是 `org.dromara.*`**
42
+ | 条件 | 推荐 |
43
+ |------|------|
44
+ | 单表 CRUD 为主 | 三层架构 |
45
+ | 跨模块协调频繁 | 四层架构 |
46
+ | 团队 < 5 人 | 三层架构 |
47
+ | 微服务拆分 | 三层 + DDD |
108
48
 
109
- ### 标准模块
49
+ ### 模块划分原则
110
50
 
111
- | 模块 | 目录 | 包路径 | 表前缀 |
112
- |------|------|--------|--------|
113
- | 系统管理 | `ruoyi-modules/ruoyi-system/` | `org.dromara.system` | `sys_` |
114
- | 演示模块 | `ruoyi-modules/ruoyi-demo/` | `org.dromara.demo` | `test_` |
115
- | 工作流 | `ruoyi-modules/ruoyi-workflow/` | `org.dromara.workflow` | `flow_` |
51
+ 1. **高内聚低耦合**:模块内部紧密关联,模块间依赖最小化
52
+ 2. **按业务域拆分**:而非按技术层拆分
53
+ 3. **单一职责**:每个模块只负责一个业务领域
54
+ 4. **接口隔离**:模块间通过接口/API 通信,不直接依赖实现
116
55
 
117
- ### 扩展模块命名
56
+ ### 推荐模块结构
118
57
 
119
58
  ```
120
- ruoyi-modules/ruoyi-{业务}/ -> org.dromara.{业务} -> {前缀}_
121
- 例:ruoyi-mall/ -> org.dromara.mall -> m_
59
+ project-root/
60
+ ├── project-common/ # 公共模块(工具类、通用常量)
61
+ ├── project-api/ # 对外 API 定义(Feign 接口、DTO)
62
+ ├── project-module-order/ # 订单模块
63
+ ├── project-module-user/ # 用户模块
64
+ ├── project-module-payment/ # 支付模块
65
+ └── project-gateway/ # 网关(微服务场景)
122
66
  ```
123
67
 
124
- ### 关键规则
125
-
126
- ```java
127
- // 1. 表前缀与模块一一对应
128
- // OK: sys_user -> ruoyi-system NG: sys_user -> ruoyi-demo
129
-
130
- // 2. 所有业务表继承 TenantEntity
131
- public class Order extends TenantEntity {
132
- @TableId(value = "id") // 雪花ID,依赖全局配置,不指定 type
133
- private Long id;
68
+ ### 每个模块内部结构
134
69
 
135
- @TableLogic
136
- private Long delFlag; // 逻辑删除
137
- }
138
-
139
- // 3. 主键使用雪花 ID(全局配置 idType: ASSIGN_ID)
140
- @TableId(value = "id") // OK
141
- @TableId(value = "id", type = IdType.ASSIGN_ID) // NG: 冗余
142
- // SQL 中禁止 AUTO_INCREMENT
70
+ ```
71
+ [你的包名].[module]/
72
+ ├── controller/ # 接口层
73
+ ├── service/
74
+ │ └── impl/ # 业务实现
75
+ ├── mapper/ # 数据访问
76
+ ├── entity/ # 实体
77
+ ├── dto/ # 请求参数
78
+ ├── vo/ # 响应对象
79
+ ├── enums/ # 枚举
80
+ └── config/ # 模块配置
143
81
  ```
144
82
 
145
- ---
83
+ ## 代码示例
146
84
 
147
- ## 模块内部结构(以 TestDemo 为例)
85
+ ### 依赖方向(必须单向)
148
86
 
149
87
  ```
150
- ruoyi-modules/ruoyi-demo/src/main/java/org/dromara/demo/
151
- +-- controller/
152
- | +-- TestDemoController.java # @RestController
153
- +-- service/
154
- | +-- ITestDemoService.java # 接口
155
- | +-- impl/
156
- | +-- TestDemoServiceImpl.java # 实现(含 buildQueryWrapper)
157
- +-- mapper/
158
- | +-- TestDemoMapper.java # extends BaseMapperPlus<TestDemo, TestDemoVo>
159
- +-- domain/
160
- +-- TestDemo.java # extends TenantEntity
161
- +-- bo/
162
- | +-- TestDemoBo.java # @AutoMapper
163
- +-- vo/
164
- +-- TestDemoVo.java
88
+ Controller --> Service --> Mapper
89
+ | |
90
+ v v
91
+ DTO/VO Entity
165
92
  ```
166
93
 
167
- ### Service 实现核心模式
94
+ - 上层可以依赖下层,下层不能依赖上层
95
+ - 同层之间避免循环依赖
96
+ - 公共模块被所有业务模块依赖,但公共模块不依赖任何业务模块
97
+
98
+ ### 模块间通信模式
168
99
 
169
100
  ```java
101
+ // 方式一:直接依赖(单体应用)
170
102
  @Service
171
- public class TestDemoServiceImpl implements ITestDemoService {
172
- private final TestDemoMapper baseMapper; // 直接注入 Mapper
173
-
174
- private LambdaQueryWrapper<TestDemo> buildQueryWrapper(TestDemoBo bo) {
175
- Map<String, Object> params = bo.getParams();
176
- LambdaQueryWrapper<TestDemo> lqw = Wrappers.lambdaQuery();
177
- lqw.eq(bo.getDeptId() != null, TestDemo::getDeptId, bo.getDeptId());
178
- lqw.like(StringUtils.isNotBlank(bo.getTestKey()), TestDemo::getTestKey, bo.getTestKey());
179
- lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
180
- TestDemo::getCreateTime, params.get("beginCreateTime"), params.get("endCreateTime"));
181
- return lqw;
182
- }
103
+ @RequiredArgsConstructor
104
+ public class OrderServiceImpl implements IOrderService {
105
+ private final IUserService userService; // 直接注入其他模块 Service
106
+ }
107
+
108
+ // 方式二:事件驱动(解耦)
109
+ @Service
110
+ @RequiredArgsConstructor
111
+ public class OrderServiceImpl implements IOrderService {
112
+ private final ApplicationEventPublisher eventPublisher;
183
113
 
184
- @Override
185
- public TableDataInfo<TestDemoVo> queryPageList(TestDemoBo bo, PageQuery pageQuery) {
186
- LambdaQueryWrapper<TestDemo> lqw = buildQueryWrapper(bo);
187
- Page<TestDemoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
188
- return TableDataInfo.build(result);
114
+ public void createOrder(OrderCreateDTO dto) {
115
+ // ... 创建订单
116
+ eventPublisher.publishEvent(new OrderCreatedEvent(order));
189
117
  }
190
118
  }
191
- ```
192
119
 
193
- ---
194
-
195
- ## 建表模板(MySQL)
196
-
197
- ```sql
198
- CREATE TABLE xxx_table (
199
- id BIGINT(20) NOT NULL COMMENT '主键ID',
200
- tenant_id VARCHAR(20) DEFAULT '000000' COMMENT '租户ID',
201
- -- 业务字段
202
- xxx_name VARCHAR(100) NOT NULL COMMENT '名称',
203
- status CHAR(1) DEFAULT '0' COMMENT '状态',
204
- remark VARCHAR(500) DEFAULT NULL COMMENT '备注',
205
- -- 审计字段(TenantEntity 提供)
206
- create_dept BIGINT(20) DEFAULT NULL COMMENT '创建部门',
207
- create_by BIGINT(20) DEFAULT NULL COMMENT '创建人',
208
- create_time DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
209
- update_by BIGINT(20) DEFAULT NULL COMMENT '更新人',
210
- update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
211
- del_flag CHAR(1) DEFAULT '0' COMMENT '删除标志(0正常 1已删除)',
212
- PRIMARY KEY (id),
213
- INDEX idx_tenant_id (tenant_id)
214
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='xxx表';
120
+ // 方式三:Feign 调用(微服务)
121
+ @FeignClient(name = "user-service")
122
+ public interface UserFeignClient {
123
+ @GetMapping("/api/v1/users/{id}")
124
+ UserVO getUserById(@PathVariable Long id);
125
+ }
215
126
  ```
216
127
 
217
- **建表必须**:tenant_id、审计字段、del_flag、雪花ID(无 AUTO_INCREMENT)、表前缀对应模块。
128
+ ### 配置分层
218
129
 
219
- 多数据库 SQL 位置:`script/sql/` 下的 `ry_vue_5.X.sql`(MySQL)、`oracle/`、`postgres/`、`sqlserver/`
130
+ ```yaml
131
+ # application.yml - 通用配置
132
+ spring:
133
+ profiles:
134
+ active: ${SPRING_PROFILES_ACTIVE:dev}
220
135
 
221
- ---
136
+ # application-dev.yml - 开发环境
137
+ # application-test.yml - 测试环境
138
+ # application-prod.yml - 生产环境
139
+ ```
222
140
 
223
- ## 技术选型决策速查
141
+ ## 常见错误
224
142
 
225
- | 场景 | 推荐方案 |
143
+ | 错误 | 正确做法 |
226
144
  |------|---------|
227
- | 简单异步通知 | 同步调用即可 |
228
- | 解耦场景消息队列 | Redis Streams |
229
- | 高并发削峰 | RocketMQ(自行引入) |
230
- | 单机定时任务 | `@Scheduled` |
231
- | 分布式定时任务 | SnailJob |
232
- | 实时双向通信 | WebSocket |
233
- | 服务端单向推送 | SSE |
234
- | IoT 设备通信 | MQTT(自行集成) |
235
-
236
- ---
237
-
238
- ## 新模块设计检查清单
239
-
240
- - [ ] 包路径:`org.dromara.{模块名}`
241
- - [ ] 表前缀与模块对应
242
- - [ ] 主键雪花ID、含 tenant_id、审计字段、del_flag
243
- - [ ] 三层完整:Controller / Service(含 buildQueryWrapper) / Mapper(extends BaseMapperPlus)
244
- - [ ] 对象转换:`MapstructUtils.convert()`
245
- - [ ] 异常处理:`ServiceException`
246
- - [ ] 权限注解:`@SaCheckPermission("{模块}:{实体}:{操作}")`
247
- - [ ] 缓存优先 Redis、实时通信优先 WebSocket、导出用 FastExcel
248
-
249
- ---
250
-
251
- ## 多项目适配对照
252
-
253
- | 特征 | RuoYi-Vue-Plus | leniu-tengyun-core |
254
- |------|----------------|-------------------|
255
- | 包名前缀 | `org.dromara.*` | `net.xnzn.core.*` |
256
- | JDK | 17 | 21 |
257
- | 请求封装 | 直接 BO | `LeRequest<T>` |
258
- | 响应封装 | `R<T>`, `TableDataInfo<T>` | `Page<T>`, `void` |
259
- | 异常类 | `ServiceException` | `LeException` |
260
- | 国际化 | `MessageUtils.message()` | `I18n.getMessage()` |
261
- | 权限注解 | `@SaCheckPermission` | `@RequiresAuthentication` |
262
- | 分页 | `PageQuery`, `TableDataInfo` | `PageDTO`, `Page<VO>` |
145
+ | Controller 直接调 Mapper | 必须经过 Service 层 |
146
+ | Service 之间循环依赖 | 提取公共 Service 或事件驱动 |
147
+ | Entity 直接暴露给前端 | VO 封装响应 |
148
+ | 公共模块依赖业务模块 | 公共模块必须独立,被业务模块依赖 |
149
+ | 按技术层拆分模块(all-controller、all-service) | 按业务域拆分 |
150
+ | 所有逻辑堆在 Service 一个方法里 | 拆分私有方法或引入编排层 |
151
+ | 硬编码配置值 | 使用配置文件 + `@Value` 或 `@ConfigurationProperties` |
152
+ | 跨模块直接操作其他模块的数据库表 | 通过对方 Service 接口调用 |