服务和WEB隔离

Former-commit-id: ed59e3231df63da935f05316aa0fd29174892944
master
王兵 4 years ago
parent b1bfb38593
commit e75fa146a2

@ -471,22 +471,22 @@ public class JavaFxApplication extends Application {
}
{// 初始化项目面板
detailProjectController.getProjectName().textProperty().addListener(new ChangeListener<String>() {
detailProjectController.getName().textProperty().addListener(new ChangeListener<String>() {
@Override
public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
currentProject.setProjectName(newValue);
currentProject.setName(newValue);
}
});
detailProjectController.getProjectBasePackage().textProperty().addListener(new ChangeListener<String>() {
detailProjectController.getDomain().textProperty().addListener(new ChangeListener<String>() {
@Override
public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
currentProject.setProjectBasePackage(newValue);
currentProject.setDomain(newValue);
}
});
detailProjectController.getProjectAuthor().textProperty().addListener(new ChangeListener<String>() {
detailProjectController.getAuthor().textProperty().addListener(new ChangeListener<String>() {
@Override
public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
currentProject.setProjectAuthor(newValue);
currentProject.setAuthor(newValue);
}
});
detailProjectController.getDatabase().selectedToggleProperty().addListener(new ChangeListener<Toggle>() {
@ -640,7 +640,7 @@ public class JavaFxApplication extends Application {
public void loadProjectTree() {
currentProject = projectManager.getProject();
currentProject.setValue(currentProject.getProjectName());
currentProject.setValue(currentProject.getName());
currentProject.setExpanded(true);
mTree.setRoot(currentProject);
@ -695,9 +695,9 @@ public class JavaFxApplication extends Application {
*/
public void loadProject() {
GridPane gridPane = mProjectLoader.getRoot();
detailProjectController.getProjectName().setText(currentProject.getProjectName());
detailProjectController.getProjectBasePackage().setText(currentProject.getProjectBasePackage());
detailProjectController.getProjectAuthor().setText(currentProject.getProjectAuthor());
detailProjectController.getName().setText(currentProject.getName());
detailProjectController.getDomain().setText(currentProject.getDomain());
detailProjectController.getAuthor().setText(currentProject.getAuthor());
ObservableList<Toggle> toggles = detailProjectController.getDatabase().getToggles();
for (Toggle tog : toggles) {
RadioButton radioButton = (RadioButton) tog;
@ -1252,7 +1252,7 @@ public class JavaFxApplication extends Application {
switch (level) {
case 0: {//编辑项目名称
projectManager.getProject().setProjectName((String) event.getNewValue());
projectManager.getProject().setName((String) event.getNewValue());
loadProject();
}
break;

@ -8,11 +8,11 @@ import javafx.scene.control.ToggleGroup;
public class DetailProjectController {
@FXML
private TextField projectName;
private TextField name;
@FXML
private TextField projectBasePackage;
private TextField domain;
@FXML
private TextField projectAuthor;
private TextField author;
@FXML
private ToggleGroup frame;
@FXML
@ -26,28 +26,28 @@ public class DetailProjectController {
@FXML
private CheckBox needMail;
public TextField getProjectName() {
return projectName;
public TextField getName() {
return name;
}
public void setProjectName(TextField projectName) {
this.projectName = projectName;
public void setName(TextField name) {
this.name = name;
}
public TextField getProjectBasePackage() {
return projectBasePackage;
public TextField getDomain() {
return domain;
}
public void setProjectBasePackage(TextField projectBasePackage) {
this.projectBasePackage = projectBasePackage;
public void setDomain(TextField domain) {
this.domain = domain;
}
public TextField getProjectAuthor() {
return projectAuthor;
public TextField getAuthor() {
return author;
}
public void setProjectAuthor(TextField projectAuthor) {
this.projectAuthor = projectAuthor;
public void setAuthor(TextField author) {
this.author = author;
}
public ToggleGroup getDatabase() {

@ -279,22 +279,22 @@ public class ProjectManager {
}
public boolean doCheck() {
if (project.getProjectName() == null || "".equals(project.getProjectName())) {
if (project.getName() == null || "".equals(project.getName())) {
Dialog.showConfirmDialog("没有填写项目名!");
return false;
} else if (project.getProjectBasePackage() == null || "".equals(project.getProjectBasePackage())) {
} else if (project.getDomain() == null || "".equals(project.getDomain())) {
Dialog.showConfirmDialog("没有填写基本域名!");
return false;
} else if (project.getProjectAuthor() == null || "".equals(project.getProjectAuthor())) {
} else if (project.getAuthor() == null || "".equals(project.getAuthor())) {
Dialog.showConfirmDialog("没有填写作者!");
return false;
}
for (Module md : project.getModules()) {
if (md.getModuleName() == null || "".equals(md.getModuleName())) {
Dialog.showConfirmDialog("项目" + project.getProjectName() + "没有填写模块名!");
Dialog.showConfirmDialog("项目" + project.getName() + "没有填写模块名!");
return false;
} else if (md.getModuleComment() == null || "".equals(md.getModuleComment())) {
Dialog.showConfirmDialog("项目" + project.getProjectName() + "没有模块注释!");
Dialog.showConfirmDialog("项目" + project.getName() + "没有模块注释!");
return false;
}
}
@ -315,7 +315,7 @@ public class ProjectManager {
}
public void delete() {
File file = new File(path, project.getProjectName() + ".xml");
File file = new File(path, project.getName() + ".xml");
if (file.exists()) {
file.delete();
}

@ -181,7 +181,7 @@ public class XmlManager {
if (!path.exists()) {
path.mkdirs();
}
File file = new File(path, project.getProjectName() + ".xml");
File file = new File(path, project.getName() + ".xml");
if (!file.exists()) {
file.createNewFile();
}

@ -53,7 +53,7 @@ public class SpringBootCallable implements Callable {
public Boolean call() throws Exception {
// 创建项目文件夹
File dir = Tool.createPath(root, project.getProjectName());
File dir = Tool.createPath(root, project.getName());
// 清空内容
Tool.clear(dir);
@ -63,13 +63,13 @@ public class SpringBootCallable implements Callable {
File resourcesDir = Tool.createPath(dir, "src", "main", "resources");
// 生成域名目录
File domainDir = javaDir;
for (String s : project.getProjectBasePackage().split("\\.")) {
for (String s : project.getDomain().split("\\.")) {
domainDir = Tool.createPath(domainDir, s);
}
// 生成单元测试java目录
File testJavaDir = Tool.createPath(dir, "src", "test", "java");
File testDomainDir = testJavaDir;
for (String s : project.getProjectBasePackage().split("\\.")) {
for (String s : project.getDomain().split("\\.")) {
testDomainDir = Tool.createPath(testDomainDir, s);
}
// 生成单元测试resources目录
@ -151,8 +151,8 @@ public class SpringBootCallable implements Callable {
*/
public void generatePom(File root, Project project) {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("projectName", project.getProjectName());
ctx.put("domain", project.getProjectBasePackage());
ctx.put("projectName", project.getName());
ctx.put("domain", project.getDomain());
ctx.put("dataBase", project.getDatabase().toString());
ctx.put("project", project);
freeMarkerManager.outputTemp(Tool.createFile(root, "pom.xml"), "SpringBoot/pom.ftl", ctx);
@ -168,8 +168,8 @@ public class SpringBootCallable implements Callable {
Tool.clear(root);
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("project", project);
ctx.put("domain", project.getProjectBasePackage());
ctx.put("author", project.getProjectAuthor());
ctx.put("domain", project.getDomain());
ctx.put("author", project.getAuthor());
ctx.put("modules", project.getModules());
if (project.getFrame().value() >= Frame..value()) {
@ -182,8 +182,8 @@ public class SpringBootCallable implements Callable {
{// ajax 属于web内容
File ajax = Tool.createPath(root, "ajax");
HashMap<String, Object> ctxss = new HashMap<String, Object>();
ctxss.put("domain", project.getProjectBasePackage());
ctxss.put("author", project.getProjectAuthor());
ctxss.put("domain", project.getDomain());
ctxss.put("author", project.getAuthor());
for (Module module : project.getModules()) {
File m = Tool.createPath(ajax, module.getModuleName());
@ -216,9 +216,9 @@ public class SpringBootCallable implements Callable {
for (Table table : module.getTables()) {
if (table.getApi()) {
HashMap<String, Object> ctxss = new HashMap<String, Object>();
ctxss.put("domain", project.getProjectBasePackage());
ctxss.put("domain", project.getDomain());
ctxss.put("module", module.getModuleName());
ctxss.put("author", project.getProjectAuthor());
ctxss.put("author", project.getAuthor());
ctxss.put("table", table);
freeMarkerManager.outputTemp(Tool.createFile(m, table.getCName() + "Api.java"), "SpringBoot/java/action/api/Api.java", ctxss);
}
@ -245,9 +245,9 @@ public class SpringBootCallable implements Callable {
}
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("project", project);
ctx.put("domain", project.getProjectBasePackage());
ctx.put("projectName", project.getProjectName());
ctx.put("author", project.getProjectAuthor());
ctx.put("domain", project.getDomain());
ctx.put("projectName", project.getName());
ctx.put("author", project.getAuthor());
//config
if (project.getFrame().value() >= Frame..value()) {
@ -285,8 +285,8 @@ public class SpringBootCallable implements Callable {
for (Module module : project.getModules()) {// 业务模块
ctx.put("project", project);
ctx.put("module", module);
ctx.put("domain", project.getProjectBasePackage());
ctx.put("author", project.getProjectAuthor());
ctx.put("domain", project.getDomain());
ctx.put("author", project.getAuthor());
ctx.put("moduleName", module.getModuleName());
ctx.put("dataBase", project.getDatabase().toString());
@ -297,9 +297,9 @@ public class SpringBootCallable implements Callable {
File rsp = Tool.createFile(Tool.createPath(root, module.getModuleName()), "rsp");
if (module.getNeedGenerate()) {
module.setProjectAuthor(project.getProjectAuthor());
module.setProjectBasePackage(project.getProjectBasePackage());
module.setProjectName(project.getProjectName());
module.setProjectAuthor(project.getAuthor());
module.setProjectBasePackage(project.getDomain());
module.setProjectName(project.getName());
for (Table table : module.getTables()) {
ctx.put("table", table);
@ -357,8 +357,8 @@ public class SpringBootCallable implements Callable {
public void generateModuleFor(File root, Project project) {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("project", project);
ctx.put("domain", project.getProjectBasePackage());
ctx.put("author", project.getProjectAuthor());
ctx.put("domain", project.getDomain());
ctx.put("author", project.getAuthor());
ctx.put("dataBase", project.getDatabase().toString());
File ent = Tool.createPath(root, "wsvr", "ent");
File mpr = Tool.createPath(root, "wsvr", "mpr");
@ -389,8 +389,8 @@ public class SpringBootCallable implements Callable {
public void generateModuleFor(File root, Project project) {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("project", project);
ctx.put("domain", project.getProjectBasePackage());
ctx.put("author", project.getProjectAuthor());
ctx.put("domain", project.getDomain());
ctx.put("author", project.getAuthor());
ctx.put("dataBase", project.getDatabase().toString());
File ent = Tool.createPath(root, "wsys", "ent");
File mpr = Tool.createPath(root, "wsys", "mpr");
@ -432,9 +432,9 @@ public class SpringBootCallable implements Callable {
public void generateModuleFor(File root, Project project) {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("project", project);
ctx.put("domain", project.getProjectBasePackage());
ctx.put("domain", project.getDomain());
ctx.put("moduleName", "wsys");
ctx.put("author", project.getProjectAuthor());
ctx.put("author", project.getAuthor());
ctx.put("dataBase", project.getDatabase().toString());
File ent = Tool.createPath(root, "wsys", "ent");
@ -485,8 +485,8 @@ public class SpringBootCallable implements Callable {
}
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("project", project);
ctx.put("domain", project.getProjectBasePackage());
ctx.put("moduleName", project.getProjectName());
ctx.put("domain", project.getDomain());
ctx.put("moduleName", project.getName());
ctx.put("timestamp", new Date().getTime());
//auth
@ -574,8 +574,8 @@ public class SpringBootCallable implements Callable {
Tool.clear(root);
}
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("domain", project.getProjectBasePackage());
ctx.put("moduleName", project.getProjectName());
ctx.put("domain", project.getDomain());
ctx.put("moduleName", project.getName());
//task
for (String name : ResourceUtil.getResourceFiles("/modules/SpringBoot/java/task/")) {
@ -594,7 +594,7 @@ public class SpringBootCallable implements Callable {
*/
public void generateApplication(File root, Project project) {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("domain", project.getProjectBasePackage());
ctx.put("domain", project.getDomain());
ctx.put("project", project);
freeMarkerManager.outputTemp(Tool.createFile(root, "Application.java"), "SpringBoot/java/Application.ftl", ctx);
}
@ -607,12 +607,12 @@ public class SpringBootCallable implements Callable {
*/
public void generateResources(File root, Project project) {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("domain", project.getProjectBasePackage());
ctx.put("domain", project.getDomain());
ctx.put("dataBase", project.getDatabase().toString());
ctx.put("author", project.getProjectAuthor());
ctx.put("author", project.getAuthor());
ctx.put("dBmapper", dBmapper);
ctx.put("author", project.getProjectAuthor());
ctx.put("projectName", project.getProjectName());
ctx.put("author", project.getAuthor());
ctx.put("projectName", project.getName());
ctx.put("project", project);
freeMarkerManager.outputTemp(Tool.createFile(root, "application.properties"), "SpringBoot/resources/application.ftl", ctx);
@ -669,7 +669,7 @@ public class SpringBootCallable implements Callable {
// }
if (DataBase.SQLite.name().equals(project.getDatabase().name())) {
File dbFile = Tool.createFile(root, project.getProjectName() + ".db3");
File dbFile = Tool.createFile(root, project.getName() + ".db3");
Connection connection = null;
Statement statement = null;
try {
@ -770,10 +770,10 @@ public class SpringBootCallable implements Callable {
public void generateTestResources(File root, Project project) {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("domain", project.getProjectBasePackage());
ctx.put("projectName", project.getProjectName());
ctx.put("domain", project.getDomain());
ctx.put("projectName", project.getName());
ctx.put("dataBase", project.getDatabase().toString());
ctx.put("author", project.getProjectAuthor());
ctx.put("author", project.getAuthor());
ctx.put("dBmapper", dBmapper);
ctx.put("project", project);
freeMarkerManager.outputTemp(Tool.createFile(root, "application.properties"), "SpringBoot/test/application.ftl", ctx);
@ -785,18 +785,18 @@ public class SpringBootCallable implements Callable {
File config = Tool.createPath(root, "config");
config.mkdirs();
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("domain", project.getProjectBasePackage());
ctx.put("moduleName", project.getProjectName());
ctx.put("author", project.getProjectAuthor());
ctx.put("domain", project.getDomain());
ctx.put("moduleName", project.getName());
ctx.put("author", project.getAuthor());
File file = Tool.createFile(config, "TestConfig" + ".java");
freeMarkerManager.outputTemp(file, "SpringBoot/test/TestConfig.ftl", ctx);
}
{
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("domain", project.getProjectBasePackage());
ctx.put("moduleName", project.getProjectName());
ctx.put("author", project.getProjectAuthor());
ctx.put("domain", project.getDomain());
ctx.put("moduleName", project.getName());
ctx.put("author", project.getAuthor());
File file = Tool.createFile(root, "UtilTest" + ".java");
freeMarkerManager.outputTemp(file, "SpringBoot/test/UtilTest.java", ctx);
}
@ -808,7 +808,7 @@ public class SpringBootCallable implements Callable {
for (Table table : md.getTables()) {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("domain", project.getProjectBasePackage());
ctx.put("domain", project.getDomain());
ctx.put("module", md);
ctx.put("moduleName", md.getModuleName());
ctx.put("table", table);
@ -823,9 +823,9 @@ public class SpringBootCallable implements Callable {
if (project.getFrame().value() >= Frame..value()) {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("domain", project.getProjectBasePackage());
ctx.put("moduleName", project.getProjectName());
ctx.put("author", project.getProjectAuthor());
ctx.put("domain", project.getDomain());
ctx.put("moduleName", project.getName());
ctx.put("author", project.getAuthor());
File wsvr = Tool.createPath(root, "wsvr");
for (String apiFile : ResourceUtil.getResourceFiles("/modules/SpringBoot/test/wsvr/")) {
@ -836,9 +836,9 @@ public class SpringBootCallable implements Callable {
if (project.getFrame().value() >= Frame..value()) {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("domain", project.getProjectBasePackage());
ctx.put("moduleName", project.getProjectName());
ctx.put("author", project.getProjectAuthor());
ctx.put("domain", project.getDomain());
ctx.put("moduleName", project.getName());
ctx.put("author", project.getAuthor());
File wsys = Tool.createPath(root, "wsys");
for (String apiFile : ResourceUtil.getResourceFiles("/modules/SpringBoot/test/wsys/")) {
@ -851,9 +851,9 @@ public class SpringBootCallable implements Callable {
if (project.getFrame().value() >= Frame..value()) {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("domain", project.getProjectBasePackage());
ctx.put("moduleName", project.getProjectName());
ctx.put("author", project.getProjectAuthor());
ctx.put("domain", project.getDomain());
ctx.put("moduleName", project.getName());
ctx.put("author", project.getAuthor());
File wsys = Tool.createPath(root, "wsys");
for (String apiFile : ResourceUtil.getResourceFiles("/modules/SpringBoot/test/wsys/")) {
@ -867,12 +867,12 @@ public class SpringBootCallable implements Callable {
if (project.getFrame().value() >= Frame..value()) {//数据初始化
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("project", project);
ctx.put("domain", project.getProjectBasePackage());
ctx.put("domain", project.getDomain());
freeMarkerManager.outputTemp(Tool.createFile(root, "DataInit.java"), "SpringBoot/test/DataInit.java", ctx);
}
if (project.getFrame().value() >= Frame..value()) {//数据初始化
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("domain", project.getProjectBasePackage());
ctx.put("domain", project.getDomain());
freeMarkerManager.outputTemp(Tool.createFile(root, "ExcelTest.java"), "SpringBoot/test/ExcelTest.java", ctx);
}
}

@ -50,14 +50,14 @@ public class SpringMVCCallable implements Callable {
public Boolean call() throws Exception {
File projectFile = new File(root + File.separator + this.project.getProjectName());
File projectFile = new File(root + File.separator + this.project.getName());
if (!projectFile.exists()) {
projectFile.mkdir();
} else {
Tool.clear(projectFile);
}
String domain = this.project.getProjectBasePackage();
String domain = this.project.getDomain();
String[] split = domain.split("\\.");
@ -69,7 +69,7 @@ public class SpringMVCCallable implements Callable {
for (String s : split) {
stringBuffer.append(File.separator).append(s);
}
stringBuffer.append(File.separator).append(this.project.getProjectName());
stringBuffer.append(File.separator).append(this.project.getName());
File src = new File(stringBuffer.toString());
if (!src.exists()) {
@ -170,8 +170,8 @@ public class SpringMVCCallable implements Callable {
public void generatePom(File root, Project project, DataBase dataBase, String option) {
try {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("domain", project.getProjectBasePackage());
ctx.put("moduleName", project.getProjectName());
ctx.put("domain", project.getDomain());
ctx.put("moduleName", project.getName());
freeMarkerManager.outputTemp(new File(root.getAbsolutePath() + File.separator + "pom.xml"), option + "/pom.ftl", ctx);
} catch (Exception e) {
@ -408,8 +408,8 @@ public class SpringMVCCallable implements Callable {
}
try {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("domain", project.getProjectBasePackage());
ctx.put("moduleName", project.getProjectName());
ctx.put("domain", project.getDomain());
ctx.put("moduleName", project.getName());
ctx.put("timestamp", new Date().getTime());
File base = new File(root.getAbsolutePath() + File.separator + "base");
@ -474,11 +474,11 @@ public class SpringMVCCallable implements Callable {
}
try {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("domain", project.getProjectBasePackage());
ctx.put("moduleName", project.getProjectName());
ctx.put("domain", project.getDomain());
ctx.put("moduleName", project.getName());
ctx.put("project", project);
ctx.put("modules", project.getModules());
ctx.put("author", project.getProjectAuthor());
ctx.put("author", project.getAuthor());
freeMarkerManager.outputTemp(new File(root.getAbsolutePath() + File.separator + "AjaxController.java"), option + "/java/controller/AjaxController.java", ctx);
freeMarkerManager.outputTemp(new File(root.getAbsolutePath() + File.separator + "GlobalController.java"), option + "/java/controller/GlobalController.java", ctx);
@ -498,8 +498,8 @@ public class SpringMVCCallable implements Callable {
try {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("domain", project.getProjectBasePackage());
ctx.put("moduleName", project.getProjectName());
ctx.put("domain", project.getDomain());
ctx.put("moduleName", project.getName());
if (root.getAbsolutePath().contains("test")) {
ctx.put("isTest", true);
} else {
@ -516,7 +516,7 @@ public class SpringMVCCallable implements Callable {
}
if (!root.getAbsolutePath().contains("test")) {
File tableDir = new File(root.getAbsolutePath() + File.separator + project.getProjectName() + "_table");
File tableDir = new File(root.getAbsolutePath() + File.separator + project.getName() + "_table");
tableDir.mkdirs();
File dbtool = new File(root.getAbsolutePath() + File.separator + "dbtool");
dbtool.mkdirs();
@ -530,9 +530,9 @@ public class SpringMVCCallable implements Callable {
ctx.put("tool", Tool.class);
ctx.put("dataBase", dataBase.toString());
ctx.put("project", project);
ctx.put("author", project.getProjectAuthor());
ctx.put("domain", project.getProjectBasePackage());
ctx.put("moduleName", project.getProjectName());
ctx.put("author", project.getAuthor());
ctx.put("domain", project.getDomain());
ctx.put("moduleName", project.getName());
ctx.put("dBmapper", dBmapper);
for (Module table : project.getModules()) {
@ -545,7 +545,7 @@ public class SpringMVCCallable implements Callable {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("tool", Tool.class);
ctx.put("dataBase", dataBase.toString());
ctx.put("domain", project.getProjectBasePackage());
ctx.put("domain", project.getDomain());
ctx.put("moduleName", project.getModules());
ctx.put("project", project);
ctx.put("dBmapper", dBmapper);
@ -555,13 +555,13 @@ public class SpringMVCCallable implements Callable {
}
public void generateTest(File root, Project project, DataBase dataBase, String option) {
File module = new File(root.getAbsolutePath() + File.separator + project.getProjectName());
File module = new File(root.getAbsolutePath() + File.separator + project.getName());
module.mkdirs();
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("tool", tool);
ctx.put("domain", project.getProjectBasePackage());
ctx.put("moduleName", project.getProjectName());
ctx.put("domain", project.getDomain());
ctx.put("moduleName", project.getName());
for (Module table : project.getModules()) {
ctx.put("table", table);
freeMarkerManager.outputTemp(new File(module.getAbsolutePath() + File.separator + Tool.ABB2Abb(table.getModuleName()) + "Test" + ".java"), option + "/test/test.ftl", ctx);
@ -577,11 +577,11 @@ public class SpringMVCCallable implements Callable {
*/
public void generateWebapp(File root, Project project, DataBase dataBase, String option) {
HashMap<String, Object> ctx = new HashMap<String, Object>();
ctx.put("domain", project.getProjectBasePackage());
ctx.put("moduleName", project.getProjectName());
ctx.put("domain", project.getDomain());
ctx.put("moduleName", project.getName());
ctx.put("tool", Tool.class);
ctx.put("project", project);
ctx.put("author", project.getProjectAuthor());
ctx.put("author", project.getAuthor());
try {
File static_ = new File(root.getAbsolutePath() + File.separator + "static");

@ -9,27 +9,27 @@ import java.util.List;
public class Project extends TreeItem {
public Project() {
this.projectName = "example-web";
this.projectBasePackage = "com.example";
this.projectAuthor = "author";
this.name = "example-web";
this.domain = "com.example";
this.author = "author";
this.frame = Frame.;
this.database = DataBase.MySQL;
this.needEMail = false;
this.needCloud = false;
this.database = DataBase.MySQL;
}
public Project(String projectName) {
this.projectName = projectName;
setValue(projectName);
public Project(String name) {
this.name = name;
setValue(name);
setExpanded(true);
}
@Property("name")
private String projectName;
private String name;
@Property("domain")
private String projectBasePackage;
private String domain;
@Property("author")
private String projectAuthor;
private String author;
@Property(value = "frame")
private Frame frame;
@Property(value = "database")
@ -54,29 +54,29 @@ public class Project extends TreeItem {
return true;
}
public String getProjectName() {
return projectName;
public String getName() {
return name;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
this.setValue(projectName);
public void setName(String name) {
this.name = name;
this.setValue(name);
}
public String getProjectBasePackage() {
return projectBasePackage;
public String getDomain() {
return domain;
}
public void setProjectBasePackage(String projectBasePackage) {
this.projectBasePackage = projectBasePackage;
public void setDomain(String domain) {
this.domain = domain;
}
public String getProjectAuthor() {
return projectAuthor;
public String getAuthor() {
return author;
}
public void setProjectAuthor(String projectAuthor) {
this.projectAuthor = projectAuthor;
public void setAuthor(String author) {
this.author = author;
}
public List<Module> getModules() {

@ -34,13 +34,13 @@
textFill="RED" GridPane.halignment="CENTER" GridPane.valignment="CENTER"/>
<Label GridPane.rowIndex="0" GridPane.columnIndex="1" text="项目名称" GridPane.halignment="CENTER"
GridPane.valignment="CENTER"/>
<TextField GridPane.rowIndex="0" GridPane.columnIndex="2" fx:id="projectName"/>
<TextField GridPane.rowIndex="0" GridPane.columnIndex="2" fx:id="name"/>
<Label GridPane.rowIndex="0" GridPane.columnIndex="3" text="*" alignment="CENTER" textAlignment="CENTER"
textFill="RED" GridPane.halignment="CENTER" GridPane.valignment="CENTER"/>
<Label GridPane.rowIndex="0" GridPane.columnIndex="4" text="项目作者" GridPane.halignment="CENTER"
GridPane.valignment="CENTER"/>
<TextField GridPane.rowIndex="0" GridPane.columnIndex="5" fx:id="projectAuthor"/>
<TextField GridPane.rowIndex="0" GridPane.columnIndex="5" fx:id="author"/>
<!-- ROW -->
<!-- ROW -->
@ -48,7 +48,7 @@
textFill="RED" GridPane.halignment="CENTER" GridPane.valignment="CENTER"/>
<Label GridPane.rowIndex="1" GridPane.columnIndex="1" text="项目域名" GridPane.halignment="CENTER"
GridPane.valignment="CENTER"/>
<TextField GridPane.rowIndex="1" GridPane.columnIndex="2" fx:id="projectBasePackage"/>
<TextField GridPane.rowIndex="1" GridPane.columnIndex="2" fx:id="domain"/>
<!-- ROW -->
<Label GridPane.rowIndex="2" GridPane.columnIndex="0" text="*" alignment="CENTER" textAlignment="CENTER"

@ -1,63 +0,0 @@
package ${domain}.module.system.ent;
/**
* Schedule -
*
* @author author
* @version 0.0.1
* @since 2020-05-24
*/
public class Schedule {
/**
* ID - ID
*/
private String id;
/**
* NAME -
*/
private String name;
/**
* NOTE -
*/
private String note;
/**
* run -
*/
private boolean run;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getNote() {
return note;
}
public void setNote(String note) {
this.note = note;
}
public boolean isRun() {
return run;
}
public void setRun(boolean run) {
this.run = run;
}
}

@ -1,35 +0,0 @@
package ${domain}.module.system.mgr;
import ${domain}.frame.auth.Token;
import ${domain}.module.system.req.SequenceFindRequest;
import ${domain}.module.system.req.SequenceNextRequest;
import ${domain}.module.system.rsp.SequenceFindResponse;
import ${domain}.module.system.rsp.SequenceNextResponse;
/**
*
*
* @author wangbing
* @version 0.0.1
* @since 2020-06-25
*/
public interface SequenceManager {
/**
*
*
* @param request
* @param token
* @return
*/
SequenceFindResponse find(SequenceFindRequest request, Token token);
/**
*
*
* @param request
* @param token
* @return
*/
SequenceNextResponse next(SequenceNextRequest request, Token token);
}

@ -1,153 +0,0 @@
package ${domain}.module.system.mgr;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.github.pagehelper.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import ${domain}.frame.auth.Token;
import ${domain}.frame.base.ErrorType;
import ${domain}.frame.utils.IDgenerator;
import ${domain}.frame.utils.ValidationUtil;
import ${domain}.module.system.ent.Sequence;
import ${domain}.module.system.mpr.SequenceMapper;
import ${domain}.module.system.req.SequenceFindRequest;
import ${domain}.module.system.req.SequenceNextRequest;
import ${domain}.module.system.rsp.SequenceFindResponse;
import ${domain}.module.system.rsp.SequenceNextResponse;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
/**
* SEQUENCE -
*
* @author wangbing
* @version 0.0.1
* @since 2020-06-25
*/
@Transactional
@Service
public class SequenceManagerImpl implements SequenceManager {
@Autowired
private SequenceMapper sequenceMapper;
private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
/**
*
*
* @param request
* @param token
* @return
*/
@Transactional(readOnly = true)
public SequenceFindResponse find(SequenceFindRequest request, Token token) {
SequenceFindResponse response = new SequenceFindResponse();
ValidationUtil.validate(request, response);
if (response.hasError()) {
return response;
}
if (request.getPageSize() != 0) {
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
}
if (StringUtil.isNotEmpty(request.getSortKey())) {
PageHelper.orderBy(request.getSortKey() + " " + request.getSortType());
}
PageInfo<Sequence> pageInfo = new PageInfo<>(sequenceMapper.find(request, token));
response.setResult(pageInfo.getList());
response.setTotalCount(pageInfo.getTotal());
return response;
}
/**
*
*
* @param request
* @param token
* @return
*/
@Transactional(readOnly = true)
public SequenceNextResponse next(SequenceNextRequest request, Token token) {
SequenceNextResponse response = new SequenceNextResponse();
int value = 0;
String year = null;
String month = null;
String date = null;
String format = dateFormat.format(new Date());
if (request.getByYear()) year = format.substring(0, 4);
if (request.getByMonth()) month = format.substring(4, 6);
if (request.getByDate()) date = format.substring(6, 8);
ValidationUtil.validate(request, response);
if (response.hasError()) {
return response;
}
int retryCount = 100;
do {
// 首先查询是否已经开始的序列
SequenceFindRequest sequenceFindRequest = new SequenceFindRequest();
sequenceFindRequest.setSeqName(request.getSeqName());
sequenceFindRequest.setYear(year);
sequenceFindRequest.setMonth(month);
sequenceFindRequest.setDate(date);
SequenceFindResponse sequenceFindResponse = this.find(sequenceFindRequest, token);
if (sequenceFindResponse.getTotalCount() > 0) {
Sequence sequence = sequenceFindResponse.getResult().get(0);
// 检查流水是否达到上限,达到最大值或理论最大值
if (sequence.getNextValue() > request.getMaxValue()) {
response.addError(ErrorType.BUSINESS_ERROR, "流水已达上限,请等待下个周期!");
return response;
}
// 更新下一个流水号
sequence.setNextValue(sequence.getNextValue() + request.getSeqStep());
long update = sequenceMapper.update(sequence, token);
if (update == 1) {
value = sequence.getNextValue() - request.getSeqStep();
break;
}
} else {// 未开始的序列
Sequence forCreate = new Sequence();
long id = IDgenerator.nextId();
forCreate.setId(id);
forCreate.setSeqName(request.getSeqName());
forCreate.setSeqNote(request.getSeqNote());
forCreate.setYear(year);
forCreate.setMonth(month);
forCreate.setDate(date);
forCreate.setNextValue(request.getMinValue() + request.getSeqStep());
long insert = sequenceMapper.insert(forCreate, token);
if (insert == 1) {
value = request.getMinValue();
break;
}
}
retryCount--;
} while (value <= 0 && retryCount > 0);
try {
TransactionAspectSupport.currentTransactionStatus().flush();
} catch (Exception e) {
response.addError(ErrorType.BUSINESS_ERROR, "生成序列失败,请稍后再试!");
return response;
}
response.setSequence(String.format(Locale.CHINA, "%s%s%s%s%0" + String.valueOf(request.getMaxValue()).length() + "d",
request.getSeqPrefix(),
year == null ? "" : year,
month == null ? "" : month,
date == null ? "" : date,
value));
return response;
}
}

@ -1,162 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="${domain}.module.system.mpr.SequenceMapper">
<sql id="table">"SYS_SEQUENCE"</sql>
<sql id="entityColumnList">
"ID","SEQ_NAME","SEQ_NOTE","YEAR","MONTH","DATE","NEXT_VALUE","ROW_VERSION","IS_DELETED","CREATE_BY","CREATE_TIME","LAST_UPDATE_BY","LAST_UPDATE_TIME"
</sql>
<resultMap id="sequence" type="${domain}.module.system.ent.Sequence">
<result column="ID" jdbcType="BIGINT" property="id"/>
<result column="SEQ_NAME" jdbcType="VARCHAR" property="seqName"/>
<result column="SEQ_NOTE" jdbcType="VARCHAR" property="seqNote"/>
<result column="YEAR" jdbcType="VARCHAR" property="year"/>
<result column="MONTH" jdbcType="VARCHAR" property="month"/>
<result column="DATE" jdbcType="VARCHAR" property="date"/>
<result column="NEXT_VALUE" jdbcType="INTEGER" property="nextValue"/>
<result column="ROW_VERSION" jdbcType="BIGINT" property="rowVersion"/>
<result column="IS_DELETED" jdbcType="BIT" property="isDeleted"/>
<result column="CREATE_BY" jdbcType="BIGINT" property="createBy"/>
<result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/>
<result column="LAST_UPDATE_BY" jdbcType="BIGINT" property="lastUpdateBy"/>
<result column="LAST_UPDATE_TIME" jdbcType="TIMESTAMP" property="lastUpdateTime"/>
</resultMap>
<insert id="insert">
INSERT INTO
<include refid="table"/>
(
<include refid="entityColumnList"/>
)
VALUES
(
${r'#'}{request.id},
${r'#'}{request.seqName,jdbcType=VARCHAR},
${r'#'}{request.seqNote,jdbcType=VARCHAR},
${r'#'}{request.year,jdbcType=VARCHAR},
${r'#'}{request.month,jdbcType=VARCHAR},
${r'#'}{request.date,jdbcType=VARCHAR},
${r'#'}{request.nextValue,jdbcType=INTEGER},
0,
0,
${r'#'}{token.userId,jdbcType=NUMERIC},
datetime('now','localtime'),
NULL,
NULL
)
</insert>
<insert id="insertBatch">
INSERT INTO
<include refid="table"/>
(
<include refid="entityColumnList"/>
)
VALUES
<foreach collection="list" item="item" index="index" separator="," open="(" close=")">
${r'#'}{item.id},
${r'#'}{item.seqName,jdbcType=VARCHAR},
${r'#'}{item.seqNote,jdbcType=VARCHAR},
${r'#'}{item.year,jdbcType=VARCHAR},
${r'#'}{item.month,jdbcType=VARCHAR},
${r'#'}{item.date,jdbcType=VARCHAR},
${r'#'}{item.nextValue,jdbcType=INTEGER},
0,
0,
${r'#'}{token.userId,jdbcType=NUMERIC},
datetime('now','localtime'),
NULL,
NULL
</foreach >
</insert>
<update id="delete">
UPDATE
<include refid="table"/>
SET "IS_DELETED" = 1
WHERE "IS_DELETED" = 0
AND "ID" = ${r'#'}{id}
</update>
<update id="deleteBatch">
UPDATE
<include refid="table"/>
SET "IS_DELETED" = 1
WHERE "IS_DELETED" = 0
AND "ID" IN
<foreach collection="list" item="item" index="index" separator="," open="(" close=")">
${r'#'}{item}
</foreach>
</update>
<update id="update">
UPDATE
<include refid="table"/>
SET
"SEQ_NAME" = ${r'#'}{request.seqName,jdbcType=VARCHAR},
"SEQ_NOTE" = ${r'#'}{request.seqNote,jdbcType=VARCHAR},
"YEAR" = ${r'#'}{request.year,jdbcType=VARCHAR},
"MONTH" = ${r'#'}{request.month,jdbcType=VARCHAR},
"DATE" = ${r'#'}{request.date,jdbcType=VARCHAR},
"NEXT_VALUE" = ${r'#'}{request.nextValue,jdbcType=INTEGER},
"ROW_VERSION" = "ROW_VERSION" + 1,
"LAST_UPDATE_BY" = ${r'#'}{token.userId},
"LAST_UPDATE_TIME" = datetime('now','localtime')
WHERE "IS_DELETED" = 0
AND "ID" = ${r'#'}{request.id}
AND "ROW_VERSION" = ${r'#'}{request.rowVersion}
</update>
<select id="find" resultMap="sequence">
SELECT
<include refid="entityColumnList"/>
FROM
<include refid="table"/>
WHERE "IS_DELETED" = 0
<if test="request.seqName != null and request.seqName != ''">
AND "SEQ_NAME" = ${r'#'}{request.seqName}
</if>
<if test="request.year != null and request.year != ''">
AND "YEAR" = ${r'#'}{request.year}
</if>
<if test="request.month != null and request.month != ''">
AND "MONTH" = ${r'#'}{request.month}
</if>
<if test="request.date != null and request.date != ''">
AND "DATE" = ${r'#'}{request.date}
</if>
</select>
<select id="search" resultMap="sequence">
SELECT
<include refid="entityColumnList"/>
FROM
<include refid="table"/>
WHERE "IS_DELETED" = 0
</select>
<select id="getById" resultMap="sequence">
SELECT
<include refid="entityColumnList"/>
FROM
<include refid="table"/>
WHERE "IS_DELETED" = 0
AND "ID" = ${r'#'}{id}
</select>
<select id="getByIds" resultMap="sequence">
SELECT
<include refid="entityColumnList"/>
FROM
<include refid="table"/>
WHERE "IS_DELETED" = 0
AND "ID" IN
<foreach collection="list" item="item" index="index" separator="," open="(" close=")">
${r'#'}{item}
</foreach>
</select>
</mapper>

@ -1,93 +0,0 @@
package ${domain}.module.system.req;
import ${domain}.frame.base.BaseFindRequest;
import java.util.Date;
/**
* SequenceFindRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2020-06-27
*/
public class SequenceFindRequest extends BaseFindRequest {
/**
* .
*/
private String seqName;
/**
* .
*/
private String year;
/**
* .
*/
private String month;
/**
* .
*/
private String date;
/**
*
*/
private Date startDate;
/**
*
*/
private Date endDate;
public String getSeqName() {
return this.seqName;
}
public void setSeqName(String seqName) {
this.seqName = seqName;
}
public String getYear() {
return this.year;
}
public void setYear(String year) {
this.year = year;
}
public String getMonth() {
return this.month;
}
public void setMonth(String month) {
this.month = month;
}
public String getDate() {
return this.date;
}
public void setDate(String date) {
this.date = date;
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
}

@ -1,136 +0,0 @@
package ${domain}.module.system.req;
import org.hibernate.validator.constraints.Length;
import ${domain}.frame.base.BaseRequest;
import javax.validation.constraints.NotBlank;
/**
* SequenceNextRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2020-06-25
*/
public class SequenceNextRequest extends BaseRequest {
/**
* .
*/
@NotBlank(message = "[seqName]序列名称不能为空")
@Length(min = 1, max = 50, message = "[seqName]序列名称长度不合法(1-50)")
private String seqName;
/**
* .
*/
@Length(min = 0, max = 50, message = "[seqNote]序列备注长度不合法(0-50)")
private String seqNote;
/**
*
*/
private String seqPrefix;
/**
*
*/
private int seqStep = 1;
/**
* .
*/
private int minValue = 1;
/**
* .
*/
private int maxValue = 99999;
/**
* .
*/
private boolean byYear;
/**
* .
*/
private boolean byMonth;
/**
* .
*/
private boolean byDate;
public String getSeqName() {
return seqName;
}
public void setSeqName(String seqName) {
this.seqName = seqName;
}
public String getSeqNote() {
return seqNote;
}
public void setSeqNote(String seqNote) {
this.seqNote = seqNote;
}
public void setByYear(boolean byYear) {
this.byYear = byYear;
}
public boolean getByYear() {
return byYear;
}
public boolean getByMonth() {
return byMonth;
}
public void setByMonth(boolean byMonth) {
this.byMonth = byMonth;
}
public boolean getByDate() {
return byDate;
}
public void setByDate(boolean byDate) {
this.byDate = byDate;
}
public String getSeqPrefix() {
return seqPrefix;
}
public void setSeqPrefix(String seqPrefix) {
this.seqPrefix = seqPrefix;
}
public int getSeqStep() {
return seqStep;
}
public void setSeqStep(int seqStep) {
this.seqStep = seqStep;
}
public int getMinValue() {
return minValue;
}
public void setMinValue(int minValue) {
this.minValue = minValue;
}
public int getMaxValue() {
return maxValue;
}
public void setMaxValue(int maxValue) {
this.maxValue = maxValue;
}
}

@ -1,14 +0,0 @@
package ${domain}.module.system.rsp;
import ${domain}.frame.base.BaseFindResponse;
import ${domain}.module.system.ent.Sequence;
/**
* SequenceFindResponse -
*
* @author wangbing
* @version 0.0.1
* @since 2020-06-27
*/
public class SequenceFindResponse extends BaseFindResponse<Sequence> {
}

@ -1,26 +0,0 @@
package ${domain}.module.system.rsp;
import ${domain}.frame.base.BaseResponse;
/**
* SequenceNextResponse -
*
* @author wangbing
* @version 0.0.1
* @since 2020-06-25
*/
public class SequenceNextResponse extends BaseResponse {
/**
*
*/
private String sequence;
public String getSequence() {
return sequence;
}
public void setSequence(String sequence) {
this.sequence = sequence;
}
}

@ -8,12 +8,12 @@
<version>2.1.2.RELEASE</version>
<relativePath/>
</parent>
<groupId>${domain}</groupId>
<artifactId>${projectName}</artifactId>
<groupId>${project.domain}</groupId>
<artifactId>${project.name}</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<!--<packaging>war</packaging>--><!--需要打包成war时放开-->
<name>${projectName}</name>
<name>${project.name}</name>
<description>project for Spring Boot</description>
<properties>

@ -4,7 +4,7 @@ server.port=8080
server.servlet.context-path=
spring.mvc.static-path-pattern=/static/**
spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:/file-upload
spring.application.name=${projectName?default("SpringBoot")}
spring.application.name=${project.name?default("SpringBoot")}
spring.main.banner-mode=CONSOLE
spring.devtools.restart.enabled=true
<#if project.needCloud>
@ -60,13 +60,13 @@ spring.datasource.two.password=123456
<#if dataBase == 'SQLite'>
# 主数据库
spring.datasource.main.driver-class-name=org.sqlite.JDBC
spring.datasource.main.url=jdbc:sqlite:${projectName?default("SpringBoot")}.db3?date_string_format=yyyy-MM-dd HH:mm:ss
spring.datasource.main.url=jdbc:sqlite:${project.name?default("SpringBoot")}.db3?date_string_format=yyyy-MM-dd HH:mm:ss
spring.datasource.main.username=test
spring.datasource.main.password=123456
# 副数据库
spring.datasource.two.driver-class-name=org.sqlite.JDBC
spring.datasource.two.url=jdbc:sqlite:${projectName?default("SpringBoot")}.db3?date_string_format=yyyy-MM-dd HH:mm:ss
spring.datasource.two.url=jdbc:sqlite:${project.name?default("SpringBoot")}.db3?date_string_format=yyyy-MM-dd HH:mm:ss
spring.datasource.two.username=test
spring.datasource.two.password=123456
</#if>
@ -89,7 +89,7 @@ spring.datasource.password=123456
<#if dataBase == 'SQLite'>
# SQLite spring.datasource.url=jdbc:sqlite::resource:example.db3
spring.datasource.driver-class-name=org.sqlite.JDBC
spring.datasource.url=jdbc:sqlite:${projectName?default("SpringBoot")}.db3?date_string_format=yyyy-MM-dd HH:mm:ss
spring.datasource.url=jdbc:sqlite:${project.name?default("SpringBoot")}.db3?date_string_format=yyyy-MM-dd HH:mm:ss
spring.datasource.username=test
spring.datasource.password=123456
</#if>

@ -4,7 +4,7 @@ server.port=80
server.servlet.context-path=
spring.mvc.static-path-pattern=/static/**
spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:/file-upload
spring.application.name=${projectName}
spring.application.name=${project.name}
spring.main.banner-mode=off
spring.devtools.restart.enabled=false
<#if project.needCloud>
@ -60,13 +60,13 @@ spring.datasource.two.password=123456
<#if dataBase == 'SQLite'>
# 主数据库
spring.datasource.main.driver-class-name=org.sqlite.JDBC
spring.datasource.main.url=jdbc:sqlite:${projectName?default("SpringBoot")}.db3?date_string_format=yyyy-MM-dd HH:mm:ss
spring.datasource.main.url=jdbc:sqlite:${project.name?default("SpringBoot")}.db3?date_string_format=yyyy-MM-dd HH:mm:ss
spring.datasource.main.username=test
spring.datasource.main.password=123456
# 副数据库
spring.datasource.two.driver-class-name=org.sqlite.JDBC
spring.datasource.two.url=jdbc:sqlite:${projectName?default("SpringBoot")}.db3?date_string_format=yyyy-MM-dd HH:mm:ss
spring.datasource.two.url=jdbc:sqlite:${project.name?default("SpringBoot")}.db3?date_string_format=yyyy-MM-dd HH:mm:ss
spring.datasource.two.username=test
spring.datasource.two.password=123456
</#if>
@ -89,7 +89,7 @@ spring.datasource.password=123456
<#if dataBase == 'SQLite'>
# SQLite spring.datasource.url=jdbc:sqlite::resource:example.db3
spring.datasource.driver-class-name=org.sqlite.JDBC
spring.datasource.url=jdbc:sqlite:${projectName?default("SpringBoot")}.db3?date_string_format=yyyy-MM-dd HH:mm:ss
spring.datasource.url=jdbc:sqlite:${project.name?default("SpringBoot")}.db3?date_string_format=yyyy-MM-dd HH:mm:ss
spring.datasource.username=test
spring.datasource.password=123456
</#if>

@ -1,3 +1,3 @@
@echo off
cd %cd%
start java -Dfile.encoding=UTF-8 -jar ${projectName}-0.0.1-SNAPSHOT.jar --spring.profiles.active=dev
start java -Dfile.encoding=UTF-8 -jar ${project.name}-0.0.1-SNAPSHOT.jar --spring.profiles.active=dev

@ -1,3 +1,3 @@
@echo off
cd %cd%
start java -Dfile.encoding=UTF-8 -jar ${projectName}-0.0.1-SNAPSHOT.jar --spring.profiles.active=prod
start java -Dfile.encoding=UTF-8 -jar ${project.name}-0.0.1-SNAPSHOT.jar --spring.profiles.active=prod

@ -3,7 +3,7 @@ server.port=8080
server.servlet.context-path=
spring.mvc.static-path-pattern=/static/**
spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/,file:/file-upload
spring.application.name=${projectName?default("SpringBoot")}
spring.application.name=${project.name?default("SpringBoot")}
spring.main.banner-mode=CONSOLE
spring.devtools.restart.enabled=true
<#if project.needCloud>
@ -48,13 +48,13 @@ spring.datasource.two.password=123456
<#if dataBase == 'SQLite'>
# 主数据库
spring.datasource.main.driver-class-name=org.sqlite.JDBC
spring.datasource.main.url=jdbc:sqlite:${projectName?default("SpringBoot")}.db3?date_string_format=yyyy-MM-dd HH:mm:ss
spring.datasource.main.url=jdbc:sqlite:${project.name?default("SpringBoot")}.db3?date_string_format=yyyy-MM-dd HH:mm:ss
spring.datasource.main.username=test
spring.datasource.main.password=123456
# 副数据库
spring.datasource.two.driver-class-name=org.sqlite.JDBC
spring.datasource.two.url=jdbc:sqlite:${projectName?default("SpringBoot")}.db3?date_string_format=yyyy-MM-dd HH:mm:ss
spring.datasource.two.url=jdbc:sqlite:${project.name?default("SpringBoot")}.db3?date_string_format=yyyy-MM-dd HH:mm:ss
spring.datasource.two.username=test
spring.datasource.two.password=123456
</#if>
@ -77,7 +77,7 @@ spring.datasource.password=123456
<#if dataBase == 'SQLite'>
# SQLite spring.datasource.url=jdbc:sqlite::resource:example.db3
spring.datasource.driver-class-name=org.sqlite.JDBC
spring.datasource.url=jdbc:sqlite:${projectName?default("SpringBoot")}.db3?date_string_format=yyyy-MM-dd HH:mm:ss
spring.datasource.url=jdbc:sqlite:${project.name?default("SpringBoot")}.db3?date_string_format=yyyy-MM-dd HH:mm:ss
spring.datasource.username=test
spring.datasource.password=123456
</#if>

Loading…
Cancel
Save

Powered by TurnKey Linux.