优化规则

This commit is contained in:
马宝龙
2026-07-28 11:59:31 +08:00
parent 52cbed63a8
commit f9dcf890b2
2 changed files with 62 additions and 8 deletions

View File

@@ -34,14 +34,9 @@
## 后端规则
- 类型名使用大驼峰,变量名和方法名使用小驼峰
- 采用四层结构:`controller``service``mapper``domain`
- `controller` 层声明接口,为前端提供 API
- `service` 层声明业务接口,`impl` 子目录负责实现业务逻辑。
- `mapper` 层包含 Mapper 接口和 XML 文件,负责数据库操作。
- `domain` 层包含 POJO、DTO 等领域对象。
- 方法参数不要使用 `Map`;需要结构化参数时创建对应的 DTO 类。
- 使用 Lombok 的 `@RequiredArgsConstructor` 完成依赖注入。
- 代码须符合阿里巴巴Java开发规范、springboot框架规范、其他使用到的框架、中间件规范
- 代码须简洁明了,不能冗杂
- 能通用的代码最好通用
## API 规范