mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-08 12:39:05 +08:00
feat(pigx-codegen): 支持实体生成到独立 api 模块
- 新增 DataModelConstants 定义 API_PATH、ENTITY_PATH 等实体路径常量 - 实现 setEntityModel 方法,自动识别 `-biz` 模块同级 `-api` 模块,将实体生成路径和包名切换到 api 模块 - 更新 gen_template.sql 代码生成模板,使用 entityClassName、entityPath 等动态变量替代硬编码包路径 - 扩展 isSpringBoot3 判断逻辑,兼容 SpringBoot 4.x 主版本
This commit is contained in:
1 parent
f172154800
commit
5d561bee33
1 file changed
+2
-4
+2
-4
@@ -518,9 +518,8 @@ public class GeneratorServiceImpl implements GeneratorService {
|
||||
* <p>
|
||||
* 默认与业务模块同包,实体落到 {@code backendPath} 自身(即 biz 模块)。当
|
||||
* {@code backendPath} 末尾形如 {@code xxx-biz} 且同级目录存在 {@code xxx-api}
|
||||
* 模块时,自动切换为:实体写入 {@code xxx-api},包名调整为
|
||||
* {@code <package>.<module>.api.entity},便于在多个 biz 模块之间共享实体
|
||||
* 而不引入循环依赖。
|
||||
* 模块时,只将实体写入路径切换到 {@code xxx-api},Java 包名仍保持业务模块包名,
|
||||
* 例如 {@code com.pig4cloud.pigx.aigc.entity}。
|
||||
*
|
||||
* @param dataModel 数据模型,写入 entityPath、entityPackage、entityPackagePath、
|
||||
* entityClassName、apiPath、hasApiModule
|
||||
@@ -537,7 +536,6 @@ public class GeneratorServiceImpl implements GeneratorService {
|
||||
if (resolvedApiPath.isPresent()) {
|
||||
apiPath = resolvedApiPath.get();
|
||||
entityPath = apiPath;
|
||||
entityPackage = StrUtil.format("{}.api.entity", modulePackage);
|
||||
hasApiModule = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user