1、ajax es6

master
wangbing 6 years ago
parent 19a39169c7
commit 00e6451242

@ -418,6 +418,13 @@ public class ProjectManager {
while (rs.next()) {
Table table = new Table(rs.getString("table_name"), rs.getString("comments"));
table.setCreate(true);
table.setDelete(true);
table.setUpdate(true);
table.setFind(true);
table.setGet(false);
table.setGetAll(false);
table.setSearch(false);
md.putTable(table);
}
@ -486,6 +493,13 @@ public class ProjectManager {
while (rs.next()) {
Table table = new Table(rs.getString("TABLE_NAME"), rs.getString("TABLE_COMMENT"));
table.setCreate(true);
table.setDelete(true);
table.setUpdate(true);
table.setFind(true);
table.setGet(false);
table.setGetAll(false);
table.setSearch(false);
md.putTable(table);
}

@ -193,13 +193,13 @@ public class XmlManager {
Element table = doc.createElement("table");
table.setAttribute("tableName", t.getTableName());
table.setAttribute("tableComment", t.getTableComment());
table.setAttribute("create", t.getCreate().toString());
table.setAttribute("delete", t.getDelete().toString());
table.setAttribute("update", t.getUpdate().toString());
table.setAttribute("find", t.getFind().toString());
table.setAttribute("get", t.getGet().toString());
table.setAttribute("search", t.getSearch().toString());
table.setAttribute("getAll", t.getGetAll().toString());
table.setAttribute("create", Boolean.toString(t.getCreate()));
table.setAttribute("delete", Boolean.toString(t.getDelete()));
table.setAttribute("update", Boolean.toString(t.getUpdate()));
table.setAttribute("find", Boolean.toString(t.getFind()));
table.setAttribute("get", Boolean.toString(t.getGet()));
table.setAttribute("search", Boolean.toString(t.getSearch()));
table.setAttribute("getAll", Boolean.toString(t.getGetAll()));
Element fields = doc.createElement("fields");

@ -396,30 +396,30 @@ public class SpringBootCallable implements Callable {
for (Table table : md.getTables()) {
ctx.put("table", table);
if (table.getCreate() != null && table.getCreate()) {
if (table.getCreate()) {
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), Tool.lineToClassName(table.getTableName()) + "CreateRequest" + ".java"), option + "/java/req/createRequestClass.ftl", ctx);
}
if (table.getDelete() != null && table.getDelete()) {
if (table.getDelete()) {
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), Tool.lineToClassName(table.getTableName()) + "DeleteRequest" + ".java"), option + "/java/req/deleteRequestClass.ftl", ctx);
}
if (table.getUpdate() != null && table.getUpdate()) {
if (table.getUpdate()) {
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), Tool.lineToClassName(table.getTableName()) + "UpdateRequest" + ".java"), option + "/java/req/updateRequestClass.ftl", ctx);
}
if (table.getFind() != null && table.getFind()) {
if (table.getFind()) {
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), Tool.lineToClassName(table.getTableName()) + "FindRequest" + ".java"), option + "/java/req/findRequestClass.ftl", ctx);
}
if (table.getGet() != null && table.getGet()) {
if (table.getGet()) {
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), Tool.lineToClassName(table.getTableName()) + "GetRequest" + ".java"), option + "/java/req/getRequestClass.ftl", ctx);
}
if (table.getSearch() != null && table.getSearch()) {
if (table.getSearch()) {
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), Tool.lineToClassName(table.getTableName()) + "SearchRequest" + ".java"), option + "/java/req/searchRequestClass.ftl", ctx);
}
if (table.getGetAll() != null && table.getGetAll()) {
if (table.getGetAll()) {
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), Tool.lineToClassName(table.getTableName()) + "GetAllRequest" + ".java"), option + "/java/req/getAllRequestClass.ftl", ctx);
}
}
@ -453,30 +453,30 @@ public class SpringBootCallable implements Callable {
for (Table table : md.getTables()) {
ctx.put("table", table);
if (table.getCreate() != null && table.getCreate()) {
if (table.getCreate()) {
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), Tool.lineToClassName(table.getTableName()) + "CreateResponse" + ".java"), option + "/java/rsp/createResponseClass.ftl", ctx);
}
if (table.getDelete() != null && table.getDelete()) {
if (table.getDelete()) {
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), Tool.lineToClassName(table.getTableName()) + "DeleteResponse" + ".java"), option + "/java/rsp/deleteResponseClass.ftl", ctx);
}
if (table.getUpdate() != null && table.getUpdate()) {
if (table.getUpdate()) {
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), Tool.lineToClassName(table.getTableName()) + "UpdateResponse" + ".java"), option + "/java/rsp/updateResponseClass.ftl", ctx);
}
if (table.getFind() != null && table.getFind()) {
if (table.getFind()) {
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), Tool.lineToClassName(table.getTableName()) + "FindResponse" + ".java"), option + "/java/rsp/findResponseClass.ftl", ctx);
}
if (table.getGet() != null && table.getGet()) {
if (table.getGet()) {
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), Tool.lineToClassName(table.getTableName()) + "GetResponse" + ".java"), option + "/java/rsp/getResponseClass.ftl", ctx);
}
if (table.getSearch() != null && table.getSearch()) {
if (table.getSearch()) {
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), Tool.lineToClassName(table.getTableName()) + "SearchResponse" + ".java"), option + "/java/rsp/searchResponseClass.ftl", ctx);
}
if (table.getGetAll() != null && table.getGetAll()) {
if (table.getGetAll()) {
freeMarkerManager.outputTemp(new File(root.getAbsolutePath(), Tool.lineToClassName(table.getTableName()) + "GetAllResponse" + ".java"), option + "/java/rsp/getAllResponseClass.ftl", ctx);
}
}

@ -35,13 +35,13 @@ public class Table extends TreeItem {
*/
private String tableComment;
private Boolean create = true;
private Boolean delete = true;
private Boolean update = true;
private Boolean find = true;
private Boolean get = true;
private Boolean search = false;
private Boolean getAll = false;
private boolean create = true;
private boolean delete = true;
private boolean update = true;
private boolean find = true;
private boolean get = true;
private boolean search = false;
private boolean getAll = false;
/**
*
@ -111,7 +111,7 @@ public class Table extends TreeItem {
}
public void setTableComment(String tableComment) {
this.tableComment = tableComment!=null?tableComment:"";
this.tableComment = tableComment != null ? tableComment : "";
}
public List<Field> getFields() {
@ -130,59 +130,59 @@ public class Table extends TreeItem {
this.dBhandle = dBhandle;
}
public Boolean getCreate() {
return create || !dBhandle.isHasSysFields();
public boolean getCreate() {
return create;
}
public void setCreate(Boolean create) {
public void setCreate(boolean create) {
this.create = create;
}
public Boolean getDelete() {
return delete || !dBhandle.isHasSysFields();
public boolean getDelete() {
return delete;
}
public void setDelete(Boolean delete) {
public void setDelete(boolean delete) {
this.delete = delete;
}
public Boolean getUpdate() {
return update || !dBhandle.isHasSysFields();
public boolean getUpdate() {
return update;
}
public void setUpdate(Boolean update) {
public void setUpdate(boolean update) {
this.update = update;
}
public Boolean getFind() {
return find || !dBhandle.isHasSysFields();
public boolean getFind() {
return find;
}
public void setFind(Boolean find) {
public void setFind(boolean find) {
this.find = find;
}
public Boolean getGet() {
return get && dBhandle.isHasSysFields();
public boolean getGet() {
return get;
}
public void setGet(Boolean get) {
public void setGet(boolean get) {
this.get = get;
}
public Boolean getSearch() {
return search && dBhandle.isHasSysFields();
public boolean getSearch() {
return search;
}
public void setSearch(Boolean search) {
public void setSearch(boolean search) {
this.search = search;
}
public Boolean getGetAll() {
return getAll && dBhandle.isHasSysFields();
public boolean getGetAll() {
return getAll;
}
public void setGetAll(Boolean getAll) {
public void setGetAll(boolean getAll) {
this.getAll = getAll;
}
}

@ -51,9 +51,9 @@ public class Dialog {
});
VBox root = new VBox();
root.setPadding(new Insets(20));
root.setPadding(new Insets(10));
root.setAlignment(Pos.BASELINE_CENTER);
root.setSpacing(20);
root.setSpacing(10);
root.getChildren().addAll(new Label(message), closeBtn);
Scene scene = new Scene(root);
popup.setScene(scene);
@ -84,10 +84,10 @@ public class Dialog {
public static void showConfirmDialog(String message) {
popup = new Stage();
popup.setWidth(200);
popup.setWidth(250);
popup.setHeight(160);
popup.setAlwaysOnTop(true);
popup.initModality(Modality.APPLICATION_MODAL);
popup.initModality(Modality.WINDOW_MODAL);
final Button closeBtn = new Button("确认");
closeBtn.setOnAction(new EventHandler<ActionEvent>() {
@Override
@ -97,9 +97,9 @@ public class Dialog {
});
VBox root = new VBox();
root.setPadding(new Insets(20));
root.setPadding(new Insets(10));
root.setAlignment(Pos.BASELINE_CENTER);
root.setSpacing(20);
root.setSpacing(10);
Label label = new Label(message);
root.getChildren().addAll(label, closeBtn);
Scene scene = new Scene(root);
@ -111,7 +111,7 @@ public class Dialog {
public static void showConfirmDialog(String message, EventHandler handler) {
popup = new Stage();
popup.setAlwaysOnTop(true);
popup.setWidth(200);
popup.setWidth(250);
popup.setHeight(160);
popup.initModality(Modality.APPLICATION_MODAL);
final Button okBtn = new Button("确认");
@ -124,9 +124,9 @@ public class Dialog {
});
VBox root = new VBox();
root.setPadding(new Insets(20));
root.setPadding(new Insets(10));
root.setAlignment(Pos.BASELINE_CENTER);
root.setSpacing(20);
root.setSpacing(10);
Label label = new Label(message);
root.getChildren().addAll(label, okBtn);
Scene scene = new Scene(root);
@ -173,7 +173,7 @@ public class Dialog {
VBox root = new VBox();
root.setPadding(new Insets(50, 80, 50, 80));
root.setAlignment(Pos.BASELINE_CENTER);
root.setSpacing(20);
root.setSpacing(10);
Label label = new Label(message);
root.getChildren().addAll(indicator, label);

@ -31,6 +31,7 @@
FROM
<include refid="table"/>
WHERE
1 = 1
<#list table.fields as f>
<#if f.isQuery>
<#if dataBase == 'ORACLE'>

@ -3,7 +3,7 @@ server.port=8080
server.servlet.context-path=/
spring.mvc.static-path-pattern=/static/**
spring.resources.static-locations=classpath:static/
spring.application.name=${projectName}
spring.application.name=${projectName?default("SpringBoot")}
spring.main.banner-mode=CONSOLE
spring.devtools.restart.enabled=true
<#if cloud>

@ -1,25 +1,26 @@
# 开发环境
# 测试环境
server.port=8080
server.servlet.context-path=/
spring.mvc.static-path-pattern=/static/**
spring.resources.static-locations=classpath:static/
spring.application.name=SpringBoot
spring.application.name=${projectName?default("SpringBoot")}
spring.main.banner-mode=CONSOLE
spring.devtools.restart.enabled=true
# 编码配置
spring.http.encoding.force=true
spring.http.encoding.charset=UTF-8
spring.http.encoding.enabled=true
server.tomcat.uri-encoding=UTF-8
# 根路径、欢迎页
web.welcome.page = index
# 排除的不需要验证的URL
web.url.excluded = /static/**,/open/**,/api,/index,/,/login
web.url.authorization = /**
# 默认的登录URL
web.url.login = /login
web.welcome.page=/index.htm
# 需要验证授权, 既访问时组装Token
web.url.auth.included=/**
# 不需要验证授权, 或该请求有自己的验证机制
web.url.auth.excluded=/favicon.ico,/static/**,/api,/login.htm
# 日志配置
logging.path=D://
logging.levels=DEBUG
logging.config=classpath:logback-config.xml
# 热部署生效
spring.devtools.restart.enabled=true
<#if dataBase == 'ORACLE'>
# oracle
spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver

Loading…
Cancel
Save

Powered by TurnKey Linux.