Files
JayuCloud/docs/architecture/core-module-index.md
T

138 lines
4.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# JC-ArtList-Core 模块索引
更新时间:2026-06-04
`JC-ArtList-Core` 已从按技术层平铺的 `controller/dto/vo/entity/mapper/service/impl` 结构,调整为按业务模块聚合的包结构。
## 总体结构
```text
JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core
├── common
│ ├── dto
│ ├── entity
│ └── vo
├── modules
│ └── <module>
│ ├── controller
│ │ ├── admin
│ │ └── front
│ ├── dto
│ ├── entity
│ ├── mapper
│ ├── service
│ │ └── impl
│ ├── support
│ └── vo
└── config / common / support / utils / annotation / aspect / filter
```
公共基类、公共请求对象和通用分页结果放在 `common`:
- `common.entity.BaseEntity`
- `common.dto.AgreementAwareRequest`
- `common.vo.PageResultVO`
基础设施仍保留在根包,不归属单一业务模块:
- `config`
- `annotation`
- `aspect`
- `filter`
- `utils`
- `support.cache`
- `support.id`
- `support.security`
- `support.RequestShopContext`
## 模块清单
| 模块 | 主要职责 |
| --- | --- |
| `analytics` | 后台工作台、经营看板、统计概览。 |
| `artist` | 美甲师资料、可预约能力、排班配置、员工端相关展示。 |
| `auth` | 后台登录、前台登录身份、验证码、Token 刷新、账号注册登录请求对象。 |
| `content` | 评论、评价内容管理。 |
| `file` | 文件上传、分片上传、对象存储文件、公开签名 URL 支撑。 |
| `integration` | MessageHub、微信小程序登录、业务事件 Outbox、地图服务等外部系统对接。 |
| `inventory` | 库存耗材、库存记录和库存调整。 |
| `marketing` | 优惠券、活动、收藏、点赞、VIP 档位、用户成长。 |
| `message` | 系统消息、公告、用户消息状态。 |
| `order` | 购物车、订单、订单项、报价、售后、改派、评价任务、订单状态机。 |
| `payment` | 支付单、退款单、余额、余额变动明细。 |
| `planning` | 规划日历、预约占用、预约容量、指尖管理师规划端聚合接口。 |
| `product` | 作品、标签、效果图、作品公开展示和后台管理。 |
| `security` | 权限、角色、安全审计、权限策略和后台作用域支撑。 |
| `shop` | 店铺资料、店铺绑定、店铺主题、联系信息。 |
| `system` | 健康检查、系统参数、法律协议、后台默认密码支撑。 |
| `user` | 用户资料、用户资产、用户关系、邀请信息、用户协议确认。 |
## Controller 约定
- 后台接口放在 `modules.<module>.controller.admin`。
- 前台/用户端/公开接口放在 `modules.<module>.controller.front`。
- HTTP URL、请求字段、响应字段保持兼容,包路径调整不改变接口语义。
## Mapper 扫描
MyBatis-Plus mapper 扫描配置位于:
```text
JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/config/MyBatisPlusConfig.java
```
当前显式扫描各模块的 `mapper` 包。新增业务模块时,需要同步补充 `@MapperScan` 路径,或确认扫描策略已覆盖新模块。
## 常用定位方式
查订单链路:
```text
JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/order
```
查规划日历和预约占用:
```text
JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/planning
```
查作品和标签:
```text
JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/product
```
查店铺与店铺绑定:
```text
JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/shop
```
查权限、角色和审计:
```text
JC-ArtList-Core/src/main/java/com/xiaowang/fingertipdesigner/core/modules/security
```
## 测试目录
测试代码同步按业务模块移动到:
```text
JC-ArtList-Core/src/test/java/com/xiaowang/fingertipdesigner/core/modules
```
通用 SQL 结构测试和少量基础设施测试仍可保留在:
```text
JC-ArtList-Core/src/test/java/com/xiaowang/fingertipdesigner/core/support
```
## 维护注意
- 不要再向旧的根级 `controller/dto/entity/mapper/service/vo` 目录新增业务代码。
- 新功能优先放入已有业务模块;只有职责明确新增时才创建新模块。
- 模块内优先保持 `controller / dto / entity / mapper / service / service.impl / vo` 的局部闭环。
- 支撑类如果只服务单一业务模块,放到该模块 `support`;跨模块基础设施才放根 `support`。