From 7ec50da49bb5a42420809b4a60fbc408de326f8f Mon Sep 17 00:00:00 2001 From: xlsea Date: Sun, 8 Sep 2024 21:49:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E6=88=90=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=94=9F=E6=88=90=E6=A8=A1=E6=9D=BF(1.0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/java/VelocityUtils.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/java/VelocityUtils.java b/docs/java/VelocityUtils.java index fb3aee36..b472a192 100644 --- a/docs/java/VelocityUtils.java +++ b/docs/java/VelocityUtils.java @@ -26,7 +26,7 @@ velocityContext.put("pkColumn", genTable.getPkColumn()); velocityContext.put("importList", getImportList(genTable)); velocityContext.put("permissionPrefix", getPermissionPrefix(moduleName, businessName)); - velocityContext.put("columns", genTable.getColumns()); + velocityContext.put("columns", getColumns(genTable)); velocityContext.put("table", genTable); velocityContext.put("dicts", getDicts(genTable)); velocityContext.put("dictList", getDictList(genTable)); @@ -170,3 +170,19 @@ } } } + + /** + * 根据列类型获取字典组 + * + * @param genTable 业务表对象 + * @return 返回字典组 + */ + public static List getColumns(GenTable genTable) { + List columns = genTable.getColumns(); + for (GenTableColumn column : columns) { + if (StringUtils.isNotBlank(column.getDictType())) { + column.setDictType(StringUtils.toCamelCase(column.getDictType())); + } + } + return columns; + }