mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-10-26 20:57:11 +08:00
feat: 新增保存代码生成配置信息接口
This commit is contained in:
@@ -25,10 +25,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import top.charles7c.cnadmin.common.model.query.PageQuery;
|
||||
import top.charles7c.cnadmin.common.model.vo.PageDataVO;
|
||||
@@ -36,6 +33,7 @@ import top.charles7c.cnadmin.common.model.vo.R;
|
||||
import top.charles7c.cnadmin.tool.model.entity.ColumnMappingDO;
|
||||
import top.charles7c.cnadmin.tool.model.entity.GenConfigDO;
|
||||
import top.charles7c.cnadmin.tool.model.query.TableQuery;
|
||||
import top.charles7c.cnadmin.tool.model.request.GenConfigRequest;
|
||||
import top.charles7c.cnadmin.tool.model.vo.TableVO;
|
||||
import top.charles7c.cnadmin.tool.service.GeneratorService;
|
||||
|
||||
@@ -71,4 +69,11 @@ public class GeneratorController {
|
||||
public R<List<ColumnMappingDO>> listColumnMapping(@PathVariable String tableName) {
|
||||
return R.ok(generatorService.listColumnMapping(tableName));
|
||||
}
|
||||
|
||||
@Operation(summary = "保存配置信息", description = "保存配置信息")
|
||||
@PostMapping("/table/{tableName}")
|
||||
public R saveConfig(@Validated @RequestBody GenConfigRequest request, @PathVariable String tableName) {
|
||||
generatorService.saveConfig(request, tableName);
|
||||
return R.ok("保存成功");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,30 +2,26 @@
|
||||
|
||||
-- changeset Charles7c:1
|
||||
CREATE TABLE IF NOT EXISTS `gen_config` (
|
||||
`id` bigint(20) UNSIGNED AUTO_INCREMENT COMMENT 'ID',
|
||||
`table_name` varchar(100) NOT NULL COMMENT '表名称',
|
||||
`table_name` varchar(100) COMMENT '表名称',
|
||||
`module_name` varchar(50) NOT NULL COMMENT '模块名称',
|
||||
`package_name` varchar(50) NOT NULL COMMENT '包名称',
|
||||
`frontend_path` varchar(255) NOT NULL COMMENT '前端路径',
|
||||
`frontend_path` varchar(255) DEFAULT NULL COMMENT '前端路径',
|
||||
`business_name` varchar(50) NOT NULL COMMENT '业务名称',
|
||||
`author` varchar(100) NOT NULL COMMENT '作者',
|
||||
`table_prefix` varchar(20) DEFAULT NULL COMMENT '表前缀',
|
||||
`is_override` bit(1) DEFAULT b'0' COMMENT '是否覆盖',
|
||||
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE INDEX `uk_table_name`(`table_name`) USING BTREE
|
||||
PRIMARY KEY (`table_name`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='生成配置表';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `gen_column_mapping` (
|
||||
`id` bigint(20) UNSIGNED AUTO_INCREMENT COMMENT 'ID',
|
||||
`table_name` varchar(100) NOT NULL COMMENT '表名称',
|
||||
`column_name` varchar(50) NOT NULL COMMENT '列名称',
|
||||
`column_type` varchar(25) NOT NULL COMMENT '列类型',
|
||||
`field_name` varchar(50) NOT NULL COMMENT '字段名称',
|
||||
`field_type` varchar(25) NOT NULL COMMENT '字段类型',
|
||||
`comment` varchar(512) DEFAULT NULL COMMENT '注释',
|
||||
`sort` int(11) UNSIGNED DEFAULT 999 COMMENT '排序',
|
||||
`is_required` bit(1) DEFAULT b'1' COMMENT '是否必填',
|
||||
`show_in_list` bit(1) DEFAULT b'1' COMMENT '是否在列表中显示',
|
||||
`show_in_form` bit(1) DEFAULT b'1' COMMENT '是否在表单中显示',
|
||||
@@ -33,7 +29,5 @@ CREATE TABLE IF NOT EXISTS `gen_column_mapping` (
|
||||
`form_type` tinyint(1) UNSIGNED DEFAULT NULL COMMENT '表单类型',
|
||||
`query_type` tinyint(1) UNSIGNED DEFAULT NULL COMMENT '查询方式',
|
||||
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL COMMENT '修改时间',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
INDEX `idx_table_name`(`table_name`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='列映射表';
|
||||
Reference in New Issue
Block a user