|
|
|
@ -98,6 +98,10 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
System.out.println("生成模块:action");
|
|
|
|
|
generateController(new File(src.getAbsolutePath(), "action"), project, dataBase, option);
|
|
|
|
|
|
|
|
|
|
//生成Config
|
|
|
|
|
System.out.println("生成模块:config");
|
|
|
|
|
generateConfig(new File(src.getAbsolutePath(), "config"), project, dataBase, option);
|
|
|
|
|
|
|
|
|
|
//module
|
|
|
|
|
{
|
|
|
|
|
for (Module module : project.getModules()) {
|
|
|
|
@ -123,9 +127,9 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//framework
|
|
|
|
|
System.out.println("生成模块:framework");
|
|
|
|
|
generateFramework(new File(src.getAbsolutePath(), "framework"), project, dataBase, option);
|
|
|
|
|
//frame
|
|
|
|
|
System.out.println("生成模块:frame");
|
|
|
|
|
generateFrame(new File(src.getAbsolutePath(), "frame"), project, dataBase, option);
|
|
|
|
|
|
|
|
|
|
System.out.println("生成模块:Application");
|
|
|
|
|
generateApplication(new File(src.getAbsolutePath()), project, dataBase, option);
|
|
|
|
@ -203,6 +207,24 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
|
|
|
|
|
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), "AjaxController.java"), option + "/java/action/AjaxController.ftl", ctx);
|
|
|
|
|
}
|
|
|
|
|
public void generateConfig(File root, Project project, DataBase dataBase, String option) {
|
|
|
|
|
if (!root.exists()) {
|
|
|
|
|
root.mkdirs();
|
|
|
|
|
} else {
|
|
|
|
|
clear(root);
|
|
|
|
|
}
|
|
|
|
|
HashMap<String, Object> ctx = new HashMap<String, Object>();
|
|
|
|
|
ctx.put("basePackage", project.getProjectBasePackage());
|
|
|
|
|
ctx.put("author", project.getProjectAuthor());
|
|
|
|
|
ctx.put("date", new Date());
|
|
|
|
|
|
|
|
|
|
//config
|
|
|
|
|
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), "BeanDefinitionRegistryConfig.java"), option + "/java/config/BeanDefinitionRegistryConfig.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), "SecurityConfig.java"), option + "/java/config/SecurityConfig.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), "TaskConfig.java"), option + "/java/config/TaskConfig.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), "ThreadPoolConfig.java"), option + "/java/config/ThreadPoolConfig.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), "WebMvcConfig.java"), option + "/java/config/WebMvcConfig.java", ctx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生成entity
|
|
|
|
@ -418,12 +440,12 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生成framework类
|
|
|
|
|
* 生成frame类
|
|
|
|
|
*
|
|
|
|
|
* @param root
|
|
|
|
|
* @param project
|
|
|
|
|
*/
|
|
|
|
|
public void generateFramework(File root, Project project, DataBase dataBase, String option) {
|
|
|
|
|
public void generateFrame(File root, Project project, DataBase dataBase, String option) {
|
|
|
|
|
if (!root.exists()) {
|
|
|
|
|
root.mkdirs();
|
|
|
|
|
} else {
|
|
|
|
@ -436,8 +458,6 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
|
|
|
|
|
File base = new File(root.getAbsolutePath(), "base");
|
|
|
|
|
base.mkdirs();
|
|
|
|
|
File config = new File(root.getAbsolutePath(), "config");
|
|
|
|
|
config.mkdirs();
|
|
|
|
|
File freemarker = new File(root.getAbsolutePath(), "freemarker");
|
|
|
|
|
freemarker.mkdirs();
|
|
|
|
|
File springmvc = new File(root.getAbsolutePath(), "springmvc");
|
|
|
|
@ -446,51 +466,44 @@ public class SpringBootCallable implements Callable {
|
|
|
|
|
utils.mkdirs();
|
|
|
|
|
|
|
|
|
|
//base
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "BaseEntity.java"), option + "/java/framework/base/BaseEntity.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "BaseFindRequest.java"), option + "/java/framework/base/BaseFindRequest.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "BaseFindResponse.java"), option + "/java/framework/base/BaseFindResponse.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "BaseGetAllRequest.java"), option + "/java/framework/base/BaseGetAllRequest.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "BaseRequest.java"), option + "/java/framework/base/BaseRequest.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "BaseResponse.java"), option + "/java/framework/base/BaseResponse.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "BaseSearchRequest.java"), option + "/java/framework/base/BaseSearchRequest.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "BaseUpdateRequest.java"), option + "/java/framework/base/BaseUpdateRequest.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "Control.java"), option + "/java/framework/base/Control.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "Error.java"), option + "/java/framework/base/Error.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "ErrorType.java"), option + "/java/framework/base/ErrorType.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "FileUploadResponse.java"), option + "/java/framework/base/FileUploadResponse.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "Screen.java"), option + "/java/framework/base/Screen.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "SortType.java"), option + "/java/framework/base/SortType.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "Token.java"), option + "/java/framework/base/Token.java", ctx);
|
|
|
|
|
|
|
|
|
|
//config
|
|
|
|
|
freeMarkerManager.outputTemp(new File(config.getAbsolutePath(), "BeanDefinitionRegistryConfig.java"), option + "/java/framework/config/BeanDefinitionRegistryConfig.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(config.getAbsolutePath(), "SecurityConfig.java"), option + "/java/framework/config/SecurityConfig.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(config.getAbsolutePath(), "TaskConfig.java"), option + "/java/framework/config/TaskConfig.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(config.getAbsolutePath(), "ThreadPoolConfig.java"), option + "/java/framework/config/ThreadPoolConfig.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(config.getAbsolutePath(), "WebMvcConfig.java"), option + "/java/framework/config/WebMvcConfig.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "BaseEntity.java"), option + "/java/frame/base/BaseEntity.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "BaseFindRequest.java"), option + "/java/frame/base/BaseFindRequest.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "BaseFindResponse.java"), option + "/java/frame/base/BaseFindResponse.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "BaseGetAllRequest.java"), option + "/java/frame/base/BaseGetAllRequest.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "BaseRequest.java"), option + "/java/frame/base/BaseRequest.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "BaseResponse.java"), option + "/java/frame/base/BaseResponse.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "BaseSearchRequest.java"), option + "/java/frame/base/BaseSearchRequest.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "BaseUpdateRequest.java"), option + "/java/frame/base/BaseUpdateRequest.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "Control.java"), option + "/java/frame/base/Control.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "Error.java"), option + "/java/frame/base/Error.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "ErrorType.java"), option + "/java/frame/base/ErrorType.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "FileUploadResponse.java"), option + "/java/frame/base/FileUploadResponse.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "Screen.java"), option + "/java/frame/base/Screen.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "SortType.java"), option + "/java/frame/base/SortType.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(base.getAbsolutePath(), "Token.java"), option + "/java/frame/base/Token.java", ctx);
|
|
|
|
|
|
|
|
|
|
//freemarker
|
|
|
|
|
freeMarkerManager.outputTemp(new File(freemarker.getAbsolutePath(), "ViewNameTranslator.java"), option + "/java/framework/freemarker/ViewNameTranslator.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(freemarker.getAbsolutePath(), "Layout.java"), option + "/java/framework/freemarker/Layout.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(freemarker.getAbsolutePath(), "Uri.java"), option + "/java/framework/freemarker/Uri.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(freemarker.getAbsolutePath(), "ViewNameTranslator.java"), option + "/java/frame/freemarker/ViewNameTranslator.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(freemarker.getAbsolutePath(), "Layout.java"), option + "/java/frame/freemarker/Layout.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(freemarker.getAbsolutePath(), "Uri.java"), option + "/java/frame/freemarker/Uri.java", ctx);
|
|
|
|
|
|
|
|
|
|
//springmvc
|
|
|
|
|
freeMarkerManager.outputTemp(new File(springmvc.getAbsolutePath(), "GlobalHandlerInterceptor.java"), option + "/java/framework/springmvc/GlobalHandlerInterceptor.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(springmvc.getAbsolutePath(), "GlobalHandlerInterceptor.java"), option + "/java/frame/springmvc/GlobalHandlerInterceptor.java", ctx);
|
|
|
|
|
|
|
|
|
|
//uitls
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "Base64Util.java"), option + "/java/framework/utils/Base64Util.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "AESUtil.java"), option + "/java/framework/utils/AESUtil.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "CookieUtil.java"), option + "/java/framework/utils/CookieUtil.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "LogUtil.java"), option + "/java/framework/utils/LogUtil.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "MapperUtil.java"), option + "/java/framework/utils/MapperUtil.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "MD5Util.java"), option + "/java/framework/utils/MD5Util.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "ProcessUtil.java"), option + "/java/framework/utils/ProcessUtil.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "RSAUtil.java"), option + "/java/framework/utils/RSAUtil.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "ValidationUtil.java"), option + "/java/framework/utils/ValidationUtil.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "WebUtils.java"), option + "/java/framework/utils/WebUtils.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "LocalData.java"), option + "/java/framework/utils/LocalData.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "IDgenerator.java"), option + "/java/framework/utils/IDgenerator.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "Message.java"), option + "/java/framework/utils/Message.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "Base64Util.java"), option + "/java/frame/utils/Base64Util.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "AESUtil.java"), option + "/java/frame/utils/AESUtil.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "CookieUtil.java"), option + "/java/frame/utils/CookieUtil.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "LogUtil.java"), option + "/java/frame/utils/LogUtil.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "MapperUtil.java"), option + "/java/frame/utils/MapperUtil.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "MD5Util.java"), option + "/java/frame/utils/MD5Util.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "ProcessUtil.java"), option + "/java/frame/utils/ProcessUtil.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "RSAUtil.java"), option + "/java/frame/utils/RSAUtil.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "ValidationUtil.java"), option + "/java/frame/utils/ValidationUtil.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "WebUtils.java"), option + "/java/frame/utils/WebUtils.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "LocalData.java"), option + "/java/frame/utils/LocalData.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "IDgenerator.java"), option + "/java/frame/utils/IDgenerator.java", ctx);
|
|
|
|
|
freeMarkerManager.outputTemp(new File(utils.getAbsolutePath(), "Message.java"), option + "/java/frame/utils/Message.java", ctx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|