1、ajax es6

master
wangbing 6 years ago
parent 19a39169c7
commit 00e6451242

@ -418,6 +418,13 @@ public class ProjectManager {
while (rs.next()) { while (rs.next()) {
Table table = new Table(rs.getString("table_name"), rs.getString("comments")); 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); md.putTable(table);
} }
@ -486,6 +493,13 @@ public class ProjectManager {
while (rs.next()) { while (rs.next()) {
Table table = new Table(rs.getString("TABLE_NAME"), rs.getString("TABLE_COMMENT")); 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); md.putTable(table);
} }

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

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

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

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

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

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

Loading…
Cancel
Save

Powered by TurnKey Linux.