feat(generator): 代码生成字段配置支持选择关联字典

暂时仅支持前端部分生成

Closes #I9SWQB
Closes #55
This commit is contained in:
2024-08-27 00:01:57 +08:00
parent e17d5db0fb
commit fdd21a01c1
17 changed files with 143 additions and 93 deletions

View File

@@ -32,7 +32,9 @@ import top.continew.admin.generator.model.req.GenConfigReq;
import top.continew.admin.generator.model.resp.GeneratePreviewResp;
import top.continew.admin.generator.model.resp.TableResp;
import top.continew.admin.generator.service.GeneratorService;
import top.continew.admin.system.service.DictService;
import top.continew.starter.extension.crud.model.query.PageQuery;
import top.continew.starter.extension.crud.model.resp.LabelValueResp;
import top.continew.starter.extension.crud.model.resp.PageResp;
import java.sql.SQLException;
@@ -52,6 +54,7 @@ import java.util.List;
public class GeneratorController {
private final GeneratorService baseService;
private final DictService dictService;
@Operation(summary = "分页查询数据表", description = "分页查询数据表")
@SaCheckPermission("tool:generator:list")
@@ -101,4 +104,13 @@ public class GeneratorController {
public void generate(@PathVariable List<String> tableNames, HttpServletResponse response) {
baseService.generate(tableNames, response);
}
@Operation(summary = "查询字典", description = "查询字典列表")
@SaCheckPermission("tool:generator:list")
@GetMapping("/dict")
public List<LabelValueResp> listDict() {
List<LabelValueResp> dictList = dictService.listDict(null, null);
dictList.addAll(dictService.listEnumDict());
return dictList;
}
}

View File

@@ -1,2 +1,4 @@
-- liquibase formatted sql
-- changeset Charles7c:3.3-1
ALTER TABLE `gen_field_config` ADD COLUMN `dict_code` varchar(30) DEFAULT NULL COMMENT '字典编码' AFTER `query_type`;

View File

@@ -1,2 +1,5 @@
-- liquibase formatted sql
-- changeset Charles7c:3.3-1
ALTER TABLE "gen_field_config" ADD COLUMN `dict_code` varchar(30) DEFAULT NULL COMMENT '字典编码' AFTER `query_type`;
COMMENT ON COLUMN "gen_field_config"."dict_code" IS '字典编码';