mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-16 05:13:41 +00:00
feat: 更新代码生成功能-优化逻辑
This commit is contained in:
@@ -256,15 +256,6 @@ public class GenTableServiceImpl implements IGenTableService {
|
|||||||
|
|
||||||
// 添加readConverterExp方法
|
// 添加readConverterExp方法
|
||||||
column.put("readConverterExp", new Object() {
|
column.put("readConverterExp", new Object() {
|
||||||
public String readConverterExp() {
|
|
||||||
// 从字段注释中提取转换表达式
|
|
||||||
String comment = field.getName();
|
|
||||||
if (StrUtil.isNotBlank(comment) && comment.contains("(") && comment.contains(")")) {
|
|
||||||
String exp = comment.substring(comment.indexOf("(") + 1, comment.indexOf(")"));
|
|
||||||
return exp.replace(",", ",").replace(" ", "");
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 根据Java类型添加相应的导入
|
// 根据Java类型添加相应的导入
|
||||||
@@ -357,7 +348,7 @@ public class GenTableServiceImpl implements IGenTableService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String className = toCamelCase(baseClassName, true); // 首字母大写,如:SysRole
|
String className = toCamelCase(baseClassName, true); // 首字母大写,如:SysRole
|
||||||
String classname = toCamelCase(baseClassName, false); // 首字母小写,如:sysRole
|
// 首字母小写,如:sysRole
|
||||||
String moduleName = getModuleName(packageName);
|
String moduleName = getModuleName(packageName);
|
||||||
String javaPath = "src/main/java/";
|
String javaPath = "src/main/java/";
|
||||||
String mybatisPath = "src/main/resources/mapper/";
|
String mybatisPath = "src/main/resources/mapper/";
|
||||||
|
|||||||
Reference in New Issue
Block a user