kra-new/app/system/README.md

22 lines
1.0 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.

# System Module
系统模块承载当前管理后台的完整业务边界:
- `biz`:系统领域对象、用例和仓储接口
- `data`:数据库生命周期、系统仓储、系统表和支付持久化
- `service`:请求 DTO 与领域用例的转换
- `transport`Gin server、middleware、handler、router、HTTP 响应工具
- `integration`Redis、邮件、对象存储和支付渠道适配器
- `initialize`:数据库首次初始化和系统种子数据编排
- `worker`:定时任务执行与调度
- `security`:后台 JWT 等安全实现
- `utils`:只服务于系统模块的无状态工具
系统表统一使用 `sys_` 前缀;业务表应由新业务模块自行命名和迁移,不要混入
本目录。
system 通过 `Definition()` 提供自己的迁移、支付菜单/API 和默认任务,通过
`worker.TaskMethods` 提供依赖系统用例的任务实现,通过 `transport/server.Routes`
提供路由。应用组合根消费这些公共协议;新增业务不需要修改 system 的初始化、
worker、路由或数据层。