feat(codegen): 代码生成新增 AI 配置推断并迁移模板资源

- 模板与外部文件移至 resources/codegen、excel、ip2region
- 新增 AI 配置推断接口、表单与返回对象
- 字典项与菜单 SQL、IP 工具、日志配置调整
- docker-compose 与英文 README 更新
- 版本 4.11.0
This commit is contained in:
Ray.Hao committed 2026-09-26 09:13:16 +08:00
1 parent 9fc49583d9
commit 607b6c7bb3
40 files changed
+313 -85

No files matched your search

+13 -13
View File
@@ -17,45 +17,45 @@ codegen:
## 模板配置
templateConfigs:
API:
templatePath: codegen/frontend/ts/api.ts.vm
templatePath: frontend/ts/api.ts.vm
subpackageName: api
extension: .ts
API_TYPES:
templatePath: codegen/frontend/ts/api-types.ts.vm
templatePath: frontend/ts/api-types.ts.vm
subpackageName: types
extension: .ts
VIEW:
templatePath: codegen/frontend/ts/index.vue.vm
templatePath: frontend/ts/index.vue.vm
subpackageName: views
extension: .vue
Controller:
templatePath: codegen/backend/controller.java.vm
templatePath: backend/controller.java.vm
subpackageName: controller
Service:
templatePath: codegen/backend/service.java.vm
templatePath: backend/service.java.vm
subpackageName: service
ServiceImpl:
templatePath: codegen/backend/serviceImpl.java.vm
templatePath: backend/serviceImpl.java.vm
subpackageName: service.impl
Mapper:
templatePath: codegen/backend/mapper.java.vm
templatePath: backend/mapper.java.vm
subpackageName: mapper
MapperXml:
templatePath: codegen/backend/mapper.xml.vm
templatePath: backend/mapper.xml.vm
subpackageName: mapper
extension: .xml
Converter:
templatePath: codegen/backend/converter.java.vm
templatePath: backend/converter.java.vm
subpackageName: converter
Query:
templatePath: codegen/backend/query.java.vm
templatePath: backend/query.java.vm
subpackageName: model.query
Form:
templatePath: codegen/backend/form.java.vm
templatePath: backend/form.java.vm
subpackageName: model.form
VO:
templatePath: codegen/backend/vo.java.vm
templatePath: backend/vo.java.vm
subpackageName: model.vo
Entity:
templatePath: codegen/backend/entity.java.vm
templatePath: backend/entity.java.vm
subpackageName: model.entity
@@ -1,7 +1,7 @@
<template>
<div class="page-container h-full flex flex-1 flex-col">
<!-- 搜索 -->
<PageSearch
<CrudSearch
ref="searchRef"
:search-config="searchConfig"
@query-click="handleQueryClick"
@@ -14,10 +14,10 @@
</template>
#end
#end
</PageSearch>
</CrudSearch>
<!-- 列表 -->
<PageContent
<CrudTable
ref="contentRef"
:content-config="contentConfig"
@add-click="handleAddClick"
@@ -34,10 +34,10 @@
</template>
#end
#end
</PageContent>
</CrudTable>
<!-- 新增 -->
<PageModal ref="addModalRef" :modal-config="addModalConfig" @submit-click="handleSubmitClick">
<CrudModal ref="addModalRef" :modal-config="addModalConfig" @submit-click="handleSubmitClick">
#foreach($fieldConfig in $fieldConfigs)
#if($fieldConfig.isShowInForm == 1 && $fieldConfig.formType.name() != "HIDDEN" && $fieldConfig.dictType && $fieldConfig.dictType.trim() != "")
<template #$fieldConfig.fieldName="scope">
@@ -45,10 +45,10 @@
</template>
#end
#end
</PageModal>
</CrudModal>
<!-- 编辑 -->
<PageModal ref="editModalRef" :modal-config="editModalConfig" @submit-click="handleSubmitClick">
<CrudModal ref="editModalRef" :modal-config="editModalConfig" @submit-click="handleSubmitClick">
#foreach($fieldConfig in $fieldConfigs)
#if($fieldConfig.isShowInForm == 1 && $fieldConfig.formType.name() != "HIDDEN" && $fieldConfig.dictType && $fieldConfig.dictType.trim() != "")
<template #$fieldConfig.fieldName="scope">
@@ -56,7 +56,7 @@
</template>
#end
#end
</PageModal>
</CrudModal>
</div>
</template>
@@ -67,7 +67,7 @@ defineOptions({
});
import ${entityName}API from "@/api/${moduleName}/${entityKebab}";
import usePage from "@/components/CURD/usePage";
import useCrudPage from "@/components/Crud/useCrudPage";
// 组合式 CRUD
const {
@@ -83,7 +83,7 @@ const {
handleExportClick,
handleSearchClick,
handleFilterChange,
} = usePage();
} = useCrudPage();
// 搜索配置
const searchConfig = reactive({
@@ -1,7 +1,7 @@
<template>
<div class="page-container h-full flex flex-1 flex-col">
<!-- 搜索 -->
<PageSearch
<CrudSearch
ref="searchRef"
:search-config="searchConfig"
@query-click="handleQueryClick"
@@ -14,10 +14,10 @@
</template>
#end
#end
</PageSearch>
</CrudSearch>
<!-- 列表 -->
<PageContent
<CrudTable
ref="contentRef"
:content-config="contentConfig"
@add-click="handleAddClick"
@@ -34,10 +34,10 @@
</template>
#end
#end
</PageContent>
</CrudTable>
<!-- 新增 -->
<PageModal ref="addModalRef" :modal-config="addModalConfig" @submit-click="handleSubmitClick">
<CrudModal ref="addModalRef" :modal-config="addModalConfig" @submit-click="handleSubmitClick">
#foreach($fieldConfig in $fieldConfigs)
#if($fieldConfig.isShowInForm == 1 && $fieldConfig.formType.name() != "HIDDEN" && $fieldConfig.dictType && $fieldConfig.dictType.trim() != "")
<template #$fieldConfig.fieldName="scope">
@@ -45,10 +45,10 @@
</template>
#end
#end
</PageModal>
</CrudModal>
<!-- 编辑 -->
<PageModal ref="editModalRef" :modal-config="editModalConfig" @submit-click="handleSubmitClick">
<CrudModal ref="editModalRef" :modal-config="editModalConfig" @submit-click="handleSubmitClick">
#foreach($fieldConfig in $fieldConfigs)
#if($fieldConfig.isShowInForm == 1 && $fieldConfig.formType.name() != "HIDDEN" && $fieldConfig.dictType && $fieldConfig.dictType.trim() != "")
<template #$fieldConfig.fieldName="scope">
@@ -56,7 +56,7 @@
</template>
#end
#end
</PageModal>
</CrudModal>
</div>
</template>
@@ -68,8 +68,8 @@ defineOptions({
import ${entityName}API from "@/api/${moduleName}/${entityKebab}";
import type { ${entityName}Form, ${entityName}QueryParams } from "@/api/${moduleName}/${entityKebab}";
import type { IObject, IOperateData, IModalConfig, IContentConfig, ISearchConfig } from "@/components/CURD/types";
import usePage from "@/components/CURD/usePage";
import type { IObject, IOperateData, IModalConfig, ICrudTableConfig, ISearchConfig } from "@/components/Crud/types";
import useCrudPage from "@/components/Crud/useCrudPage";
// 组合式 CRUD
const {
@@ -85,7 +85,7 @@ const {
handleExportClick,
handleSearchClick,
handleFilterChange,
} = usePage();
} = useCrudPage();
// 搜索配置
const searchConfig: ISearchConfig = reactive({
@@ -138,7 +138,7 @@ const searchConfig: ISearchConfig = reactive({
});
// 列表配置
const contentConfig: IContentConfig<${entityName}QueryParams> = reactive({
const contentConfig: ICrudTableConfig<${entityName}QueryParams> = reactive({
// 权限前缀
permPrefix: "${moduleName}:${entityKebab}",
table: {
+5 -8
View File
@@ -47,17 +47,14 @@
</filter>
</appender>
<!-- 开发环境输出至控制台 -->
<springProfile name="dev">
<root level="INFO">
<appender-ref ref="CONSOLE"/>
</root>
</springProfile>
<!-- 默认输出至控制台,所有环境生效 -->
<root level="INFO">
<appender-ref ref="CONSOLE"/>
</root>
<!-- 生产环境输出至文件 -->
<!-- 生产环境额外写入文件 -->
<springProfile name="prod">
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
</root>
</springProfile>
@@ -11,11 +11,13 @@
dict_code,
label,
value,
tag_type,
sort,
status
FROM
sys_dict_item
<where>
is_deleted = 0
<if test="queryParams.keywords!=null and queryParams.keywords.trim() neq ''">
AND (
value LIKE CONCAT('%', #{queryParams.keywords} ,'%')
@@ -27,5 +29,6 @@
AND dict_code = #{queryParams.dictCode}
</if>
</where>
ORDER BY sort ASC, id ASC
</select>
</mapper>
@@ -3,7 +3,8 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.youlai.boot.system.mapper.DictMapper">
<!-- 字典分页列表 -->
<!-- 获取字典分页列表 -->
<select id="getDictPage" resultType="com.youlai.boot.system.model.vo.DictPageVO">
SELECT
t1.id,
@@ -15,14 +16,10 @@
<where>
t1.is_deleted = 0
<if test='queryParams.keywords!=null and queryParams.keywords.trim() neq ""'>
AND (
t1.name LIKE CONCAT('%',#{queryParams.keywords},'%')
OR
t1.dict_code LIKE CONCAT('%',#{queryParams.keywords},'%')
)
AND (t1.name LIKE CONCAT('%', #{queryParams.keywords}, '%')
OR t1.dict_code LIKE CONCAT('%', #{queryParams.keywords}, '%'))
</if>
</where>
ORDER BY
t1.create_time DESC
ORDER BY t1.id ASC
</select>
</mapper>
@@ -24,7 +24,6 @@
t1.visible,
t1.redirect,
t1.type,
t1.always_show,
t1.keep_alive,
t1.params
FROM