Commit 305090b7dc7a76b443214918b5fc78a3a7f05082
1 parent
9dd2bc95
1. 完成代码生成的表和字段定义的编辑
2. 清理多余代码
Showing
39 changed files
with
208 additions
and
436 deletions
ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java
| @@ -77,18 +77,6 @@ public class GenController extends BaseController { | @@ -77,18 +77,6 @@ public class GenController extends BaseController { | ||
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | /** | 79 | /** |
| 80 | - * 修改保存代码生成业务 | ||
| 81 | - */ | ||
| 82 | - @PreAuthorize("@ss.hasPermi('tool:gen:edit')") | ||
| 83 | - @Log(title = "代码生成", businessType = BusinessType.UPDATE) | ||
| 84 | - @PutMapping | ||
| 85 | - public AjaxResult editSave(@Validated @RequestBody GenTable genTable) { | ||
| 86 | - genTableService.validateEdit(genTable); | ||
| 87 | - genTableService.updateGenTable(genTable); | ||
| 88 | - return AjaxResult.success(); | ||
| 89 | - } | ||
| 90 | - | ||
| 91 | - /** | ||
| 92 | * 删除代码生成 | 80 | * 删除代码生成 |
| 93 | */ | 81 | */ |
| 94 | @PreAuthorize("@ss.hasPermi('tool:gen:remove')") | 82 | @PreAuthorize("@ss.hasPermi('tool:gen:remove')") |
ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableMapper.java
| @@ -50,27 +50,4 @@ public interface GenTableMapper { | @@ -50,27 +50,4 @@ public interface GenTableMapper { | ||
| 50 | */ | 50 | */ |
| 51 | public GenTable selectGenTableByName(String tableName); | 51 | public GenTable selectGenTableByName(String tableName); |
| 52 | 52 | ||
| 53 | - /** | ||
| 54 | - * 新增业务 | ||
| 55 | - * | ||
| 56 | - * @param genTable 业务信息 | ||
| 57 | - * @return 结果 | ||
| 58 | - */ | ||
| 59 | - public int insertGenTable(GenTable genTable); | ||
| 60 | - | ||
| 61 | - /** | ||
| 62 | - * 修改业务 | ||
| 63 | - * | ||
| 64 | - * @param genTable 业务信息 | ||
| 65 | - * @return 结果 | ||
| 66 | - */ | ||
| 67 | - public int updateGenTable(GenTable genTable); | ||
| 68 | - | ||
| 69 | - /** | ||
| 70 | - * 批量删除业务 | ||
| 71 | - * | ||
| 72 | - * @param ids 需要删除的数据ID | ||
| 73 | - * @return 结果 | ||
| 74 | - */ | ||
| 75 | - public int deleteGenTableByIds(Long[] ids); | ||
| 76 | } | 53 | } |
ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableColumnServiceImpl.java deleted
| 1 | -package com.ruoyi.generator.service; | ||
| 2 | - | ||
| 3 | -import java.util.List; | ||
| 4 | - | ||
| 5 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 6 | -import org.springframework.stereotype.Service; | ||
| 7 | -import com.ruoyi.common.core.text.Convert; | ||
| 8 | -import com.ruoyi.generator.domain.GenTableColumn; | ||
| 9 | -import com.ruoyi.generator.mapper.GenTableColumnMapper; | ||
| 10 | - | ||
| 11 | -/** | ||
| 12 | - * 业务字段 服务层实现 | ||
| 13 | - * | ||
| 14 | - * @author ruoyi | ||
| 15 | - */ | ||
| 16 | -@Service | ||
| 17 | -public class GenTableColumnServiceImpl implements IGenTableColumnService { | ||
| 18 | - @Autowired | ||
| 19 | - private GenTableColumnMapper genTableColumnMapper; | ||
| 20 | - | ||
| 21 | - /** | ||
| 22 | - * 查询业务字段列表 | ||
| 23 | - * | ||
| 24 | - * @param tableId 业务字段编号 | ||
| 25 | - * @return 业务字段集合 | ||
| 26 | - */ | ||
| 27 | - @Override | ||
| 28 | - public List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId) { | ||
| 29 | - return genTableColumnMapper.selectGenTableColumnListByTableId(tableId); | ||
| 30 | - } | ||
| 31 | - | ||
| 32 | - /** | ||
| 33 | - * 新增业务字段 | ||
| 34 | - * | ||
| 35 | - * @param genTableColumn 业务字段信息 | ||
| 36 | - * @return 结果 | ||
| 37 | - */ | ||
| 38 | - @Override | ||
| 39 | - public int insertGenTableColumn(GenTableColumn genTableColumn) { | ||
| 40 | - return genTableColumnMapper.insertGenTableColumn(genTableColumn); | ||
| 41 | - } | ||
| 42 | - | ||
| 43 | - /** | ||
| 44 | - * 修改业务字段 | ||
| 45 | - * | ||
| 46 | - * @param genTableColumn 业务字段信息 | ||
| 47 | - * @return 结果 | ||
| 48 | - */ | ||
| 49 | - @Override | ||
| 50 | - public int updateGenTableColumn(GenTableColumn genTableColumn) { | ||
| 51 | - return genTableColumnMapper.updateGenTableColumn(genTableColumn); | ||
| 52 | - } | ||
| 53 | - | ||
| 54 | - /** | ||
| 55 | - * 删除业务字段对象 | ||
| 56 | - * | ||
| 57 | - * @param ids 需要删除的数据ID | ||
| 58 | - * @return 结果 | ||
| 59 | - */ | ||
| 60 | - @Override | ||
| 61 | - public int deleteGenTableColumnByIds(String ids) { | ||
| 62 | - return genTableColumnMapper.deleteGenTableColumnByIds(Convert.toLongArray(ids)); | ||
| 63 | - } | ||
| 64 | -} |
ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableColumnService.java deleted
| 1 | -package com.ruoyi.generator.service; | ||
| 2 | - | ||
| 3 | -import java.util.List; | ||
| 4 | - | ||
| 5 | -import com.ruoyi.generator.domain.GenTableColumn; | ||
| 6 | - | ||
| 7 | -/** | ||
| 8 | - * 业务字段 服务层 | ||
| 9 | - * | ||
| 10 | - * @author ruoyi | ||
| 11 | - */ | ||
| 12 | -public interface IGenTableColumnService { | ||
| 13 | - /** | ||
| 14 | - * 查询业务字段列表 | ||
| 15 | - * | ||
| 16 | - * @param tableId 业务字段编号 | ||
| 17 | - * @return 业务字段集合 | ||
| 18 | - */ | ||
| 19 | - public List<GenTableColumn> selectGenTableColumnListByTableId(Long tableId); | ||
| 20 | - | ||
| 21 | - /** | ||
| 22 | - * 新增业务字段 | ||
| 23 | - * | ||
| 24 | - * @param genTableColumn 业务字段信息 | ||
| 25 | - * @return 结果 | ||
| 26 | - */ | ||
| 27 | - public int insertGenTableColumn(GenTableColumn genTableColumn); | ||
| 28 | - | ||
| 29 | - /** | ||
| 30 | - * 修改业务字段 | ||
| 31 | - * | ||
| 32 | - * @param genTableColumn 业务字段信息 | ||
| 33 | - * @return 结果 | ||
| 34 | - */ | ||
| 35 | - public int updateGenTableColumn(GenTableColumn genTableColumn); | ||
| 36 | - | ||
| 37 | - /** | ||
| 38 | - * 删除业务字段信息 | ||
| 39 | - * | ||
| 40 | - * @param ids 需要删除的数据ID | ||
| 41 | - * @return 结果 | ||
| 42 | - */ | ||
| 43 | - public int deleteGenTableColumnByIds(String ids); | ||
| 44 | -} |
ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java deleted
| 1 | -package com.ruoyi.generator.service; | ||
| 2 | - | ||
| 3 | -import java.util.List; | ||
| 4 | -import java.util.Map; | ||
| 5 | - | ||
| 6 | -import com.ruoyi.generator.domain.GenTable; | ||
| 7 | - | ||
| 8 | -/** | ||
| 9 | - * 业务 服务层 | ||
| 10 | - * | ||
| 11 | - * @author ruoyi | ||
| 12 | - */ | ||
| 13 | -public interface IGenTableService { | ||
| 14 | - /** | ||
| 15 | - * 查询业务列表 | ||
| 16 | - * | ||
| 17 | - * @param genTable 业务信息 | ||
| 18 | - * @return 业务集合 | ||
| 19 | - */ | ||
| 20 | - public List<GenTable> selectGenTableList(GenTable genTable); | ||
| 21 | - | ||
| 22 | - /** | ||
| 23 | - * 查询据库列表 | ||
| 24 | - * | ||
| 25 | - * @param genTable 业务信息 | ||
| 26 | - * @return 数据库表集合 | ||
| 27 | - */ | ||
| 28 | - public List<GenTable> selectDbTableList(GenTable genTable); | ||
| 29 | - | ||
| 30 | - /** | ||
| 31 | - * 查询据库列表 | ||
| 32 | - * | ||
| 33 | - * @param tableNames 表名称组 | ||
| 34 | - * @return 数据库表集合 | ||
| 35 | - */ | ||
| 36 | - public List<GenTable> selectDbTableListByNames(String[] tableNames); | ||
| 37 | - | ||
| 38 | - /** | ||
| 39 | - * 查询业务信息 | ||
| 40 | - * | ||
| 41 | - * @param id 业务ID | ||
| 42 | - * @return 业务信息 | ||
| 43 | - */ | ||
| 44 | - public GenTable selectGenTableById(Long id); | ||
| 45 | - | ||
| 46 | - /** | ||
| 47 | - * 修改业务 | ||
| 48 | - * | ||
| 49 | - * @param genTable 业务信息 | ||
| 50 | - * @return 结果 | ||
| 51 | - */ | ||
| 52 | - public void updateGenTable(GenTable genTable); | ||
| 53 | - | ||
| 54 | - /** | ||
| 55 | - * 删除业务信息 | ||
| 56 | - * | ||
| 57 | - * @param tableIds 需要删除的表数据ID | ||
| 58 | - * @return 结果 | ||
| 59 | - */ | ||
| 60 | - public void deleteGenTableByIds(Long[] tableIds); | ||
| 61 | - | ||
| 62 | - /** | ||
| 63 | - * 导入表结构 | ||
| 64 | - * | ||
| 65 | - * @param tableList 导入表列表 | ||
| 66 | - */ | ||
| 67 | - public void importGenTable(List<GenTable> tableList); | ||
| 68 | - | ||
| 69 | - /** | ||
| 70 | - * 预览代码 | ||
| 71 | - * | ||
| 72 | - * @param tableId 表编号 | ||
| 73 | - * @return 预览数据列表 | ||
| 74 | - */ | ||
| 75 | - public Map<String, String> previewCode(Long tableId); | ||
| 76 | - | ||
| 77 | - /** | ||
| 78 | - * 生成代码(下载方式) | ||
| 79 | - * | ||
| 80 | - * @param tableName 表名称 | ||
| 81 | - * @return 数据 | ||
| 82 | - */ | ||
| 83 | - public byte[] downloadCode(String tableName); | ||
| 84 | - | ||
| 85 | - /** | ||
| 86 | - * 生成代码(自定义路径) | ||
| 87 | - * | ||
| 88 | - * @param tableName 表名称 | ||
| 89 | - * @return 数据 | ||
| 90 | - */ | ||
| 91 | - public void generatorCode(String tableName); | ||
| 92 | - | ||
| 93 | - /** | ||
| 94 | - * 同步数据库 | ||
| 95 | - * | ||
| 96 | - * @param tableName 表名称 | ||
| 97 | - */ | ||
| 98 | - public void synchDb(String tableName); | ||
| 99 | - | ||
| 100 | - /** | ||
| 101 | - * 批量生成代码(下载方式) | ||
| 102 | - * | ||
| 103 | - * @param tableNames 表数组 | ||
| 104 | - * @return 数据 | ||
| 105 | - */ | ||
| 106 | - public byte[] downloadCode(String[] tableNames); | ||
| 107 | - | ||
| 108 | - /** | ||
| 109 | - * 修改保存参数校验 | ||
| 110 | - * | ||
| 111 | - * @param genTable 业务信息 | ||
| 112 | - */ | ||
| 113 | - public void validateEdit(GenTable genTable); | ||
| 114 | -} |
ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml
| @@ -54,67 +54,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | @@ -54,67 +54,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 54 | where t.table_name = #{tableName} order by c.sort | 54 | where t.table_name = #{tableName} order by c.sort |
| 55 | </select> | 55 | </select> |
| 56 | 56 | ||
| 57 | - <insert id="insertGenTable" parameterType="GenTable" useGeneratedKeys="true" keyProperty="tableId"> | ||
| 58 | - insert into gen_table ( | ||
| 59 | - <if test="tableName != null">table_name,</if> | ||
| 60 | - <if test="tableComment != null and tableComment != ''">table_comment,</if> | ||
| 61 | - <if test="className != null and className != ''">class_name,</if> | ||
| 62 | - <if test="tplCategory != null and tplCategory != ''">tpl_category,</if> | ||
| 63 | - <if test="packageName != null and packageName != ''">package_name,</if> | ||
| 64 | - <if test="moduleName != null and moduleName != ''">module_name,</if> | ||
| 65 | - <if test="businessName != null and businessName != ''">business_name,</if> | ||
| 66 | - <if test="functionName != null and functionName != ''">function_name,</if> | ||
| 67 | - <if test="functionAuthor != null and functionAuthor != ''">function_author,</if> | ||
| 68 | - <if test="genType != null and genType != ''">gen_type,</if> | ||
| 69 | - <if test="genPath != null and genPath != ''">gen_path,</if> | ||
| 70 | - <if test="remark != null and remark != ''">remark,</if> | ||
| 71 | - <if test="createBy != null and createBy != ''">create_by,</if> | ||
| 72 | - create_time | ||
| 73 | - )values( | ||
| 74 | - <if test="tableName != null">#{tableName},</if> | ||
| 75 | - <if test="tableComment != null and tableComment != ''">#{tableComment},</if> | ||
| 76 | - <if test="className != null and className != ''">#{className},</if> | ||
| 77 | - <if test="tplCategory != null and tplCategory != ''">#{tplCategory},</if> | ||
| 78 | - <if test="packageName != null and packageName != ''">#{packageName},</if> | ||
| 79 | - <if test="moduleName != null and moduleName != ''">#{moduleName},</if> | ||
| 80 | - <if test="businessName != null and businessName != ''">#{businessName},</if> | ||
| 81 | - <if test="functionName != null and functionName != ''">#{functionName},</if> | ||
| 82 | - <if test="functionAuthor != null and functionAuthor != ''">#{functionAuthor},</if> | ||
| 83 | - <if test="genType != null and genType != ''">#{genType},</if> | ||
| 84 | - <if test="genPath != null and genPath != ''">#{genPath},</if> | ||
| 85 | - <if test="remark != null and remark != ''">#{remark},</if> | ||
| 86 | - <if test="createBy != null and createBy != ''">#{createBy},</if> | ||
| 87 | - sysdate() | ||
| 88 | - ) | ||
| 89 | - </insert> | ||
| 90 | - | ||
| 91 | - <update id="updateGenTable" parameterType="GenTable"> | ||
| 92 | - update gen_table | ||
| 93 | - <set> | ||
| 94 | - <if test="tableName != null">table_name = #{tableName},</if> | ||
| 95 | - <if test="tableComment != null and tableComment != ''">table_comment = #{tableComment},</if> | ||
| 96 | - <if test="className != null and className != ''">class_name = #{className},</if> | ||
| 97 | - <if test="functionAuthor != null and functionAuthor != ''">function_author = #{functionAuthor},</if> | ||
| 98 | - <if test="genType != null and genType != ''">gen_type = #{genType},</if> | ||
| 99 | - <if test="genPath != null and genPath != ''">gen_path = #{genPath},</if> | ||
| 100 | - <if test="tplCategory != null and tplCategory != ''">tpl_category = #{tplCategory},</if> | ||
| 101 | - <if test="packageName != null and packageName != ''">package_name = #{packageName},</if> | ||
| 102 | - <if test="moduleName != null and moduleName != ''">module_name = #{moduleName},</if> | ||
| 103 | - <if test="businessName != null and businessName != ''">business_name = #{businessName},</if> | ||
| 104 | - <if test="functionName != null and functionName != ''">function_name = #{functionName},</if> | ||
| 105 | - <if test="options != null and options != ''">options = #{options},</if> | ||
| 106 | - <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> | ||
| 107 | - <if test="remark != null">remark = #{remark},</if> | ||
| 108 | - update_time = sysdate() | ||
| 109 | - </set> | ||
| 110 | - where table_id = #{tableId} | ||
| 111 | - </update> | ||
| 112 | - | ||
| 113 | - <delete id="deleteGenTableByIds" parameterType="Long"> | ||
| 114 | - delete from gen_table where table_id in | ||
| 115 | - <foreach collection="array" item="tableId" open="(" separator="," close=")"> | ||
| 116 | - #{tableId} | ||
| 117 | - </foreach> | ||
| 118 | - </delete> | ||
| 119 | - | ||
| 120 | </mapper> | 57 | </mapper> |
ruoyi-ui/src/api/tool/codegen.js
| @@ -3,7 +3,7 @@ import request from '@/utils/request' | @@ -3,7 +3,7 @@ import request from '@/utils/request' | ||
| 3 | // 获得表定义分页 | 3 | // 获得表定义分页 |
| 4 | export function getCodeGenTablePage(query) { | 4 | export function getCodeGenTablePage(query) { |
| 5 | return request({ | 5 | return request({ |
| 6 | - url: '/tool/codegen/page', | 6 | + url: '/tool/codegen/table/page', |
| 7 | method: 'get', | 7 | method: 'get', |
| 8 | params: query | 8 | params: query |
| 9 | }) | 9 | }) |
| @@ -16,3 +16,12 @@ export function getCodeGenDetail(tableId) { | @@ -16,3 +16,12 @@ export function getCodeGenDetail(tableId) { | ||
| 16 | method: 'get', | 16 | method: 'get', |
| 17 | }) | 17 | }) |
| 18 | } | 18 | } |
| 19 | + | ||
| 20 | +// 修改代码生成信息 | ||
| 21 | +export function updateCodegen(data) { | ||
| 22 | + return request({ | ||
| 23 | + url: '/tool/codegen/update', | ||
| 24 | + method: 'put', | ||
| 25 | + data: data | ||
| 26 | + }) | ||
| 27 | +} |
ruoyi-ui/src/api/tool/gen.js
| @@ -9,23 +9,6 @@ export function listDbTable(query) { | @@ -9,23 +9,6 @@ export function listDbTable(query) { | ||
| 9 | }) | 9 | }) |
| 10 | } | 10 | } |
| 11 | 11 | ||
| 12 | -// 查询表详细信息 | ||
| 13 | -export function getGenTable(tableId) { | ||
| 14 | - return request({ | ||
| 15 | - url: '/tool/gen/' + tableId, | ||
| 16 | - method: 'get' | ||
| 17 | - }) | ||
| 18 | -} | ||
| 19 | - | ||
| 20 | -// 修改代码生成信息 | ||
| 21 | -export function updateGenTable(data) { | ||
| 22 | - return request({ | ||
| 23 | - url: '/tool/gen', | ||
| 24 | - method: 'put', | ||
| 25 | - data: data | ||
| 26 | - }) | ||
| 27 | -} | ||
| 28 | - | ||
| 29 | // 导入表 | 12 | // 导入表 |
| 30 | export function importTable(data) { | 13 | export function importTable(data) { |
| 31 | return request({ | 14 | return request({ |
ruoyi-ui/src/utils/constants.js
| @@ -39,3 +39,12 @@ export const SysDataScopeEnum = { | @@ -39,3 +39,12 @@ export const SysDataScopeEnum = { | ||
| 39 | DEPT_AND_CHILD: 4, // 部门及以下数据权限 | 39 | DEPT_AND_CHILD: 4, // 部门及以下数据权限 |
| 40 | DEPT_SELF: 5 // 仅本人数据权限 | 40 | DEPT_SELF: 5 // 仅本人数据权限 |
| 41 | } | 41 | } |
| 42 | + | ||
| 43 | +/** | ||
| 44 | + * 代码生成模板类型 | ||
| 45 | + */ | ||
| 46 | +export const ToolCodegenTemplateTypeEnum = { | ||
| 47 | + CRUD: 1, // 基础 CRUD | ||
| 48 | + TREE: 2, // 树形 CRUD | ||
| 49 | + SUB: 3, // 主子表 CRUD | ||
| 50 | +} |
ruoyi-ui/src/utils/dict.js
| @@ -16,7 +16,9 @@ export const DICT_TYPE = { | @@ -16,7 +16,9 @@ export const DICT_TYPE = { | ||
| 16 | SYS_LOGIN_RESULT: 'sys_login_result', | 16 | SYS_LOGIN_RESULT: 'sys_login_result', |
| 17 | SYS_CONFIG_TYPE: 'sys_config_type', | 17 | SYS_CONFIG_TYPE: 'sys_config_type', |
| 18 | 18 | ||
| 19 | - INF_REDIS_TIMEOUT_TYPE: 'inf_redis_timeout_type' | 19 | + INF_REDIS_TIMEOUT_TYPE: 'inf_redis_timeout_type', |
| 20 | + | ||
| 21 | + TOOL_CODEGEN_TEMPLATE_TYPE: 'tool_codegen_template_type', | ||
| 20 | } | 22 | } |
| 21 | 23 | ||
| 22 | /** | 24 | /** |
ruoyi-ui/src/views/tool/gen/editTable.vue
| @@ -98,13 +98,11 @@ | @@ -98,13 +98,11 @@ | ||
| 98 | <template slot-scope="scope"> | 98 | <template slot-scope="scope"> |
| 99 | <el-select v-model="scope.row.dictType" clearable filterable placeholder="请选择"> | 99 | <el-select v-model="scope.row.dictType" clearable filterable placeholder="请选择"> |
| 100 | <el-option | 100 | <el-option |
| 101 | - v-for="dict in dictOptions" | ||
| 102 | - :key="dict.dictType" | ||
| 103 | - :label="dict.dictName" | ||
| 104 | - :value="dict.dictType"> | ||
| 105 | - <span style="float: left">{{ dict.dictName }}</span> | ||
| 106 | - <span style="float: right; color: #8492a6; font-size: 13px">{{ dict.dictType }}</span> | ||
| 107 | - </el-option> | 101 | + v-for="dict in dictOptions" |
| 102 | + :key="dict.id" | ||
| 103 | + :label="dict.name" | ||
| 104 | + :value="dict.type" | ||
| 105 | + /> | ||
| 108 | </el-select> | 106 | </el-select> |
| 109 | </template> | 107 | </template> |
| 110 | </el-table-column> | 108 | </el-table-column> |
| @@ -128,9 +126,8 @@ | @@ -128,9 +126,8 @@ | ||
| 128 | </el-card> | 126 | </el-card> |
| 129 | </template> | 127 | </template> |
| 130 | <script> | 128 | <script> |
| 131 | -import { updateGenTable } from "@/api/tool/gen"; | ||
| 132 | -import { getCodeGenDetail } from "@/api/tool/codegen"; | ||
| 133 | -import { optionselect as getDictOptionselect } from "@/api/system/dict/type"; | 129 | +import { getCodeGenDetail, updateCodegen } from "@/api/tool/codegen"; |
| 130 | +import { listAllSimple as listAllSimpleDictType } from "@/api/system/dict/type"; | ||
| 134 | import { listMenu as getMenuTreeselect } from "@/api/system/menu"; | 131 | import { listMenu as getMenuTreeselect } from "@/api/system/menu"; |
| 135 | import basicInfoForm from "./basicInfoForm"; | 132 | import basicInfoForm from "./basicInfoForm"; |
| 136 | import genInfoForm from "./genInfoForm"; | 133 | import genInfoForm from "./genInfoForm"; |
| @@ -169,7 +166,7 @@ export default { | @@ -169,7 +166,7 @@ export default { | ||
| 169 | this.columns = res.data.columns; | 166 | this.columns = res.data.columns; |
| 170 | }); | 167 | }); |
| 171 | /** 查询字典下拉列表 */ | 168 | /** 查询字典下拉列表 */ |
| 172 | - getDictOptionselect().then(response => { | 169 | + listAllSimpleDictType().then(response => { |
| 173 | this.dictOptions = response.data; | 170 | this.dictOptions = response.data; |
| 174 | }); | 171 | }); |
| 175 | /** 查询菜单下拉列表 */ | 172 | /** 查询菜单下拉列表 */ |
| @@ -186,7 +183,8 @@ export default { | @@ -186,7 +183,8 @@ export default { | ||
| 186 | Promise.all([basicForm, genForm].map(this.getFormPromise)).then(res => { | 183 | Promise.all([basicForm, genForm].map(this.getFormPromise)).then(res => { |
| 187 | const validateResult = res.every(item => !!item); | 184 | const validateResult = res.every(item => !!item); |
| 188 | if (validateResult) { | 185 | if (validateResult) { |
| 189 | - const genTable = Object.assign({}, basicForm.model, genForm.model); | 186 | + const genTable = {}; |
| 187 | + genTable.table = Object.assign({}, basicForm.model, genForm.model); | ||
| 190 | genTable.columns = this.columns; | 188 | genTable.columns = this.columns; |
| 191 | genTable.params = { | 189 | genTable.params = { |
| 192 | treeCode: genTable.treeCode, | 190 | treeCode: genTable.treeCode, |
| @@ -194,11 +192,9 @@ export default { | @@ -194,11 +192,9 @@ export default { | ||
| 194 | treeParentCode: genTable.treeParentCode, | 192 | treeParentCode: genTable.treeParentCode, |
| 195 | parentMenuId: genTable.parentMenuId | 193 | parentMenuId: genTable.parentMenuId |
| 196 | }; | 194 | }; |
| 197 | - updateGenTable(genTable).then(res => { | ||
| 198 | - this.msgSuccess(res.msg); | ||
| 199 | - if (res.code === 200) { | ||
| 200 | - this.close(); | ||
| 201 | - } | 195 | + updateCodegen(genTable).then(res => { |
| 196 | + this.msgSuccess("修改成功!"); | ||
| 197 | + this.close(); | ||
| 202 | }); | 198 | }); |
| 203 | } else { | 199 | } else { |
| 204 | this.msgError("表单校验未通过,请重新检查提交内容"); | 200 | this.msgError("表单校验未通过,请重新检查提交内容"); |
ruoyi-ui/src/views/tool/gen/genInfoForm.vue
| @@ -4,59 +4,74 @@ | @@ -4,59 +4,74 @@ | ||
| 4 | <el-col :span="12"> | 4 | <el-col :span="12"> |
| 5 | <el-form-item prop="tplCategory"> | 5 | <el-form-item prop="tplCategory"> |
| 6 | <span slot="label">生成模板</span> | 6 | <span slot="label">生成模板</span> |
| 7 | - <el-select v-model="info.tplCategory" @change="tplSelectChange"> | ||
| 8 | - <el-option label="单表(增删改查)" value="crud" /> | ||
| 9 | - <el-option label="树表(增删改查)" value="tree" /> | ||
| 10 | - <el-option label="主子表(增删改查)" value="sub" /> | 7 | + <el-select v-model="info.templateType" @change="tplSelectChange"> |
| 8 | + <el-option | ||
| 9 | + v-for="dict in this.getDictDatas(DICT_TYPE.TOOL_CODEGEN_TEMPLATE_TYPE)" | ||
| 10 | + :key="parseInt(dict.value)" | ||
| 11 | + :label="dict.label" | ||
| 12 | + :value="parseInt(dict.value)" | ||
| 13 | + /> | ||
| 11 | </el-select> | 14 | </el-select> |
| 12 | </el-form-item> | 15 | </el-form-item> |
| 13 | </el-col> | 16 | </el-col> |
| 14 | 17 | ||
| 18 | +<!-- <el-col :span="12">--> | ||
| 19 | +<!-- <el-form-item prop="packageName">--> | ||
| 20 | +<!-- <span slot="label">--> | ||
| 21 | +<!-- 生成包路径--> | ||
| 22 | +<!-- <el-tooltip content="生成在哪个java包下,例如 com.ruoyi.system" placement="top">--> | ||
| 23 | +<!-- <i class="el-icon-question"></i>--> | ||
| 24 | +<!-- </el-tooltip>--> | ||
| 25 | +<!-- </span>--> | ||
| 26 | +<!-- <el-input v-model="info.packageName" />--> | ||
| 27 | +<!-- </el-form-item>--> | ||
| 28 | +<!-- </el-col>--> | ||
| 29 | + | ||
| 15 | <el-col :span="12"> | 30 | <el-col :span="12"> |
| 16 | - <el-form-item prop="packageName"> | 31 | + <el-form-item prop="moduleName"> |
| 17 | <span slot="label"> | 32 | <span slot="label"> |
| 18 | - 生成包路径 | ||
| 19 | - <el-tooltip content="生成在哪个java包下,例如 com.ruoyi.system" placement="top"> | 33 | + 模块名 |
| 34 | + <el-tooltip content="模块名,即一级目录,例如 system、infra、tool 等等" placement="top"> | ||
| 20 | <i class="el-icon-question"></i> | 35 | <i class="el-icon-question"></i> |
| 21 | </el-tooltip> | 36 | </el-tooltip> |
| 22 | </span> | 37 | </span> |
| 23 | - <el-input v-model="info.packageName" /> | 38 | + <el-input v-model="info.moduleName" /> |
| 24 | </el-form-item> | 39 | </el-form-item> |
| 25 | </el-col> | 40 | </el-col> |
| 26 | 41 | ||
| 27 | <el-col :span="12"> | 42 | <el-col :span="12"> |
| 28 | - <el-form-item prop="moduleName"> | 43 | + <el-form-item prop="businessName"> |
| 29 | <span slot="label"> | 44 | <span slot="label"> |
| 30 | - 生成模块名 | ||
| 31 | - <el-tooltip content="可理解为子系统名,例如 system" placement="top"> | 45 | + 业务名 |
| 46 | + <el-tooltip content="业务名,即二级目录,例如 user、permission、dict 等等" placement="top"> | ||
| 32 | <i class="el-icon-question"></i> | 47 | <i class="el-icon-question"></i> |
| 33 | </el-tooltip> | 48 | </el-tooltip> |
| 34 | </span> | 49 | </span> |
| 35 | - <el-input v-model="info.moduleName" /> | 50 | + <el-input v-model="info.businessName" /> |
| 36 | </el-form-item> | 51 | </el-form-item> |
| 37 | </el-col> | 52 | </el-col> |
| 38 | 53 | ||
| 39 | <el-col :span="12"> | 54 | <el-col :span="12"> |
| 40 | - <el-form-item prop="businessName"> | 55 | + <el-form-item prop="className"> |
| 41 | <span slot="label"> | 56 | <span slot="label"> |
| 42 | - 生成业务名 | ||
| 43 | - <el-tooltip content="可理解为功能英文名,例如 user" placement="top"> | 57 | + 类名称 |
| 58 | + <el-tooltip content="类名称(首字母大写),例如SysUser、SysMenu、SysDictData 等等" placement="top"> | ||
| 44 | <i class="el-icon-question"></i> | 59 | <i class="el-icon-question"></i> |
| 45 | </el-tooltip> | 60 | </el-tooltip> |
| 46 | </span> | 61 | </span> |
| 47 | - <el-input v-model="info.businessName" /> | 62 | + <el-input v-model="info.className" /> |
| 48 | </el-form-item> | 63 | </el-form-item> |
| 49 | </el-col> | 64 | </el-col> |
| 50 | 65 | ||
| 51 | <el-col :span="12"> | 66 | <el-col :span="12"> |
| 52 | - <el-form-item prop="functionName"> | 67 | + <el-form-item prop="classComment"> |
| 53 | <span slot="label"> | 68 | <span slot="label"> |
| 54 | - 生成功能名 | 69 | + 类描述 |
| 55 | <el-tooltip content="用作类描述,例如 用户" placement="top"> | 70 | <el-tooltip content="用作类描述,例如 用户" placement="top"> |
| 56 | <i class="el-icon-question"></i> | 71 | <i class="el-icon-question"></i> |
| 57 | </el-tooltip> | 72 | </el-tooltip> |
| 58 | </span> | 73 | </span> |
| 59 | - <el-input v-model="info.functionName" /> | 74 | + <el-input v-model="info.classComment" /> |
| 60 | </el-form-item> | 75 | </el-form-item> |
| 61 | </el-col> | 76 | </el-col> |
| 62 | 77 | ||
| @@ -79,19 +94,6 @@ | @@ -79,19 +94,6 @@ | ||
| 79 | </el-form-item> | 94 | </el-form-item> |
| 80 | </el-col> | 95 | </el-col> |
| 81 | 96 | ||
| 82 | - <el-col :span="12"> | ||
| 83 | - <el-form-item prop="genType"> | ||
| 84 | - <span slot="label"> | ||
| 85 | - 生成代码方式 | ||
| 86 | - <el-tooltip content="默认为zip压缩包下载,也可以自定义生成路径" placement="top"> | ||
| 87 | - <i class="el-icon-question"></i> | ||
| 88 | - </el-tooltip> | ||
| 89 | - </span> | ||
| 90 | - <el-radio v-model="info.genType" label="0">zip压缩包</el-radio> | ||
| 91 | - <el-radio v-model="info.genType" label="1">自定义路径</el-radio> | ||
| 92 | - </el-form-item> | ||
| 93 | - </el-col> | ||
| 94 | - | ||
| 95 | <el-col :span="24" v-if="info.genType == '1'"> | 97 | <el-col :span="24" v-if="info.genType == '1'"> |
| 96 | <el-form-item prop="genPath"> | 98 | <el-form-item prop="genPath"> |
| 97 | <span slot="label"> | 99 | <span slot="label"> |
| @@ -238,20 +240,23 @@ export default { | @@ -238,20 +240,23 @@ export default { | ||
| 238 | return { | 240 | return { |
| 239 | subColumns: [], | 241 | subColumns: [], |
| 240 | rules: { | 242 | rules: { |
| 241 | - tplCategory: [ | 243 | + templateType: [ |
| 242 | { required: true, message: "请选择生成模板", trigger: "blur" } | 244 | { required: true, message: "请选择生成模板", trigger: "blur" } |
| 243 | ], | 245 | ], |
| 244 | - packageName: [ | ||
| 245 | - { required: true, message: "请输入生成包路径", trigger: "blur" } | ||
| 246 | - ], | 246 | + // packageName: [ |
| 247 | + // { required: true, message: "请输入生成包路径", trigger: "blur" } | ||
| 248 | + // ], | ||
| 247 | moduleName: [ | 249 | moduleName: [ |
| 248 | { required: true, message: "请输入生成模块名", trigger: "blur" } | 250 | { required: true, message: "请输入生成模块名", trigger: "blur" } |
| 249 | ], | 251 | ], |
| 250 | businessName: [ | 252 | businessName: [ |
| 251 | { required: true, message: "请输入生成业务名", trigger: "blur" } | 253 | { required: true, message: "请输入生成业务名", trigger: "blur" } |
| 252 | ], | 254 | ], |
| 253 | - functionName: [ | ||
| 254 | - { required: true, message: "请输入生成功能名", trigger: "blur" } | 255 | + className: [ |
| 256 | + { required: true, message: "请输入生成类名称", trigger: "blur" } | ||
| 257 | + ], | ||
| 258 | + classComment: [ | ||
| 259 | + { required: true, message: "请输入生成类描述", trigger: "blur" } | ||
| 255 | ], | 260 | ], |
| 256 | } | 261 | } |
| 257 | }; | 262 | }; |
src/main/java/cn/iocoder/dashboard/modules/system/dal/redis/dao/auth/SysLoginUserRedisDAO.java renamed to src/main/java/cn/iocoder/dashboard/modules/system/dal/redis/auth/SysLoginUserRedisDAO.java
| 1 | -package cn.iocoder.dashboard.modules.system.dal.redis.dao.auth; | 1 | +package cn.iocoder.dashboard.modules.system.dal.redis.auth; |
| 2 | 2 | ||
| 3 | import cn.iocoder.dashboard.framework.security.core.LoginUser; | 3 | import cn.iocoder.dashboard.framework.security.core.LoginUser; |
| 4 | import cn.iocoder.dashboard.util.json.JsonUtils; | 4 | import cn.iocoder.dashboard.util.json.JsonUtils; |
src/main/java/cn/iocoder/dashboard/modules/system/dal/redis/dao/common/SysCaptchaRedisDAO.java renamed to src/main/java/cn/iocoder/dashboard/modules/system/dal/redis/common/SysCaptchaRedisDAO.java
| 1 | -package cn.iocoder.dashboard.modules.system.dal.redis.dao.common; | 1 | +package cn.iocoder.dashboard.modules.system.dal.redis.common; |
| 2 | 2 | ||
| 3 | import org.springframework.data.redis.core.StringRedisTemplate; | 3 | import org.springframework.data.redis.core.StringRedisTemplate; |
| 4 | import org.springframework.stereotype.Repository; | 4 | import org.springframework.stereotype.Repository; |
src/main/java/cn/iocoder/dashboard/modules/system/dal/redis/dao/package-info.java deleted
src/main/java/cn/iocoder/dashboard/modules/system/service/auth/impl/SysUserSessionServiceImpl.java
| @@ -10,7 +10,7 @@ import cn.iocoder.dashboard.modules.system.controller.auth.vo.session.SysUserSes | @@ -10,7 +10,7 @@ import cn.iocoder.dashboard.modules.system.controller.auth.vo.session.SysUserSes | ||
| 10 | import cn.iocoder.dashboard.modules.system.dal.mysql.auth.SysUserSessionMapper; | 10 | import cn.iocoder.dashboard.modules.system.dal.mysql.auth.SysUserSessionMapper; |
| 11 | import cn.iocoder.dashboard.modules.system.dal.dataobject.auth.SysUserSessionDO; | 11 | import cn.iocoder.dashboard.modules.system.dal.dataobject.auth.SysUserSessionDO; |
| 12 | import cn.iocoder.dashboard.modules.system.dal.dataobject.user.SysUserDO; | 12 | import cn.iocoder.dashboard.modules.system.dal.dataobject.user.SysUserDO; |
| 13 | -import cn.iocoder.dashboard.modules.system.dal.redis.dao.auth.SysLoginUserRedisDAO; | 13 | +import cn.iocoder.dashboard.modules.system.dal.redis.auth.SysLoginUserRedisDAO; |
| 14 | import cn.iocoder.dashboard.modules.system.service.auth.SysUserSessionService; | 14 | import cn.iocoder.dashboard.modules.system.service.auth.SysUserSessionService; |
| 15 | import cn.iocoder.dashboard.modules.system.service.user.SysUserService; | 15 | import cn.iocoder.dashboard.modules.system.service.user.SysUserService; |
| 16 | import org.springframework.stereotype.Service; | 16 | import org.springframework.stereotype.Service; |
src/main/java/cn/iocoder/dashboard/modules/system/service/common/impl/SysCaptchaServiceImpl.java
| @@ -6,7 +6,7 @@ import cn.hutool.core.util.IdUtil; | @@ -6,7 +6,7 @@ import cn.hutool.core.util.IdUtil; | ||
| 6 | import cn.iocoder.dashboard.framework.captcha.config.CaptchaProperties; | 6 | import cn.iocoder.dashboard.framework.captcha.config.CaptchaProperties; |
| 7 | import cn.iocoder.dashboard.modules.system.controller.common.vo.SysCaptchaImageRespVO; | 7 | import cn.iocoder.dashboard.modules.system.controller.common.vo.SysCaptchaImageRespVO; |
| 8 | import cn.iocoder.dashboard.modules.system.convert.common.SysCaptchaConvert; | 8 | import cn.iocoder.dashboard.modules.system.convert.common.SysCaptchaConvert; |
| 9 | -import cn.iocoder.dashboard.modules.system.dal.redis.dao.common.SysCaptchaRedisDAO; | 9 | +import cn.iocoder.dashboard.modules.system.dal.redis.common.SysCaptchaRedisDAO; |
| 10 | import cn.iocoder.dashboard.modules.system.service.common.SysCaptchaService; | 10 | import cn.iocoder.dashboard.modules.system.service.common.SysCaptchaService; |
| 11 | import org.springframework.stereotype.Service; | 11 | import org.springframework.stereotype.Service; |
| 12 | 12 |
src/main/java/cn/iocoder/dashboard/modules/tool/controller/codegen/ToolCodegenController.java
| @@ -3,8 +3,9 @@ package cn.iocoder.dashboard.modules.tool.controller.codegen; | @@ -3,8 +3,9 @@ package cn.iocoder.dashboard.modules.tool.controller.codegen; | ||
| 3 | import cn.iocoder.dashboard.common.pojo.CommonResult; | 3 | import cn.iocoder.dashboard.common.pojo.CommonResult; |
| 4 | import cn.iocoder.dashboard.common.pojo.PageResult; | 4 | import cn.iocoder.dashboard.common.pojo.PageResult; |
| 5 | import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.ToolCodegenDetailRespVO; | 5 | import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.ToolCodegenDetailRespVO; |
| 6 | -import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.ToolCodegenTablePageReqVO; | ||
| 7 | -import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.ToolCodegenTableRespVO; | 6 | +import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.ToolCodegenUpdateReqVO; |
| 7 | +import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.table.ToolCodegenTablePageReqVO; | ||
| 8 | +import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.table.ToolCodegenTableRespVO; | ||
| 8 | import cn.iocoder.dashboard.modules.tool.convert.codegen.ToolCodegenConvert; | 9 | import cn.iocoder.dashboard.modules.tool.convert.codegen.ToolCodegenConvert; |
| 9 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolCodegenColumnDO; | 10 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolCodegenColumnDO; |
| 10 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolCodegenTableDO; | 11 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolCodegenTableDO; |
| @@ -30,7 +31,7 @@ public class ToolCodegenController { | @@ -30,7 +31,7 @@ public class ToolCodegenController { | ||
| 30 | private ToolCodegenService codegenService; | 31 | private ToolCodegenService codegenService; |
| 31 | 32 | ||
| 32 | @ApiOperation("获得表定义分页") | 33 | @ApiOperation("获得表定义分页") |
| 33 | - @GetMapping("/page") | 34 | + @GetMapping("/table/page") |
| 34 | // TODO 权限 @PreAuthorize("@ss.hasPermi('tool:gen:list')") | 35 | // TODO 权限 @PreAuthorize("@ss.hasPermi('tool:gen:list')") |
| 35 | public CommonResult<PageResult<ToolCodegenTableRespVO>> getCodeGenTablePage(@Valid ToolCodegenTablePageReqVO pageReqVO) { | 36 | public CommonResult<PageResult<ToolCodegenTableRespVO>> getCodeGenTablePage(@Valid ToolCodegenTablePageReqVO pageReqVO) { |
| 36 | PageResult<ToolCodegenTableDO> pageResult = codegenService.getCodeGenTablePage(pageReqVO); | 37 | PageResult<ToolCodegenTableDO> pageResult = codegenService.getCodeGenTablePage(pageReqVO); |
| @@ -50,8 +51,19 @@ public class ToolCodegenController { | @@ -50,8 +51,19 @@ public class ToolCodegenController { | ||
| 50 | @ApiOperation("基于数据库的表结构,创建代码生成器的表定义") | 51 | @ApiOperation("基于数据库的表结构,创建代码生成器的表定义") |
| 51 | @PostMapping("/create") | 52 | @PostMapping("/create") |
| 52 | // TODO 权限 | 53 | // TODO 权限 |
| 53 | - public CommonResult<Long> createCodeGenTable(@RequestParam("tableName") String tableName) { | ||
| 54 | - return success(codegenService.createCodegenTable(tableName)); | 54 | + public CommonResult<Long> createCodeGen(@RequestParam("tableName") String tableName) { |
| 55 | + return success(codegenService.createCodegen(tableName)); | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + /** | ||
| 59 | + * 修改保存代码生成业务 | ||
| 60 | + */ | ||
| 61 | + @ApiOperation("更新数据库的表和字段定义") | ||
| 62 | + @PutMapping("/update") | ||
| 63 | +// @PreAuthorize("@ss.hasPermi('tool:gen:edit')") TODO 权限 | ||
| 64 | + public CommonResult<Boolean> updateCodegen(@Valid @RequestBody ToolCodegenUpdateReqVO updateReqVO) { | ||
| 65 | + codegenService.updateCodegen(updateReqVO); | ||
| 66 | + return success(true); | ||
| 55 | } | 67 | } |
| 56 | 68 | ||
| 57 | } | 69 | } |
src/main/java/cn/iocoder/dashboard/modules/tool/controller/codegen/vo/ToolCodegenDetailRespVO.java
| 1 | package cn.iocoder.dashboard.modules.tool.controller.codegen.vo; | 1 | package cn.iocoder.dashboard.modules.tool.controller.codegen.vo; |
| 2 | 2 | ||
| 3 | +import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.column.ToolCodegenColumnRespVO; | ||
| 4 | +import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.table.ToolCodegenTableRespVO; | ||
| 3 | import io.swagger.annotations.ApiModel; | 5 | import io.swagger.annotations.ApiModel; |
| 4 | import io.swagger.annotations.ApiModelProperty; | 6 | import io.swagger.annotations.ApiModelProperty; |
| 5 | import lombok.Data; | 7 | import lombok.Data; |
src/main/java/cn/iocoder/dashboard/modules/tool/controller/codegen/vo/ToolCodegenUpdateReqVO.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.modules.tool.controller.codegen.vo; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.column.ToolCodegenColumnBaseVO; | ||
| 4 | +import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.table.ToolCodegenTableBaseVO; | ||
| 5 | +import io.swagger.annotations.ApiModel; | ||
| 6 | +import io.swagger.annotations.ApiModelProperty; | ||
| 7 | +import lombok.Data; | ||
| 8 | +import lombok.EqualsAndHashCode; | ||
| 9 | +import lombok.ToString; | ||
| 10 | + | ||
| 11 | +import javax.validation.Valid; | ||
| 12 | +import javax.validation.constraints.NotNull; | ||
| 13 | +import java.util.List; | ||
| 14 | + | ||
| 15 | +@ApiModel("代码生成表和字段的修改 Request VO") | ||
| 16 | +@Data | ||
| 17 | +public class ToolCodegenUpdateReqVO { | ||
| 18 | + | ||
| 19 | + @Valid // 校验内嵌的字段 | ||
| 20 | + @NotNull(message = "表定义不能为空") | ||
| 21 | + private Table table; | ||
| 22 | + | ||
| 23 | + @Valid // 校验内嵌的字段 | ||
| 24 | + @NotNull(message = "字段定义不能为空") | ||
| 25 | + private List<Column> columns; | ||
| 26 | + | ||
| 27 | + @ApiModel("更新表定义") | ||
| 28 | + @Data | ||
| 29 | + @EqualsAndHashCode(callSuper = true) | ||
| 30 | + @ToString(callSuper = true) | ||
| 31 | + public static class Table extends ToolCodegenTableBaseVO { | ||
| 32 | + | ||
| 33 | + @ApiModelProperty(value = "编号", required = true, example = "1") | ||
| 34 | + private Long id; | ||
| 35 | + | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + @ApiModel("更新表定义") | ||
| 39 | + @Data | ||
| 40 | + @EqualsAndHashCode(callSuper = true) | ||
| 41 | + @ToString(callSuper = true) | ||
| 42 | + public static class Column extends ToolCodegenColumnBaseVO { | ||
| 43 | + | ||
| 44 | + @ApiModelProperty(value = "编号", required = true, example = "1") | ||
| 45 | + private Long id; | ||
| 46 | + | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | +} |
src/main/java/cn/iocoder/dashboard/modules/tool/controller/codegen/vo/ToolCodegenColumnBaseVO.java renamed to src/main/java/cn/iocoder/dashboard/modules/tool/controller/codegen/vo/column/ToolCodegenColumnBaseVO.java
src/main/java/cn/iocoder/dashboard/modules/tool/controller/codegen/vo/ToolCodegenColumnRespVO.java renamed to src/main/java/cn/iocoder/dashboard/modules/tool/controller/codegen/vo/column/ToolCodegenColumnRespVO.java
| 1 | -package cn.iocoder.dashboard.modules.tool.controller.codegen.vo; | 1 | +package cn.iocoder.dashboard.modules.tool.controller.codegen.vo.column; |
| 2 | 2 | ||
| 3 | import io.swagger.annotations.ApiModel; | 3 | import io.swagger.annotations.ApiModel; |
| 4 | import io.swagger.annotations.ApiModelProperty; | 4 | import io.swagger.annotations.ApiModelProperty; |
src/main/java/cn/iocoder/dashboard/modules/tool/controller/codegen/vo/ToolCodegenTableBaseVO.java renamed to src/main/java/cn/iocoder/dashboard/modules/tool/controller/codegen/vo/table/ToolCodegenTableBaseVO.java
src/main/java/cn/iocoder/dashboard/modules/tool/controller/codegen/vo/ToolCodegenTablePageReqVO.java renamed to src/main/java/cn/iocoder/dashboard/modules/tool/controller/codegen/vo/table/ToolCodegenTablePageReqVO.java
| 1 | -package cn.iocoder.dashboard.modules.tool.controller.codegen.vo; | 1 | +package cn.iocoder.dashboard.modules.tool.controller.codegen.vo.table; |
| 2 | 2 | ||
| 3 | import cn.iocoder.dashboard.common.pojo.PageParam; | 3 | import cn.iocoder.dashboard.common.pojo.PageParam; |
| 4 | import io.swagger.annotations.ApiModel; | 4 | import io.swagger.annotations.ApiModel; |
src/main/java/cn/iocoder/dashboard/modules/tool/controller/codegen/vo/ToolCodegenTableRespVO.java renamed to src/main/java/cn/iocoder/dashboard/modules/tool/controller/codegen/vo/table/ToolCodegenTableRespVO.java
| 1 | -package cn.iocoder.dashboard.modules.tool.controller.codegen.vo; | 1 | +package cn.iocoder.dashboard.modules.tool.controller.codegen.vo.table; |
| 2 | 2 | ||
| 3 | import io.swagger.annotations.ApiModel; | 3 | import io.swagger.annotations.ApiModel; |
| 4 | import io.swagger.annotations.ApiModelProperty; | 4 | import io.swagger.annotations.ApiModelProperty; |
src/main/java/cn/iocoder/dashboard/modules/tool/convert/codegen/ToolCodegenConvert.java
| 1 | package cn.iocoder.dashboard.modules.tool.convert.codegen; | 1 | package cn.iocoder.dashboard.modules.tool.convert.codegen; |
| 2 | 2 | ||
| 3 | import cn.iocoder.dashboard.common.pojo.PageResult; | 3 | import cn.iocoder.dashboard.common.pojo.PageResult; |
| 4 | -import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.ToolCodegenColumnRespVO; | 4 | +import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.ToolCodegenUpdateReqVO; |
| 5 | +import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.column.ToolCodegenColumnRespVO; | ||
| 5 | import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.ToolCodegenDetailRespVO; | 6 | import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.ToolCodegenDetailRespVO; |
| 6 | -import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.ToolCodegenTableRespVO; | 7 | +import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.table.ToolCodegenTableRespVO; |
| 7 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolCodegenColumnDO; | 8 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolCodegenColumnDO; |
| 8 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolCodegenTableDO; | 9 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolCodegenTableDO; |
| 9 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolInformationSchemaColumnDO; | 10 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolInformationSchemaColumnDO; |
| @@ -38,6 +39,10 @@ public interface ToolCodegenConvert { | @@ -38,6 +39,10 @@ public interface ToolCodegenConvert { | ||
| 38 | 39 | ||
| 39 | List<ToolCodegenColumnRespVO> convertList02(List<ToolCodegenColumnDO> list); | 40 | List<ToolCodegenColumnRespVO> convertList02(List<ToolCodegenColumnDO> list); |
| 40 | 41 | ||
| 42 | + ToolCodegenTableDO convert(ToolCodegenUpdateReqVO.Table bean); | ||
| 43 | + | ||
| 44 | + List<ToolCodegenColumnDO> convertList03(List<ToolCodegenUpdateReqVO.Column> columns); | ||
| 45 | + | ||
| 41 | // ========== 其它 ========== | 46 | // ========== 其它 ========== |
| 42 | 47 | ||
| 43 | default ToolCodegenDetailRespVO convert(ToolCodegenTableDO table, List<ToolCodegenColumnDO> columns) { | 48 | default ToolCodegenDetailRespVO convert(ToolCodegenTableDO table, List<ToolCodegenColumnDO> columns) { |
src/main/java/cn/iocoder/dashboard/modules/tool/dal/dataobject/codegen/ToolCodegenTableDO.java
| @@ -43,7 +43,7 @@ public class ToolCodegenTableDO extends BaseDO { | @@ -43,7 +43,7 @@ public class ToolCodegenTableDO extends BaseDO { | ||
| 43 | /** | 43 | /** |
| 44 | * 模块名,即一级目录 | 44 | * 模块名,即一级目录 |
| 45 | * | 45 | * |
| 46 | - * 例如说,infra、system、tool 等等 | 46 | + * 例如说,system、infra、tool 等等 |
| 47 | */ | 47 | */ |
| 48 | private String moduleName; | 48 | private String moduleName; |
| 49 | /** | 49 | /** |
src/main/java/cn/iocoder/dashboard/modules/tool/dal/mysql/coegen/ToolCodegenTableMapper.java
| @@ -3,7 +3,7 @@ package cn.iocoder.dashboard.modules.tool.dal.mysql.coegen; | @@ -3,7 +3,7 @@ package cn.iocoder.dashboard.modules.tool.dal.mysql.coegen; | ||
| 3 | import cn.iocoder.dashboard.common.pojo.PageResult; | 3 | import cn.iocoder.dashboard.common.pojo.PageResult; |
| 4 | import cn.iocoder.dashboard.framework.mybatis.core.mapper.BaseMapperX; | 4 | import cn.iocoder.dashboard.framework.mybatis.core.mapper.BaseMapperX; |
| 5 | import cn.iocoder.dashboard.framework.mybatis.core.query.QueryWrapperX; | 5 | import cn.iocoder.dashboard.framework.mybatis.core.query.QueryWrapperX; |
| 6 | -import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.ToolCodegenTablePageReqVO; | 6 | +import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.table.ToolCodegenTablePageReqVO; |
| 7 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolCodegenTableDO; | 7 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolCodegenTableDO; |
| 8 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 8 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| 9 | import org.apache.ibatis.annotations.Mapper; | 9 | import org.apache.ibatis.annotations.Mapper; |
src/main/java/cn/iocoder/dashboard/modules/tool/enums/codegen/ToolCodegenTemplateTypeEnum.java
| @@ -12,10 +12,10 @@ import lombok.Getter; | @@ -12,10 +12,10 @@ import lombok.Getter; | ||
| 12 | @Getter | 12 | @Getter |
| 13 | public enum ToolCodegenTemplateTypeEnum { | 13 | public enum ToolCodegenTemplateTypeEnum { |
| 14 | 14 | ||
| 15 | - CRUD(1), // 基础 CRUD | ||
| 16 | - TREE(2), // 树形 CRUD | 15 | + CRUD(1), // 单表(增删改查) |
| 16 | + TREE(2), // 树表(增删改查) | ||
| 17 | // TODO 主子表,暂时不考虑支持。原因是较为灵活,形态较多,很难评估。 | 17 | // TODO 主子表,暂时不考虑支持。原因是较为灵活,形态较多,很难评估。 |
| 18 | - SUB(3) // 主子表 CRUD | 18 | + SUB(3) // 主子表(增删改查) |
| 19 | ; | 19 | ; |
| 20 | 20 | ||
| 21 | /** | 21 | /** |
src/main/java/cn/iocoder/dashboard/modules/tool/service/codegen/ToolCodegenService.java
| 1 | package cn.iocoder.dashboard.modules.tool.service.codegen; | 1 | package cn.iocoder.dashboard.modules.tool.service.codegen; |
| 2 | 2 | ||
| 3 | import cn.iocoder.dashboard.common.pojo.PageResult; | 3 | import cn.iocoder.dashboard.common.pojo.PageResult; |
| 4 | -import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.ToolCodegenTablePageReqVO; | 4 | +import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.ToolCodegenUpdateReqVO; |
| 5 | +import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.table.ToolCodegenTablePageReqVO; | ||
| 5 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolCodegenColumnDO; | 6 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolCodegenColumnDO; |
| 6 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolCodegenTableDO; | 7 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolCodegenTableDO; |
| 7 | 8 | ||
| @@ -20,7 +21,14 @@ public interface ToolCodegenService { | @@ -20,7 +21,14 @@ public interface ToolCodegenService { | ||
| 20 | * @param tableName 表名称 | 21 | * @param tableName 表名称 |
| 21 | * @return 表定义的编号 | 22 | * @return 表定义的编号 |
| 22 | */ | 23 | */ |
| 23 | - Long createCodegenTable(String tableName); | 24 | + Long createCodegen(String tableName); |
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * 更新数据库的表和字段定义 | ||
| 28 | + * | ||
| 29 | + * @param updateReqVO 更新信息 | ||
| 30 | + */ | ||
| 31 | + void updateCodegen(ToolCodegenUpdateReqVO updateReqVO); | ||
| 24 | 32 | ||
| 25 | /** | 33 | /** |
| 26 | * 获得表定义分页 | 34 | * 获得表定义分页 |
src/main/java/cn/iocoder/dashboard/modules/tool/service/codegen/impl/ToolCodegenServiceImpl.java
| @@ -2,7 +2,9 @@ package cn.iocoder.dashboard.modules.tool.service.codegen.impl; | @@ -2,7 +2,9 @@ package cn.iocoder.dashboard.modules.tool.service.codegen.impl; | ||
| 2 | 2 | ||
| 3 | import cn.hutool.core.collection.CollUtil; | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | import cn.iocoder.dashboard.common.pojo.PageResult; | 4 | import cn.iocoder.dashboard.common.pojo.PageResult; |
| 5 | -import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.ToolCodegenTablePageReqVO; | 5 | +import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.ToolCodegenUpdateReqVO; |
| 6 | +import cn.iocoder.dashboard.modules.tool.controller.codegen.vo.table.ToolCodegenTablePageReqVO; | ||
| 7 | +import cn.iocoder.dashboard.modules.tool.convert.codegen.ToolCodegenConvert; | ||
| 6 | import cn.iocoder.dashboard.modules.tool.dal.mysql.coegen.ToolCodegenColumnMapper; | 8 | import cn.iocoder.dashboard.modules.tool.dal.mysql.coegen.ToolCodegenColumnMapper; |
| 7 | import cn.iocoder.dashboard.modules.tool.dal.mysql.coegen.ToolCodegenTableMapper; | 9 | import cn.iocoder.dashboard.modules.tool.dal.mysql.coegen.ToolCodegenTableMapper; |
| 8 | import cn.iocoder.dashboard.modules.tool.dal.mysql.coegen.ToolInformationSchemaColumnMapper; | 10 | import cn.iocoder.dashboard.modules.tool.dal.mysql.coegen.ToolInformationSchemaColumnMapper; |
| @@ -42,7 +44,7 @@ public class ToolCodegenServiceImpl implements ToolCodegenService { | @@ -42,7 +44,7 @@ public class ToolCodegenServiceImpl implements ToolCodegenService { | ||
| 42 | 44 | ||
| 43 | @Override | 45 | @Override |
| 44 | @Transactional | 46 | @Transactional |
| 45 | - public Long createCodegenTable(String tableName) { | 47 | + public Long createCodegen(String tableName) { |
| 46 | // 从数据库中,获得数据库表结构 | 48 | // 从数据库中,获得数据库表结构 |
| 47 | ToolInformationSchemaTableDO schemaTable = informationSchemaTableMapper.selectByTableName(tableName); | 49 | ToolInformationSchemaTableDO schemaTable = informationSchemaTableMapper.selectByTableName(tableName); |
| 48 | if (schemaTable == null) { | 50 | if (schemaTable == null) { |
| @@ -70,6 +72,22 @@ public class ToolCodegenServiceImpl implements ToolCodegenService { | @@ -70,6 +72,22 @@ public class ToolCodegenServiceImpl implements ToolCodegenService { | ||
| 70 | } | 72 | } |
| 71 | 73 | ||
| 72 | @Override | 74 | @Override |
| 75 | + @Transactional | ||
| 76 | + public void updateCodegen(ToolCodegenUpdateReqVO updateReqVO) { | ||
| 77 | + // 校验是否已经存在 | ||
| 78 | + if (codegenTableMapper.selectById(updateReqVO.getTable().getId()) == null) { | ||
| 79 | + throw new RuntimeException(""); // TODO | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + // 更新 table 表定义 | ||
| 83 | + ToolCodegenTableDO updateTableObj = ToolCodegenConvert.INSTANCE.convert(updateReqVO.getTable()); | ||
| 84 | + codegenTableMapper.updateById(updateTableObj); | ||
| 85 | + // 更新 column 字段定义 | ||
| 86 | + List<ToolCodegenColumnDO> updateColumnObjs = ToolCodegenConvert.INSTANCE.convertList03(updateReqVO.getColumns()); | ||
| 87 | + updateColumnObjs.forEach(updateColumnObj -> codegenColumnMapper.updateById(updateColumnObj)); | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + @Override | ||
| 73 | public PageResult<ToolCodegenTableDO> getCodeGenTablePage(ToolCodegenTablePageReqVO pageReqVO) { | 91 | public PageResult<ToolCodegenTableDO> getCodeGenTablePage(ToolCodegenTablePageReqVO pageReqVO) { |
| 74 | return codegenTableMapper.selectPage(pageReqVO); | 92 | return codegenTableMapper.selectPage(pageReqVO); |
| 75 | } | 93 | } |
src/main/resources/application.yaml
| @@ -39,8 +39,8 @@ spring: | @@ -39,8 +39,8 @@ spring: | ||
| 39 | write-durations-as-timestamps: true # 设置 Duration 的格式,使用时间戳 | 39 | write-durations-as-timestamps: true # 设置 Duration 的格式,使用时间戳 |
| 40 | fail-on-empty-beans: false # 允许序列化无属性的 Bean | 40 | fail-on-empty-beans: false # 允许序列化无属性的 Bean |
| 41 | 41 | ||
| 42 | - main: | ||
| 43 | - lazy-initialization: true # TODO 芋艿:本地开发环境,可以配置下 lazy 延迟加载 | 42 | +# main: |
| 43 | +# lazy-initialization: true # TODO 芋艿:本地开发环境,可以配置下 lazy 延迟加载 | ||
| 44 | 44 | ||
| 45 | # 芋道配置项,设置当前项目所有自定义的配置 | 45 | # 芋道配置项,设置当前项目所有自定义的配置 |
| 46 | yudao: | 46 | yudao: |
src/main/resources/codegen/controller/controller.vm
| @@ -15,7 +15,7 @@ import ${CommonResultClassName}; | @@ -15,7 +15,7 @@ import ${CommonResultClassName}; | ||
| 15 | import static ${CommonResultClassName}.success; | 15 | import static ${CommonResultClassName}.success; |
| 16 | 16 | ||
| 17 | import ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo.*; | 17 | import ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo.*; |
| 18 | -import ${basePackage}.${table.moduleName}.dal.mysql.dataobject.${table.businessName}.${table.className}DO; | 18 | +import ${basePackage}.${table.moduleName}.dal.dataobject.${table.businessName}.${table.className}DO; |
| 19 | import ${basePackage}.${table.moduleName}.convert.${table.businessName}.${table.className}Convert; | 19 | import ${basePackage}.${table.moduleName}.convert.${table.businessName}.${table.className}Convert; |
| 20 | import ${basePackage}.${table.moduleName}.service.${table.businessName}.${table.className}Service; | 20 | import ${basePackage}.${table.moduleName}.service.${table.businessName}.${table.className}Service; |
| 21 | 21 |
src/main/resources/codegen/convert/convert.vm
| @@ -7,7 +7,7 @@ import ${PageResultClassName}; | @@ -7,7 +7,7 @@ import ${PageResultClassName}; | ||
| 7 | import org.mapstruct.Mapper; | 7 | import org.mapstruct.Mapper; |
| 8 | import org.mapstruct.factory.Mappers; | 8 | import org.mapstruct.factory.Mappers; |
| 9 | import ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo.*; | 9 | import ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo.*; |
| 10 | -import ${basePackage}.${table.moduleName}.dal.mysql.dataobject.${table.businessName}.${table.className}DO; | 10 | +import ${basePackage}.${table.moduleName}.dal.dataobject.${table.businessName}.${table.className}DO; |
| 11 | 11 | ||
| 12 | /** | 12 | /** |
| 13 | * ${table.classComment} Convert | 13 | * ${table.classComment} Convert |
src/main/resources/codegen/dal/do.vm
src/main/resources/codegen/dal/mapper.vm
| 1 | -package ${basePackage}.${table.moduleName}.dal.mysql.dao.${table.businessName}; | 1 | +package ${basePackage}.${table.moduleName}.dal.mysql.${table.businessName}; |
| 2 | 2 | ||
| 3 | import ${PageResultClassName}; | 3 | import ${PageResultClassName}; |
| 4 | import ${QueryWrapperClassName}; | 4 | import ${QueryWrapperClassName}; |
| 5 | import ${BaseMapperClassName}; | 5 | import ${BaseMapperClassName}; |
| 6 | -import ${basePackage}.${table.moduleName}.dal.mysql.dataobject.${table.businessName}.${table.className}DO; | 6 | +import ${basePackage}.${table.moduleName}.dal.dataobject.${table.businessName}.${table.className}DO; |
| 7 | import org.apache.ibatis.annotations.Mapper; | 7 | import org.apache.ibatis.annotations.Mapper; |
| 8 | import ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo.${table.className}PageReqVO; | 8 | import ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo.${table.className}PageReqVO; |
| 9 | 9 |
src/main/resources/codegen/service/service.vm
| @@ -3,7 +3,7 @@ package ${basePackage}.${table.moduleName}.service.${table.businessName}; | @@ -3,7 +3,7 @@ package ${basePackage}.${table.moduleName}.service.${table.businessName}; | ||
| 3 | import java.util.*; | 3 | import java.util.*; |
| 4 | import javax.validation.*; | 4 | import javax.validation.*; |
| 5 | import ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo.*; | 5 | import ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo.*; |
| 6 | -import ${basePackage}.${table.moduleName}.dal.mysql.dataobject.${table.businessName}.${table.className}DO; | 6 | +import ${basePackage}.${table.moduleName}.dal.dataobject.${table.businessName}.${table.className}DO; |
| 7 | import ${PageResultClassName}; | 7 | import ${PageResultClassName}; |
| 8 | 8 | ||
| 9 | /** | 9 | /** |
src/main/resources/codegen/service/serviceImpl.vm
| @@ -7,11 +7,11 @@ import org.springframework.validation.annotation.Validated; | @@ -7,11 +7,11 @@ import org.springframework.validation.annotation.Validated; | ||
| 7 | 7 | ||
| 8 | import java.util.*; | 8 | import java.util.*; |
| 9 | import ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo.*; | 9 | import ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo.*; |
| 10 | -import ${basePackage}.${table.moduleName}.dal.mysql.dataobject.${table.businessName}.${table.className}DO; | 10 | +import ${basePackage}.${table.moduleName}.dal.dataobject.${table.businessName}.${table.className}DO; |
| 11 | import ${PageResultClassName}; | 11 | import ${PageResultClassName}; |
| 12 | 12 | ||
| 13 | import ${basePackage}.${table.moduleName}.convert.${table.businessName}.${table.className}Convert; | 13 | import ${basePackage}.${table.moduleName}.convert.${table.businessName}.${table.className}Convert; |
| 14 | -import ${basePackage}.${table.moduleName}.dal.mysql.dao.${table.businessName}.${table.className}Mapper; | 14 | +import ${basePackage}.${table.moduleName}.dal.mysql.${table.businessName}.${table.className}Mapper; |
| 15 | import ${basePackage}.${table.moduleName}.service.${table.businessName}.${table.className}Service; | 15 | import ${basePackage}.${table.moduleName}.service.${table.businessName}.${table.className}Service; |
| 16 | 16 | ||
| 17 | import ${ServiceExceptionUtilClassName}; | 17 | import ${ServiceExceptionUtilClassName}; |
src/test/java/cn/iocoder/dashboard/modules/tool/service/codegen/impl/ToolCodegenServiceImplTest.java
| @@ -6,8 +6,6 @@ import org.springframework.boot.test.context.SpringBootTest; | @@ -6,8 +6,6 @@ import org.springframework.boot.test.context.SpringBootTest; | ||
| 6 | 6 | ||
| 7 | import javax.annotation.Resource; | 7 | import javax.annotation.Resource; |
| 8 | 8 | ||
| 9 | -import static org.junit.jupiter.api.Assertions.*; | ||
| 10 | - | ||
| 11 | @SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) | 9 | @SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) |
| 12 | class ToolCodegenServiceImplTest { | 10 | class ToolCodegenServiceImplTest { |
| 13 | 11 | ||
| @@ -18,7 +16,7 @@ class ToolCodegenServiceImplTest { | @@ -18,7 +16,7 @@ class ToolCodegenServiceImplTest { | ||
| 18 | public void tetCreateCodegenTable() { | 16 | public void tetCreateCodegenTable() { |
| 19 | // toolCodegenService.createCodegenTable("sys_test_demo"); | 17 | // toolCodegenService.createCodegenTable("sys_test_demo"); |
| 20 | // toolCodegenService.createCodegenTable("tool_codegen_table"); | 18 | // toolCodegenService.createCodegenTable("tool_codegen_table"); |
| 21 | - toolCodegenService.createCodegenTable("tool_codegen_column"); | 19 | + toolCodegenService.createCodegen("tool_codegen_column"); |
| 22 | } | 20 | } |
| 23 | 21 | ||
| 24 | } | 22 | } |