mirror of
				https://github.com/continew-org/continew-admin.git
				synced 2025-10-31 10:57:13 +08:00 
			
		
		
		
	refactor: 优化代码生成配置相关表名、 API 地址及相关描述
1、列映射表重命名为字段配置表
This commit is contained in:
		| @@ -30,7 +30,7 @@ import org.springframework.web.bind.annotation.*; | ||||
| import top.charles7c.cnadmin.common.model.query.PageQuery; | ||||
| import top.charles7c.cnadmin.common.model.vo.PageDataVO; | ||||
| import top.charles7c.cnadmin.common.model.vo.R; | ||||
| import top.charles7c.cnadmin.tool.model.entity.ColumnMappingDO; | ||||
| import top.charles7c.cnadmin.tool.model.entity.FieldConfigDO; | ||||
| import top.charles7c.cnadmin.tool.model.entity.GenConfigDO; | ||||
| import top.charles7c.cnadmin.tool.model.query.TableQuery; | ||||
| import top.charles7c.cnadmin.tool.model.request.GenConfigRequest; | ||||
| @@ -58,21 +58,21 @@ public class GeneratorController { | ||||
|         return R.ok(generatorService.pageTable(query, pageQuery)); | ||||
|     } | ||||
|  | ||||
|     @Operation(summary = "查询字段配置列表", description = "查询字段配置列表") | ||||
|     @GetMapping("/field/{tableName}") | ||||
|     public R<List<FieldConfigDO>> listFieldConfig(@PathVariable String tableName, | ||||
|         @RequestParam(required = false, defaultValue = "false") Boolean requireSync) { | ||||
|         return R.ok(generatorService.listFieldConfig(tableName, requireSync)); | ||||
|     } | ||||
|  | ||||
|     @Operation(summary = "查询生成配置信息", description = "查询生成配置信息") | ||||
|     @GetMapping("/table/{tableName}") | ||||
|     @GetMapping("/config/{tableName}") | ||||
|     public R<GenConfigDO> getGenConfig(@PathVariable String tableName) throws SQLException { | ||||
|         return R.ok(generatorService.getGenConfig(tableName)); | ||||
|     } | ||||
|  | ||||
|     @Operation(summary = "查询列映射信息列表", description = "查询列映射信息列表") | ||||
|     @GetMapping("/column/{tableName}") | ||||
|     public R<List<ColumnMappingDO>> listColumnMapping(@PathVariable String tableName, | ||||
|         @RequestParam(required = false, defaultValue = "false") Boolean requireSync) { | ||||
|         return R.ok(generatorService.listColumnMapping(tableName, requireSync)); | ||||
|     } | ||||
|  | ||||
|     @Operation(summary = "保存配置信息", description = "保存配置信息") | ||||
|     @PostMapping("/table/{tableName}") | ||||
|     @PostMapping("/config/{tableName}") | ||||
|     public R saveConfig(@Validated @RequestBody GenConfigRequest request, @PathVariable String tableName) { | ||||
|         generatorService.saveConfig(request, tableName); | ||||
|         return R.ok("保存成功"); | ||||
|   | ||||
| @@ -52,7 +52,7 @@ generator: | ||||
|     - DATABASECHANGELOG | ||||
|     - DATABASECHANGELOGLOCK | ||||
|     - gen_config | ||||
|     - gen_column_mapping | ||||
|     - gen_field_config | ||||
|  | ||||
| --- ### 接口文档配置 | ||||
| springdoc: | ||||
|   | ||||
| @@ -15,7 +15,7 @@ CREATE TABLE IF NOT EXISTS `gen_config` ( | ||||
|     PRIMARY KEY (`table_name`) USING BTREE | ||||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='生成配置表'; | ||||
|  | ||||
| CREATE TABLE IF NOT EXISTS `gen_column_mapping` ( | ||||
| CREATE TABLE IF NOT EXISTS `gen_field_config` ( | ||||
|     `table_name` varchar(64) NOT NULL COMMENT '表名称', | ||||
|     `column_name` varchar(64) NOT NULL COMMENT '列名称', | ||||
|     `column_type` varchar(25) NOT NULL COMMENT '列类型', | ||||
| @@ -30,4 +30,4 @@ CREATE TABLE IF NOT EXISTS `gen_column_mapping` ( | ||||
|     `query_type` tinyint(1) UNSIGNED DEFAULT NULL COMMENT '查询方式', | ||||
|     `create_time` datetime NOT NULL COMMENT '创建时间', | ||||
|     INDEX `idx_table_name`(`table_name`) USING BTREE | ||||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='列映射表'; | ||||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='字段配置表'; | ||||
		Reference in New Issue
	
	Block a user