|
|
|
@ -20,7 +20,7 @@ import com.ruoyi.generator.domain.TableInfo;
|
|
|
|
|
public class GenUtils
|
|
|
|
|
{
|
|
|
|
|
/** 项目空间路径 */
|
|
|
|
|
private static final String PROJECT_PATH = "main/java/com/ruoyi";
|
|
|
|
|
private static final String PROJECT_PATH = getProjectPath();
|
|
|
|
|
|
|
|
|
|
/** mybatis空间路径 */
|
|
|
|
|
private static final String MYBATIS_PATH = "main/resources/mapper";
|
|
|
|
@ -124,7 +124,7 @@ public class GenUtils
|
|
|
|
|
String classname = table.getClassname();
|
|
|
|
|
// 大写类名
|
|
|
|
|
String className = table.getClassName();
|
|
|
|
|
String javaPath = PROJECT_PATH + "/" + moduleName + "/";
|
|
|
|
|
String javaPath = PROJECT_PATH;
|
|
|
|
|
String mybatisPath = MYBATIS_PATH + "/" + moduleName + "/" + className;
|
|
|
|
|
String htmlPath = TEMPLATES_PATH + "/" + moduleName + "/" + classname;
|
|
|
|
|
|
|
|
|
@ -198,6 +198,16 @@ public class GenUtils
|
|
|
|
|
return basePackage;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String getProjectPath()
|
|
|
|
|
{
|
|
|
|
|
String packageName = Global.getPackageName();
|
|
|
|
|
StringBuffer projectPath = new StringBuffer();
|
|
|
|
|
projectPath.append("main/java/");
|
|
|
|
|
projectPath.append(packageName.replace(".", "/"));
|
|
|
|
|
projectPath.append("/");
|
|
|
|
|
return projectPath.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String replaceKeyword(String keyword)
|
|
|
|
|
{
|
|
|
|
|
String keyName = keyword.replaceAll("(?:表|信息)", "");
|
|
|
|
@ -227,11 +237,4 @@ public class GenUtils
|
|
|
|
|
javaTypeMap.put("datetime", "Date");
|
|
|
|
|
javaTypeMap.put("timestamp", "Date");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args)
|
|
|
|
|
{
|
|
|
|
|
System.out.println(StringUtils.convertToCamelCase("user_name"));
|
|
|
|
|
System.out.println(replaceKeyword("岗位信息表"));
|
|
|
|
|
System.out.println(getBasePackage("com.ruoyi.system"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|