fix: 项目结构

This commit is contained in:
dayjoy
2025-08-20 11:46:16 +08:00
parent 73803542ea
commit e4225795f9

View File

@@ -1414,46 +1414,46 @@ Java、SpringBoot、MyBatis-plus(读取)、Hibernate(写入)
``` ```
项目根目录 项目根目录
── main_module |──main_module
│ ├── common/ # 项目级公共模块 │ ├── common # 项目级公共模块
│ │ ├──config/ # 中间件配置 │ │ ├──config/ # 中间件配置
│ │ ├──constants/ # 项目常量 │ │ ├──constants/ # 项目常量
│ │ ├──enums/ # 项目枚举 │ │ ├──enums/ # 项目枚举
│ │ ├──redis/ # Redis配置 │ │ ├──redis/ # Redis配置
│ │ ├──response/ # 返回结果封装 │ │ ├──response/ # 返回结果封装
│ │ └──utils/ # 项目工具类 │ │ └──utils/ # 项目工具类
└── entrance/ # 项目入口 └───├── entrance/ # 项目入口
│ └──AppApplication.java # 启动类 │ └──AppApplication.java # 启动类
└── modules/ # 子模块列表 └── modules # 子模块列表
└── module1/ # 子模块1 └── module1/ # 子模块1
├── common/ ├── common/
│ ├──constants/ # 模块常量 │ ├──constants/ # 模块常量
│ ├──utils/ #模块工具类 │ ├──utils/ #模块工具类
└── enums/ # 模块枚举 │ └──enums/ # 枚举
├── entrance/web/src/main/java/com/{项目名}/{模块名}/entrance/web/ ├── entrance/web/src/main/java/com/{project_name}/{module_name}/entrance/web/
│ ├──controller/ # API定义 │ ├──controller/ # API定义
│ ├──converter/ # DTO转VO │ ├──converter/ # DTO转VO
│ ├──vo/ # VO结构 │ ├──vo/ # VO结构
│ └── query/ # 读方案转VO │ └── query/ # 读方案转VO
│ ├── assembler/ # VO数据填充 │ ├── assembler/ # VO数据填充
│ ├── collector/ # ID数据展开完整对象 │ ├── collector/ # 读方案返回的id数据展开完整对象
│ └── executor/ # 调用Service实现,返回VO │ └── executor/ # 调用Service的度方案实现同时调用collector和assembler返回最终的VO
├── manager/src/main/java/com/{项目名}/{模块名}/manager/ ├── manager/src/main/java/com/{project_name}/{module_name}/manager/
│ ├── bo/ # 聚合对象定义 │ ├── bo/ # 聚合对象定义
│ │ └── base/ # 聚合对象基类 │ │ └── base/ # 聚合对象基类
│ ├── dto/ # DTO定义 │ ├── dto/ # DTO定义
│ ├── converter/ # 复杂DTO组装 │ ├── converter/ # 复杂Dto非BaseDto)组装
│ ├── facade/ # 跨模块RPC适配器 │ ├── facade/ # 调用其他模块RPC适配器包含RpcAdapter如UserDtoServiceInMeetingRpcAdapter表示从meeting模块调用user模块中方法
│ └── impl/ # DTO查询实现 │ └── impl/ # DTO查询实现
├── persist/src/main/java/com/{项目名}/{模块名}/persist/ ├── persist/src/main/java/com/{project_name}/{module_name}/persist/
│ ├── eo/ # 值对象定义 │ ├── eo/ # 值对象定义
│ ├── dos/ # 数据库表映射 │ ├── dos/ # 数据库表映射
│ ├── qto/ # 读方案数据库查询 │ ├── qto/ # 读方案数据库查询
│ └── mapper/ # MyBatis Mapper │ └── mapper/ # MyBatis Mapper
└── service/src/main/java/com/{项目名}/{模块名}/service/ └── service/src/main/java/com/{project_name}/{module_name}/service/ # BOService包含某个聚合下所有写方案生成的方法、 DtoService包含DTO生成的预定义方法
├── bto/ # 写方案入参定义 ├── bto/ # 写方案入参定义
├── converter/ # BaseDto扩展 ├── converter/ # 对返回的BaseDto按需进行二次扩展
├── query/ # 查询方案Service入口 ├── query/ # 查询方案的service入口调用persist层的查询实现
└── base/ # BOService基类 └── base/ # BOService基类
模块依赖层级entrance -> service -> manager -> persist各层都依赖common 模块依赖层级entrance -> service -> manager -> persist各层都依赖common