Files

14 lines
716 B
Markdown
Raw Permalink 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.
# 架构说明
## 分层职责
用户请求经过 Controller 到达 ServiceService 负责业务规则并调用 RepositoryRepository 仅负责 TypeORM 持久化。Entity 映射数据库表,DTO 校验请求输入。
## 模块扩展
新增领域模块时,在 `apps/api/src/modules` 创建独立目录,并保持 `controller``service``repository``dto``entities` 的职责边界。跨模块调用应通过导出的服务完成,不应直接访问另一模块的 Repository。
## 前端划分
用户端与管理端各自独立构建、部署。页面放在 `pages`,可复用业务单元放在 `components`HTTP 调用应集中到 `api` 目录,避免把网络逻辑散落在页面中。