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.
- package/.claude/hooks/skill-forced-eval.js +46 -62
- package/.claude/settings.json +10 -1
- package/.claude/skills/api-development/SKILL.md +179 -130
- package/.claude/skills/architecture-design/SKILL.md +102 -212
- package/.claude/skills/backend-annotations/SKILL.md +166 -220
- package/.claude/skills/bug-detective/SKILL.md +225 -186
- package/.claude/skills/code-patterns/SKILL.md +127 -244
- package/.claude/skills/collaborating-with-codex/SKILL.md +96 -113
- package/.claude/skills/crud-development/SKILL.md +226 -307
- package/.claude/skills/data-permission/SKILL.md +131 -202
- package/.claude/skills/database-ops/SKILL.md +158 -355
- package/.claude/skills/error-handler/SKILL.md +224 -285
- package/.claude/skills/file-oss-management/SKILL.md +174 -169
- package/.claude/skills/git-workflow/SKILL.md +123 -341
- package/.claude/skills/json-serialization/SKILL.md +121 -137
- package/.claude/skills/performance-doctor/SKILL.md +83 -89
- package/.claude/skills/redis-cache/SKILL.md +134 -185
- package/.claude/skills/scheduled-jobs/SKILL.md +187 -224
- package/.claude/skills/security-guard/SKILL.md +168 -276
- package/.claude/skills/sms-mail/SKILL.md +266 -228
- package/.claude/skills/social-login/SKILL.md +257 -195
- package/.claude/skills/tenant-management/SKILL.md +172 -188
- package/.claude/skills/utils-toolkit/SKILL.md +214 -222
- package/.claude/skills/websocket-sse/SKILL.md +251 -172
- package/.claude/skills/workflow-engine/SKILL.md +178 -250
- package/.codex/skills/api-development/SKILL.md +179 -130
- package/.codex/skills/architecture-design/SKILL.md +102 -212
- package/.codex/skills/backend-annotations/SKILL.md +166 -220
- package/.codex/skills/bug-detective/SKILL.md +225 -186
- package/.codex/skills/code-patterns/SKILL.md +127 -244
- package/.codex/skills/collaborating-with-codex/SKILL.md +96 -113
- package/.codex/skills/crud-development/SKILL.md +226 -307
- package/.codex/skills/data-permission/SKILL.md +131 -202
- package/.codex/skills/database-ops/SKILL.md +158 -355
- package/.codex/skills/error-handler/SKILL.md +224 -285
- package/.codex/skills/file-oss-management/SKILL.md +174 -169
- package/.codex/skills/git-workflow/SKILL.md +123 -341
- package/.codex/skills/json-serialization/SKILL.md +121 -137
- package/.codex/skills/performance-doctor/SKILL.md +83 -89
- package/.codex/skills/redis-cache/SKILL.md +134 -185
- package/.codex/skills/scheduled-jobs/SKILL.md +187 -224
- package/.codex/skills/security-guard/SKILL.md +168 -276
- package/.codex/skills/sms-mail/SKILL.md +266 -228
- package/.codex/skills/social-login/SKILL.md +257 -195
- package/.codex/skills/tenant-management/SKILL.md +172 -188
- package/.codex/skills/utils-toolkit/SKILL.md +214 -222
- package/.codex/skills/websocket-sse/SKILL.md +251 -172
- package/.codex/skills/workflow-engine/SKILL.md +178 -250
- package/.cursor/hooks/cursor-skill-eval.js +66 -6
- package/.cursor/skills/api-development/SKILL.md +179 -130
- package/.cursor/skills/architecture-design/SKILL.md +102 -212
- package/.cursor/skills/backend-annotations/SKILL.md +166 -220
- package/.cursor/skills/bug-detective/SKILL.md +225 -186
- package/.cursor/skills/code-patterns/SKILL.md +127 -244
- package/.cursor/skills/collaborating-with-codex/SKILL.md +96 -113
- package/.cursor/skills/crud-development/SKILL.md +226 -307
- package/.cursor/skills/data-permission/SKILL.md +131 -202
- package/.cursor/skills/database-ops/SKILL.md +158 -355
- package/.cursor/skills/error-handler/SKILL.md +224 -285
- package/.cursor/skills/file-oss-management/SKILL.md +174 -169
- package/.cursor/skills/git-workflow/SKILL.md +123 -341
- package/.cursor/skills/json-serialization/SKILL.md +121 -137
- package/.cursor/skills/performance-doctor/SKILL.md +83 -89
- package/.cursor/skills/redis-cache/SKILL.md +134 -185
- package/.cursor/skills/scheduled-jobs/SKILL.md +187 -224
- package/.cursor/skills/security-guard/SKILL.md +168 -276
- package/.cursor/skills/sms-mail/SKILL.md +266 -228
- package/.cursor/skills/social-login/SKILL.md +257 -195
- package/.cursor/skills/tenant-management/SKILL.md +172 -188
- package/.cursor/skills/utils-toolkit/SKILL.md +214 -222
- package/.cursor/skills/websocket-sse/SKILL.md +251 -172
- package/.cursor/skills/workflow-engine/SKILL.md +178 -250
- package/AGENTS.md +49 -540
- package/CLAUDE.md +73 -119
- package/README.md +37 -6
- package/bin/index.js +5 -1
- package/package.json +1 -1
- package/src/skills/api-development/SKILL.md +179 -130
- package/src/skills/architecture-design/SKILL.md +102 -212
- package/src/skills/backend-annotations/SKILL.md +166 -220
- package/src/skills/bug-detective/SKILL.md +225 -186
- package/src/skills/code-patterns/SKILL.md +127 -244
- package/src/skills/collaborating-with-codex/SKILL.md +96 -113
- package/src/skills/crud-development/SKILL.md +226 -307
- package/src/skills/data-permission/SKILL.md +131 -202
- package/src/skills/database-ops/SKILL.md +158 -355
- package/src/skills/error-handler/SKILL.md +224 -285
- package/src/skills/file-oss-management/SKILL.md +174 -169
- package/src/skills/git-workflow/SKILL.md +123 -341
- package/src/skills/json-serialization/SKILL.md +121 -137
- package/src/skills/performance-doctor/SKILL.md +83 -89
- package/src/skills/redis-cache/SKILL.md +134 -185
- package/src/skills/scheduled-jobs/SKILL.md +187 -224
- package/src/skills/security-guard/SKILL.md +168 -276
- package/src/skills/sms-mail/SKILL.md +266 -228
- package/src/skills/social-login/SKILL.md +257 -195
- package/src/skills/tenant-management/SKILL.md +172 -188
- package/src/skills/utils-toolkit/SKILL.md +214 -222
- package/src/skills/websocket-sse/SKILL.md +251 -172
- package/src/skills/workflow-engine/SKILL.md +178 -250
- package/.claude/skills/skill-creator/LICENSE.txt +0 -202
- package/.claude/skills/skill-creator/SKILL.md +0 -479
- package/.claude/skills/skill-creator/agents/analyzer.md +0 -274
- package/.claude/skills/skill-creator/agents/comparator.md +0 -202
- package/.claude/skills/skill-creator/agents/grader.md +0 -223
- package/.claude/skills/skill-creator/assets/eval_review.html +0 -146
- package/.claude/skills/skill-creator/eval-viewer/generate_review.py +0 -471
- package/.claude/skills/skill-creator/eval-viewer/viewer.html +0 -1325
- package/.claude/skills/skill-creator/references/schemas.md +0 -430
- package/.claude/skills/skill-creator/scripts/__init__.py +0 -0
- package/.claude/skills/skill-creator/scripts/aggregate_benchmark.py +0 -401
- package/.claude/skills/skill-creator/scripts/generate_report.py +0 -326
- package/.claude/skills/skill-creator/scripts/improve_description.py +0 -248
- package/.claude/skills/skill-creator/scripts/package_skill.py +0 -136
- package/.claude/skills/skill-creator/scripts/quick_validate.py +0 -103
- package/.claude/skills/skill-creator/scripts/run_eval.py +0 -310
- package/.claude/skills/skill-creator/scripts/run_loop.py +0 -332
- 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
|
-
|
|
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
|
-
|
|
25
|
+
- **适用场景**:中小型项目、业务逻辑相对简单
|
|
26
|
+
- **优点**:结构清晰、上手快、团队共识强
|
|
27
|
+
- **缺点**:Service 层容易膨胀为"上帝类"
|
|
92
28
|
|
|
93
|
-
|
|
29
|
+
#### 四层架构(增加编排层)
|
|
94
30
|
|
|
95
31
|
```
|
|
96
|
-
Controller
|
|
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
|
-
|
|
42
|
+
| 条件 | 推荐 |
|
|
43
|
+
|------|------|
|
|
44
|
+
| 单表 CRUD 为主 | 三层架构 |
|
|
45
|
+
| 跨模块协调频繁 | 四层架构 |
|
|
46
|
+
| 团队 < 5 人 | 三层架构 |
|
|
47
|
+
| 微服务拆分 | 三层 + DDD |
|
|
108
48
|
|
|
109
|
-
###
|
|
49
|
+
### 模块划分原则
|
|
110
50
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
-
|
|
121
|
-
|
|
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
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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
|
-
|
|
85
|
+
### 依赖方向(必须单向)
|
|
148
86
|
|
|
149
87
|
```
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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
|
-
|
|
94
|
+
- 上层可以依赖下层,下层不能依赖上层
|
|
95
|
+
- 同层之间避免循环依赖
|
|
96
|
+
- 公共模块被所有业务模块依赖,但公共模块不依赖任何业务模块
|
|
97
|
+
|
|
98
|
+
### 模块间通信模式
|
|
168
99
|
|
|
169
100
|
```java
|
|
101
|
+
// 方式一:直接依赖(单体应用)
|
|
170
102
|
@Service
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
-
|
|
128
|
+
### 配置分层
|
|
218
129
|
|
|
219
|
-
|
|
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
|
-
|
|
|
229
|
-
|
|
|
230
|
-
|
|
|
231
|
-
|
|
|
232
|
-
|
|
|
233
|
-
|
|
|
234
|
-
|
|
|
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 接口调用 |
|