diff --git a/src/main/java/xyz/wbsite/dbtool/javafx/enums/FieldType.java b/src/main/java/xyz/wbsite/dbtool/javafx/enums/FieldType.java index 5a208594..44c11edc 100644 --- a/src/main/java/xyz/wbsite/dbtool/javafx/enums/FieldType.java +++ b/src/main/java/xyz/wbsite/dbtool/javafx/enums/FieldType.java @@ -12,7 +12,7 @@ public enum FieldType { Double(0),// Date(0),//日期时间 BigDecimal(0),//高精度 - Dict(0),//字典 + Dict(20),//字典 String_1(1),//字符1 String_10(10),//字符10 String_var(20, false),//字符20 diff --git a/src/main/java/xyz/wbsite/dbtool/javafx/manger/callable/SpringBootCallable.java b/src/main/java/xyz/wbsite/dbtool/javafx/manger/callable/SpringBootCallable.java index 25546aa1..2454909d 100644 --- a/src/main/java/xyz/wbsite/dbtool/javafx/manger/callable/SpringBootCallable.java +++ b/src/main/java/xyz/wbsite/dbtool/javafx/manger/callable/SpringBootCallable.java @@ -184,6 +184,8 @@ public class SpringBootCallable implements Callable { freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), "DictAjax.java"), option + "/java/action/ajax/system/DictAjax.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), "DictItemAjax.java"), option + "/java/action/ajax/system/DictItemAjax.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), "FileAjax.java"), option + "/java/action/ajax/system/FileAjax.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), "ResourceAjax.java"), option + "/java/action/ajax/system/ResourceAjax.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), "TokensAjax.java"), option + "/java/action/ajax/system/TokensAjax.java", ctx); for (Module module : project.getModules()) { File m = Tool.createPath(ajax.getAbsolutePath(), module.getModuleName()); @@ -208,6 +210,8 @@ public class SpringBootCallable implements Callable { freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), "DictApi.java"), option + "/java/action/api/system/DictApi.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), "DictItemApi.java"), option + "/java/action/api/system/DictItemApi.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), "FileApi.java"), option + "/java/action/api/system/FileApi.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), "ResourceApi.java"), option + "/java/action/api/system/ResourceApi.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), "TokensApi.java"), option + "/java/action/api/system/TokensApi.java", ctx); for (Module module : project.getModules()) { File m = Tool.createPath(api.getAbsolutePath(), module.getModuleName()); @@ -469,6 +473,8 @@ public class SpringBootCallable implements Callable { freeMarkerManager.outputTemp(Tool.createFile(ent.getAbsolutePath(), "Dict.java"), option + "/java/module/system/ent/Dict.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(ent.getAbsolutePath(), "DictItem.java"), option + "/java/module/system/ent/DictItem.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(ent.getAbsolutePath(), "File.java"), option + "/java/module/system/ent/File.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(ent.getAbsolutePath(), "Resource.java"), option + "/java/module/system/ent/Resource.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(ent.getAbsolutePath(), "Tokens.java"), option + "/java/module/system/ent/Tokens.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(mgr.getAbsolutePath(), "DictItemManager.java"), option + "/java/module/system/mgr/DictItemManager.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(mgr.getAbsolutePath(), "DictItemManagerImpl.java"), option + "/java/module/system/mgr/DictItemManagerImpl.java", ctx); @@ -476,6 +482,10 @@ public class SpringBootCallable implements Callable { freeMarkerManager.outputTemp(Tool.createFile(mgr.getAbsolutePath(), "DictManagerImpl.java"), option + "/java/module/system/mgr/DictManagerImpl.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(mgr.getAbsolutePath(), "FileManager.java"), option + "/java/module/system/mgr/FileManager.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(mgr.getAbsolutePath(), "FileManagerImpl.java"), option + "/java/module/system/mgr/FileManagerImpl.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(mgr.getAbsolutePath(), "ResourceManager.java"), option + "/java/module/system/mgr/ResourceManager.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(mgr.getAbsolutePath(), "ResourceManagerImpl.java"), option + "/java/module/system/mgr/ResourceManagerImpl.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(mgr.getAbsolutePath(), "TokensManager.java"), option + "/java/module/system/mgr/TokensManager.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(mgr.getAbsolutePath(), "TokensManagerImpl.java"), option + "/java/module/system/mgr/TokensManagerImpl.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), "DictItemMapper.java"), option + "/java/module/system/mpr/DictItemMapper.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), "DictItemMapper.xml"), option + "/java/module/system/mpr/DictItemMapper_" + dataBase.toString() + ".xml", ctx); @@ -483,6 +493,10 @@ public class SpringBootCallable implements Callable { freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), "DictMapper.xml"), option + "/java/module/system/mpr/DictMapper_" + dataBase.toString() + ".xml", ctx); freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), "FileMapper.java"), option + "/java/module/system/mpr/FileMapper.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), "FileMapper.xml"), option + "/java/module/system/mpr/FileMapper_" + dataBase.toString() + ".xml", ctx); + freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), "ResourceMapper.java"), option + "/java/module/system/mpr/ResourceMapper.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), "ResourceMapper.xml"), option + "/java/module/system/mpr/ResourceMapper_" + dataBase.toString() + ".xml", ctx); + freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), "TokensMapper.java"), option + "/java/module/system/mpr/TokensMapper.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), "ResourceMapper.xml"), option + "/java/module/system/mpr/ResourceMapper_" + dataBase.toString() + ".xml", ctx); freeMarkerManager.outputTemp(Tool.createFile(req.getAbsolutePath(), "AuthLoginRequest.java"), option + "/java/module/system/req/AuthLoginRequest.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(req.getAbsolutePath(), "DictCreateRequest.java"), option + "/java/module/system/req/DictCreateRequest.java", ctx); @@ -502,6 +516,19 @@ public class SpringBootCallable implements Callable { freeMarkerManager.outputTemp(Tool.createFile(req.getAbsolutePath(), "FileFindRequest.java"), option + "/java/module/system/req/FileFindRequest.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(req.getAbsolutePath(), "FileGetRequest.java"), option + "/java/module/system/req/FileGetRequest.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(req.getAbsolutePath(), "FileUploadRequest.java"), option + "/java/module/system/req/FileUploadRequest.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(req.getAbsolutePath(), "ResourceCreateRequest.java"), option + "/java/module/system/req/ResourceCreateRequest.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(req.getAbsolutePath(), "ResourceDeleteRequest.java"), option + "/java/module/system/req/ResourceDeleteRequest.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(req.getAbsolutePath(), "ResourceFindRequest.java"), option + "/java/module/system/req/ResourceFindRequest.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(req.getAbsolutePath(), "ResourceGetRequest.java"), option + "/java/module/system/req/ResourceGetRequest.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(req.getAbsolutePath(), "ResourceUpdateRequest.java"), option + "/java/module/system/req/ResourceUpdateRequest.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(req.getAbsolutePath(), "TokensCreateRequest.java"), option + "/java/module/system/req/TokensCreateRequest.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(req.getAbsolutePath(), "TokensDeleteRequest.java"), option + "/java/module/system/req/TokensDeleteRequest.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(req.getAbsolutePath(), "TokensFindRequest.java"), option + "/java/module/system/req/TokensFindRequest.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(req.getAbsolutePath(), "TokensGetRequest.java"), option + "/java/module/system/req/TokensGetRequest.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(req.getAbsolutePath(), "TokensUpdateRequest.java"), option + "/java/module/system/req/TokensUpdateRequest.java", ctx); + + + freeMarkerManager.outputTemp(Tool.createFile(rsp.getAbsolutePath(), "AuthLoginResponse.java"), option + "/java/module/system/rsp/AuthLoginResponse.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(rsp.getAbsolutePath(), "DictCreateResponse.java"), option + "/java/module/system/rsp/DictCreateResponse.java", ctx); @@ -521,6 +548,16 @@ public class SpringBootCallable implements Callable { freeMarkerManager.outputTemp(Tool.createFile(rsp.getAbsolutePath(), "FileFindResponse.java"), option + "/java/module/system/rsp/FileFindResponse.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(rsp.getAbsolutePath(), "FileGetResponse.java"), option + "/java/module/system/rsp/FileGetResponse.java", ctx); freeMarkerManager.outputTemp(Tool.createFile(rsp.getAbsolutePath(), "FileUploadResponse.java"), option + "/java/module/system/rsp/FileUploadResponse.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(rsp.getAbsolutePath(), "ResourceCreateResponse.java"), option + "/java/module/system/rsp/ResourceCreateResponse.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(rsp.getAbsolutePath(), "ResourceDeleteResponse.java"), option + "/java/module/system/rsp/ResourceDeleteResponse.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(rsp.getAbsolutePath(), "ResourceFindResponse.java"), option + "/java/module/system/rsp/ResourceFindResponse.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(rsp.getAbsolutePath(), "ResourceGetResponse.java"), option + "/java/module/system/rsp/ResourceGetResponse.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(rsp.getAbsolutePath(), "ResourceUpdateResponse.java"), option + "/java/module/system/rsp/ResourceUpdateResponse.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(rsp.getAbsolutePath(), "TokensCreateResponse.java"), option + "/java/module/system/rsp/TokensCreateResponse.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(rsp.getAbsolutePath(), "TokensDeleteResponse.java"), option + "/java/module/system/rsp/TokensDeleteResponse.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(rsp.getAbsolutePath(), "TokensFindResponse.java"), option + "/java/module/system/rsp/TokensFindResponse.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(rsp.getAbsolutePath(), "TokensGetResponse.java"), option + "/java/module/system/rsp/TokensGetResponse.java", ctx); + freeMarkerManager.outputTemp(Tool.createFile(rsp.getAbsolutePath(), "TokensUpdateResponse.java"), option + "/java/module/system/rsp/TokensUpdateResponse.java", ctx); } /** @@ -837,6 +874,8 @@ public class SpringBootCallable implements Callable { Tool.outputResource(option + "/resources/templates/screen/module/system/dict.ftl", Tool.createFile(system.getAbsolutePath(), "dict.ftl")); Tool.outputResource(option + "/resources/templates/screen/module/system/dictItem.ftl", Tool.createFile(system.getAbsolutePath(), "dictItem.ftl")); Tool.outputResource(option + "/resources/templates/screen/module/system/file.ftl", Tool.createFile(system.getAbsolutePath(), "file.ftl")); + Tool.outputResource(option + "/resources/templates/screen/module/system/resource.ftl", Tool.createFile(system.getAbsolutePath(), "resource.ftl")); + Tool.outputResource(option + "/resources/templates/screen/module/system/tokens.ftl", Tool.createFile(system.getAbsolutePath(), "tokens.ftl")); { HashMap ctx = new HashMap(); diff --git a/src/main/java/xyz/wbsite/dbtool/javafx/po/MySQLDBmapper.java b/src/main/java/xyz/wbsite/dbtool/javafx/po/MySQLDBmapper.java index af8d6a3a..cc67bbbd 100644 --- a/src/main/java/xyz/wbsite/dbtool/javafx/po/MySQLDBmapper.java +++ b/src/main/java/xyz/wbsite/dbtool/javafx/po/MySQLDBmapper.java @@ -18,10 +18,12 @@ public class MySQLDBmapper extends AbstractDBmapper { if (FieldType.Boolean.name().equals(type.name())) { sb.append("TINYINT(1)"); - } else if (FieldType.Dict.name().equals(type.name())) { - sb.append("VARCHAR(10)"); } else if (FieldType.Byte.name().equals(type.name())) { sb.append("TINYINT(3)"); + } else if (FieldType.Bytes.name().equals(type.name())) { + sb.append("BLOB"); + } else if (FieldType.Character.name().equals(type.name())) { + sb.append("CHAR(1)"); } else if (FieldType.Short.name().equals(type.name())) { sb.append("SMALLINT(5)"); } else if (FieldType.Integer.name().equals(type.name())) { @@ -33,11 +35,12 @@ public class MySQLDBmapper extends AbstractDBmapper { } else if (FieldType.Double.name().equals(type.name())) { sb.append("DOUBLE"); } else if (FieldType.Date.name().equals(type.name())) { - sb.append("INTEGER"); - } else if (FieldType.Bytes.name().equals(type.name())) { - sb.append("BLOB"); - } else if (FieldType.Character.name().equals(type.name())) { - sb.append("CHAR(1)"); + sb.append("DATETIME"); + } else if (FieldType.BigDecimal.name().equals(type.name())) { + sb.append("NUMERIC"); + } else if (FieldType.Dict.name().equals(type.name())) { + Integer fieldLength = field.getFieldLength(); + sb.append("VARCHAR(" + fieldLength + ")"); } else if (FieldType.String_1.name().equals(type.name())) { sb.append("CHAR(1)"); } else if (FieldType.String_10.name().equals(type.name())) { @@ -102,6 +105,10 @@ public class MySQLDBmapper extends AbstractDBmapper { return "TINYINT"; } else if (FieldType.Byte.name().equals(type.name())) { return "TINYINT"; + } else if (FieldType.Bytes.name().equals(type.name())) { + return "BLOB"; + } else if (FieldType.Character.name().equals(type.name())) { + return "VARCHAR"; } else if (FieldType.Short.name().equals(type.name())) { return "SMALLINT"; } else if (FieldType.Integer.name().equals(type.name())) { @@ -112,7 +119,11 @@ public class MySQLDBmapper extends AbstractDBmapper { return "REAL"; } else if (FieldType.Double.name().equals(type.name())) { return "FLOAT"; - } else if (FieldType.Character.name().equals(type.name())) { + } else if (FieldType.Date.name().equals(type.name())) { + return "DATETIME"; + } else if (FieldType.BigDecimal.name().equals(type.name())) { + return "NUMERIC"; + } else if (FieldType.Dict.name().equals(type.name())) { return "VARCHAR"; } else if (FieldType.String_1.name().equals(type.name())) { return "CHAR"; @@ -132,10 +143,8 @@ public class MySQLDBmapper extends AbstractDBmapper { return "VARCHAR"; } else if (FieldType.String_var4000.name().equals(type.name())) { return "VARCHAR"; - } else if (FieldType.Date.name().equals(type.name())) { - return "DATETIME"; - } else if (FieldType.Bytes.name().equals(type.name())) { - return "BLOB"; + } else if (FieldType.String_super.name().equals(type.name())) { + return "LONGTEXT"; } else { return ""; } diff --git a/src/main/java/xyz/wbsite/dbtool/javafx/po/OracleDBmapper.java b/src/main/java/xyz/wbsite/dbtool/javafx/po/OracleDBmapper.java index 819ece4e..2edf277a 100644 --- a/src/main/java/xyz/wbsite/dbtool/javafx/po/OracleDBmapper.java +++ b/src/main/java/xyz/wbsite/dbtool/javafx/po/OracleDBmapper.java @@ -14,10 +14,12 @@ public class OracleDBmapper extends AbstractDBmapper { if (FieldType.Boolean.name().equals(type.name())) { sb.append("CHAR(1)"); - } else if (FieldType.Dict.name().equals(type.name())) { - sb.append("VARCHAR(10)"); } else if (FieldType.Byte.name().equals(type.name())) { sb.append("NUMBER(3)"); + } else if (FieldType.Bytes.name().equals(type.name())) { + sb.append("BLOB"); + } else if (FieldType.Character.name().equals(type.name())) { + sb.append("CHAR(1)"); } else if (FieldType.Short.name().equals(type.name())) { sb.append("NUMBER(5)"); } else if (FieldType.Integer.name().equals(type.name())) { @@ -30,10 +32,11 @@ public class OracleDBmapper extends AbstractDBmapper { sb.append("NUMBER"); } else if (FieldType.Date.name().equals(type.name())) { sb.append("DATE"); - } else if (FieldType.Bytes.name().equals(type.name())) { - sb.append("BLOB"); - } else if (FieldType.Character.name().equals(type.name())) { - sb.append("CHAR(1)"); + } else if (FieldType.BigDecimal.name().equals(type.name())) { + sb.append("NUMBER"); + } else if (FieldType.Dict.name().equals(type.name())) { + Integer fieldLength = field.getFieldLength(); + sb.append("VARCHAR(" + fieldLength + ")"); } else if (FieldType.String_1.name().equals(type.name())) { sb.append("CHAR(1)"); } else if (FieldType.String_10.name().equals(type.name())) { diff --git a/src/main/java/xyz/wbsite/dbtool/javafx/po/SQLiteDBmapper.java b/src/main/java/xyz/wbsite/dbtool/javafx/po/SQLiteDBmapper.java index d5143ff7..958fd49c 100644 --- a/src/main/java/xyz/wbsite/dbtool/javafx/po/SQLiteDBmapper.java +++ b/src/main/java/xyz/wbsite/dbtool/javafx/po/SQLiteDBmapper.java @@ -36,10 +36,11 @@ public class SQLiteDBmapper extends AbstractDBmapper { sb.append("DOUBLE"); } else if (FieldType.Date.name().equals(type.name())) { sb.append("DATETIME"); - } else if (FieldType.Dict.name().equals(type.name())) { - sb.append("VARCHAR(10)"); } else if (FieldType.BigDecimal.name().equals(type.name())) { sb.append("INTEGER"); + } else if (FieldType.Dict.name().equals(type.name())) { + Integer fieldLength = field.getFieldLength(); + sb.append("VARCHAR(" + fieldLength + ")"); } else if (FieldType.String_1.name().equals(type.name())) { sb.append("CHAR(1)"); } else if (FieldType.String_10.name().equals(type.name())) { diff --git a/src/main/resources/modules/SpringBoot/java/module/system/ent/Resource.java b/src/main/resources/modules/SpringBoot/java/module/system/ent/Resource.java new file mode 100644 index 00000000..1cd56dd3 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/ent/Resource.java @@ -0,0 +1,74 @@ +package ${basePackage}.module.system.ent; + +import ${basePackage}.frame.excel.annotation.ColumnDescription; +import ${basePackage}.frame.excel.annotation.ColumnName; +import ${basePackage}.frame.excel.annotation.SheetName; +import ${basePackage}.frame.base.BaseEntity; + +/** + * RESOURCE - 资源 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +@SheetName("资源") +public class Resource extends BaseEntity { + + /** + * VALUE - 资源内容 + */ + @ColumnName("资源内容") + @ColumnDescription("") + private String value; + /** + * COMMENT - 资源描述 + */ + @ColumnName("资源描述") + @ColumnDescription("") + private String comment; + /** + * RESOURCE_TYPE - 资源类型 + */ + @ColumnName("资源类型") + @ColumnDescription("") + private String resourceType; + /** + * VALID - 是否有效 + */ + @ColumnName("是否有效") + @ColumnDescription("") + private Boolean valid; + + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getComment() { + return this.comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + public String getResourceType() { + return this.resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public Boolean getValid() { + return this.valid; + } + + public void setValid(Boolean valid) { + this.valid = valid; + } +} \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/ent/Tokens.java b/src/main/resources/modules/SpringBoot/java/module/system/ent/Tokens.java new file mode 100644 index 00000000..261c737a --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/ent/Tokens.java @@ -0,0 +1,173 @@ +package ${basePackage}.module.system.ent; + +import java.util.Date; +import ${basePackage}.frame.excel.annotation.ColumnDescription; +import ${basePackage}.frame.excel.annotation.ColumnName; +import ${basePackage}.frame.excel.annotation.SheetName; +import ${basePackage}.frame.base.BaseEntity; + +/** + * TOKENS - 通行证 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +@SheetName("通行证") +public class Tokens extends BaseEntity { + + /** + * USER_ID - 用户主键 + */ + @ColumnName("用户主键") + @ColumnDescription("") + private Long userId; + /** + * USER_NAME - 用户名称 + */ + @ColumnName("用户名称") + @ColumnDescription("") + private String userName; + /** + * LOGIN_TIME - 登录时间 + */ + @ColumnName("登录时间") + @ColumnDescription("") + private Date loginTime; + /** + * VALID_TIME - 有效时间 + */ + @ColumnName("有效时间") + @ColumnDescription("") + private Date validTime; + /** + * VALID - 是否有效 + */ + @ColumnName("是否有效") + @ColumnDescription("") + private Boolean valid; + /** + * DEPT_ID - 部门主键 + */ + @ColumnName("部门主键") + @ColumnDescription("") + private Long deptId; + /** + * DEPT_CODE - 部门代码 + */ + @ColumnName("部门代码") + @ColumnDescription("") + private String deptCode; + /** + * DEPT_NAME - 部门名称 + */ + @ColumnName("部门名称") + @ColumnDescription("") + private String deptName; + /** + * TERMINAL_TYPE - 终端类型 + */ + @ColumnName("终端类型") + @ColumnDescription("") + private String terminalType; + /** + * TERMINAL_IP - 终端地址 + */ + @ColumnName("终端地址") + @ColumnDescription("") + private String terminalIp; + /** + * TERMINAL_INFO - 终端信息 + */ + @ColumnName("终端信息") + @ColumnDescription("") + private String terminalInfo; + + public Long getUserId() { + return this.userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getUserName() { + return this.userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public Date getLoginTime() { + return this.loginTime; + } + + public void setLoginTime(Date loginTime) { + this.loginTime = loginTime; + } + + public Date getValidTime() { + return this.validTime; + } + + public void setValidTime(Date validTime) { + this.validTime = validTime; + } + + public Boolean getValid() { + return this.valid; + } + + public void setValid(Boolean valid) { + this.valid = valid; + } + + public Long getDeptId() { + return this.deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + public String getDeptCode() { + return this.deptCode; + } + + public void setDeptCode(String deptCode) { + this.deptCode = deptCode; + } + + public String getDeptName() { + return this.deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + public String getTerminalType() { + return this.terminalType; + } + + public void setTerminalType(String terminalType) { + this.terminalType = terminalType; + } + + public String getTerminalIp() { + return this.terminalIp; + } + + public void setTerminalIp(String terminalIp) { + this.terminalIp = terminalIp; + } + + public String getTerminalInfo() { + return this.terminalInfo; + } + + public void setTerminalInfo(String terminalInfo) { + this.terminalInfo = terminalInfo; + } +} \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/ResourceManager.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/ResourceManager.java new file mode 100644 index 00000000..453bac22 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/ResourceManager.java @@ -0,0 +1,60 @@ +package ${basePackage}.module.system.mgr; + +import ${basePackage}.module.system.req.*; +import ${basePackage}.module.system.rsp.*; +import ${basePackage}.frame.base.Token; + +/** + * 资源 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public interface ResourceManager { + + /** + * 插入 + * + * @param request 请求对象 + * @param token 令牌 + * @return + */ + ResourceCreateResponse create(ResourceCreateRequest request, Token token); + + /** + * 逻辑删除 + * + * @param request 请求对象 + * @param token 令牌 + * @return + */ + ResourceDeleteResponse delete(ResourceDeleteRequest request, Token token); + + /** + * 更新 + * + * @param request 请求对象 + * @param token 令牌 + * @return + */ + ResourceUpdateResponse update(ResourceUpdateRequest request, Token token); + + /** + * 查询 + * + * @param request 请求对象 + * @param token 令牌 + * @return + */ + ResourceFindResponse find(ResourceFindRequest request, Token token); + + /** + * 获得对象 + * + * @param request 请求对象 + * @param token 令牌 + * @return + */ + ResourceGetResponse get(ResourceGetRequest request, Token token); +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/ResourceManagerImpl.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/ResourceManagerImpl.java new file mode 100644 index 00000000..9fedf654 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/ResourceManagerImpl.java @@ -0,0 +1,167 @@ +package ${basePackage}.module.system.mgr; + +import ${basePackage}.frame.utils.IDgenerator; +import ${basePackage}.frame.utils.Message; +import ${basePackage}.frame.base.ErrorType; +import ${basePackage}.frame.base.Token; +import ${basePackage}.frame.utils.MapperUtil; +import ${basePackage}.frame.utils.ValidationUtil; +import ${basePackage}.module.system.ent.Resource; +import ${basePackage}.module.system.mpr.ResourceMapper; +import ${basePackage}.module.system.req.*; +import ${basePackage}.module.system.rsp.*; +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; + +/** + * RESOURCE - 资源 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +@Transactional +@Service +public class ResourceManagerImpl implements ResourceManager { + + @Autowired + private ResourceMapper resourceMapper; + + /** + * 插入 + * + * @param request 请求对象 + * @param token 令牌 + * @return 响应 + */ + public ResourceCreateResponse create(ResourceCreateRequest request, Token token) { + ResourceCreateResponse response = new ResourceCreateResponse(); + + ValidationUtil.validate(request, response); + if (response.hasError()) { + return response; + } + + long id = IDgenerator.nextId(); + Resource entity = MapperUtil.map(request, Resource.class); + entity.setId(id); + + long result = resourceMapper.insert(entity, token); + if (1L != result) { + response.addError(ErrorType.BUSINESS_ERROR, Message.CREATE_FAILURE); + return response; + } + response.setId(id); + + return response; + } + + /** + * 逻辑删除 + * + * @param request 请求对象 + * @param token 令牌 + * @return 响应 + */ + public ResourceDeleteResponse delete(ResourceDeleteRequest request, Token token) { + ResourceDeleteResponse response = new ResourceDeleteResponse(); + + ValidationUtil.validate(request, response); + if (response.hasError()) { + return response; + } + + long result = resourceMapper.delete(request, token); + if (1L != result) { + response.addError(ErrorType.BUSINESS_ERROR, Message.DELETE_FAILURE); + return response; + } + response.setResult(result); + + return response; + } + + /** + * 更新 + * + * @param request 请求对象 + * @param token 令牌 + * @return 响应 + */ + public ResourceUpdateResponse update(ResourceUpdateRequest request, Token token) { + ResourceUpdateResponse response = new ResourceUpdateResponse(); + + ValidationUtil.validate(request, response); + if (response.hasError()) { + return response; + } + + long result = resourceMapper.update(request, token); + if (1L != result) { + response.addError(ErrorType.BUSINESS_ERROR, Message.UPDATE_FAILURE); + return response; + } + response.setResult(result); + + return response; + } + + /** + * 查询 + * + * @param request 请求对象 + * @param token 令牌 + * @return 响应 + */ + @Transactional(readOnly = true) + public ResourceFindResponse find(ResourceFindRequest request, Token token) { + ResourceFindResponse response = new ResourceFindResponse(); + + ValidationUtil.validate(request, response); + if (response.hasError()) { + return response; + } + + PageHelper.startPage(request.getPageNumber(), request.getPageSize()); + if (StringUtil.isNotEmpty(request.getSortKey())) { + PageHelper.orderBy(request.getSortKey() + " " + request.getSortType()); + } + PageInfo pageInfo = new PageInfo<>(resourceMapper.find(request, token)); + + response.setResult(pageInfo.getList()); + response.setTotalCount(pageInfo.getTotal()); + + return response; + } + + /** + * 获得对象 + * + * @param request 请求对象 + * @param token 令牌 + * @return 响应 + */ + @Transactional(readOnly = true) + public ResourceGetResponse get(ResourceGetRequest request, Token token) { + ResourceGetResponse response = new ResourceGetResponse(); + + ValidationUtil.validate(request, response); + if (response.hasError()) { + return response; + } + + Resource po = resourceMapper.get(request, token); + + if (po != null) { + response.setResource(po); + } else { + response.addError(ErrorType.BUSINESS_ERROR, Message.GET_FAILURE); + } + + return response; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/TokensManager.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/TokensManager.java new file mode 100644 index 00000000..6d128b76 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/TokensManager.java @@ -0,0 +1,60 @@ +package ${basePackage}.module.system.mgr; + +import ${basePackage}.module.system.req.*; +import ${basePackage}.module.system.rsp.*; +import ${basePackage}.frame.base.Token; + +/** + * 通行证 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public interface TokensManager { + + /** + * 插入 + * + * @param request 请求对象 + * @param token 令牌 + * @return + */ + TokensCreateResponse create(TokensCreateRequest request, Token token); + + /** + * 逻辑删除 + * + * @param request 请求对象 + * @param token 令牌 + * @return + */ + TokensDeleteResponse delete(TokensDeleteRequest request, Token token); + + /** + * 更新 + * + * @param request 请求对象 + * @param token 令牌 + * @return + */ + TokensUpdateResponse update(TokensUpdateRequest request, Token token); + + /** + * 查询 + * + * @param request 请求对象 + * @param token 令牌 + * @return + */ + TokensFindResponse find(TokensFindRequest request, Token token); + + /** + * 获得对象 + * + * @param request 请求对象 + * @param token 令牌 + * @return + */ + TokensGetResponse get(TokensGetRequest request, Token token); +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/TokensManagerImpl.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/TokensManagerImpl.java new file mode 100644 index 00000000..f9ec78a2 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/TokensManagerImpl.java @@ -0,0 +1,167 @@ +package ${basePackage}.module.system.mgr; + +import ${basePackage}.frame.utils.IDgenerator; +import ${basePackage}.frame.utils.Message; +import ${basePackage}.frame.base.ErrorType; +import ${basePackage}.frame.base.Token; +import ${basePackage}.frame.utils.MapperUtil; +import ${basePackage}.frame.utils.ValidationUtil; +import ${basePackage}.module.system.ent.Tokens; +import ${basePackage}.module.system.mpr.TokensMapper; +import ${basePackage}.module.system.req.*; +import ${basePackage}.module.system.rsp.*; +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; + +/** + * TOKENS - 通行证 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +@Transactional +@Service +public class TokensManagerImpl implements TokensManager { + + @Autowired + private TokensMapper tokensMapper; + + /** + * 插入 + * + * @param request 请求对象 + * @param token 令牌 + * @return 响应 + */ + public TokensCreateResponse create(TokensCreateRequest request, Token token) { + TokensCreateResponse response = new TokensCreateResponse(); + + ValidationUtil.validate(request, response); + if (response.hasError()) { + return response; + } + + long id = IDgenerator.nextId(); + Tokens entity = MapperUtil.map(request, Tokens.class); + entity.setId(id); + + long result = tokensMapper.insert(entity, token); + if (1L != result) { + response.addError(ErrorType.BUSINESS_ERROR, Message.CREATE_FAILURE); + return response; + } + response.setId(id); + + return response; + } + + /** + * 逻辑删除 + * + * @param request 请求对象 + * @param token 令牌 + * @return 响应 + */ + public TokensDeleteResponse delete(TokensDeleteRequest request, Token token) { + TokensDeleteResponse response = new TokensDeleteResponse(); + + ValidationUtil.validate(request, response); + if (response.hasError()) { + return response; + } + + long result = tokensMapper.delete(request, token); + if (1L != result) { + response.addError(ErrorType.BUSINESS_ERROR, Message.DELETE_FAILURE); + return response; + } + response.setResult(result); + + return response; + } + + /** + * 更新 + * + * @param request 请求对象 + * @param token 令牌 + * @return 响应 + */ + public TokensUpdateResponse update(TokensUpdateRequest request, Token token) { + TokensUpdateResponse response = new TokensUpdateResponse(); + + ValidationUtil.validate(request, response); + if (response.hasError()) { + return response; + } + + long result = tokensMapper.update(request, token); + if (1L != result) { + response.addError(ErrorType.BUSINESS_ERROR, Message.UPDATE_FAILURE); + return response; + } + response.setResult(result); + + return response; + } + + /** + * 查询 + * + * @param request 请求对象 + * @param token 令牌 + * @return 响应 + */ + @Transactional(readOnly = true) + public TokensFindResponse find(TokensFindRequest request, Token token) { + TokensFindResponse response = new TokensFindResponse(); + + ValidationUtil.validate(request, response); + if (response.hasError()) { + return response; + } + + PageHelper.startPage(request.getPageNumber(), request.getPageSize()); + if (StringUtil.isNotEmpty(request.getSortKey())) { + PageHelper.orderBy(request.getSortKey() + " " + request.getSortType()); + } + PageInfo pageInfo = new PageInfo<>(tokensMapper.find(request, token)); + + response.setResult(pageInfo.getList()); + response.setTotalCount(pageInfo.getTotal()); + + return response; + } + + /** + * 获得对象 + * + * @param request 请求对象 + * @param token 令牌 + * @return 响应 + */ + @Transactional(readOnly = true) + public TokensGetResponse get(TokensGetRequest request, Token token) { + TokensGetResponse response = new TokensGetResponse(); + + ValidationUtil.validate(request, response); + if (response.hasError()) { + return response; + } + + Tokens po = tokensMapper.get(request, token); + + if (po != null) { + response.setTokens(po); + } else { + response.addError(ErrorType.BUSINESS_ERROR, Message.GET_FAILURE); + } + + return response; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/ResourceMapper.java b/src/main/resources/modules/SpringBoot/java/module/system/mpr/ResourceMapper.java new file mode 100644 index 00000000..8d48cc0f --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/ResourceMapper.java @@ -0,0 +1,74 @@ +package ${basePackage}.module.system.mpr; + +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +import ${basePackage}.module.system.ent.Resource; +import ${basePackage}.module.system.req.*; +import ${basePackage}.frame.base.Token; + +/** + * RESOURCE - 资源 + * + * @author author + * @date 2019-12-19 + */ +@Mapper +public interface ResourceMapper { + + /** + * 插入 + * + * @param request 请求对象 + * @param token 令牌 + * @return 返回数量 + */ + long insert(@Param("request") Resource request, @Param("token") Token token); + + /** + * 批量插入 + * + * @param request 请求对象 + * @param token 令牌 + * @return 返回数量 + */ + long insertBatch(@Param("list") List request, @Param("token") Token token); + + /** + * 逻辑删除 + * + * @param request 请求对象 + * @param token 令牌 + * @return 返回数量 + */ + long delete(@Param("request") ResourceDeleteRequest request, @Param("token") Token token); + + /** + * 更新 + * + * @param request 请求对象 + * @param token 令牌 + * @return 返回数量 + */ + long update(@Param("request") ResourceUpdateRequest request, @Param("token") Token token); + + /** + * 查询 + * + * @param request 请求对象 + * @param token 令牌 + * @return 返回对象 + */ + List find(@Param("request") ResourceFindRequest request, @Param("token") Token token); + + /** + * 获得对象 + * + * @param request 请求对象 + * @param token 令牌 + * @return 返回对象 + */ + Resource get(@Param("request") ResourceGetRequest request, @Param("token") Token token); +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/ResourceMapper_MySQL.xml b/src/main/resources/modules/SpringBoot/java/module/system/mpr/ResourceMapper_MySQL.xml new file mode 100644 index 00000000..a2bea16f --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/ResourceMapper_MySQL.xml @@ -0,0 +1,140 @@ + + + + + `SYS_RESOURCE` + + + `ID`,`VALUE`,`COMMENT`,`RESOURCE_TYPE`,`VALID`,`ROW_VERSION`,`IS_DELETED`,`CREATE_BY`,`CREATE_TIME`,`LAST_UPDATE_BY`,`LAST_UPDATE_TIME` + + + + + + + + + + + + + + + + + + + + + + INSERT INTO + + ( + + ) + VALUES + ( + ${r"#"}{request.id}, + ${r"#"}{request.value,jdbcType=VARCHAR}, + ${r"#"}{request.comment,jdbcType=VARCHAR}, + ${r"#"}{request.resourceType,jdbcType=VARCHAR}, + ${r"#"}{request.valid,jdbcType=BIT}, + 0, + 0, + ${r"#"}{token.userId,jdbcType=NUMERIC}, + sysdate(), + NULL, + NULL + ) + + + + INSERT INTO + + ( + + ) + VALUES + + ( + ${r"#"}{item.id}, + ${r"#"}{item.value,jdbcType=VARCHAR}, + ${r"#"}{item.comment,jdbcType=VARCHAR}, + ${r"#"}{item.resourceType,jdbcType=VARCHAR}, + ${r"#"}{item.valid,jdbcType=BIT}, + 0, + 0, + ${r"#"}{token.userId,jdbcType=NUMERIC}, + sysdate(), + NULL, + NULL + ) + + + + + UPDATE + + SET `IS_DELETED` = 1 + WHERE `IS_DELETED` = 0 + AND `ID` = ${r"#"}{request.id} + + + + UPDATE + + SET + `VALUE` = ${r"#"}{request.value,jdbcType=VARCHAR}, + `COMMENT` = ${r"#"}{request.comment,jdbcType=VARCHAR}, + `RESOURCE_TYPE` = ${r"#"}{request.resourceType,jdbcType=VARCHAR}, + `VALID` = ${r"#"}{request.valid,jdbcType=BIT}, + `ROW_VERSION` = `ROW_VERSION` + 1, + `LAST_UPDATE_BY` = ${r"#"}{token.userId}, + `LAST_UPDATE_TIME` = sysdate() + WHERE + `IS_DELETED` = 0 + AND `ID` = ${r"#"}{request.id} + AND `ROW_VERSION` = ${r"#"}{request.rowVersion} + + + + \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/TokensMapper.java b/src/main/resources/modules/SpringBoot/java/module/system/mpr/TokensMapper.java new file mode 100644 index 00000000..3d8f8cec --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/TokensMapper.java @@ -0,0 +1,74 @@ +package ${basePackage}.module.system.mpr; + +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +import ${basePackage}.module.system.ent.Tokens; +import ${basePackage}.module.system.req.*; +import ${basePackage}.frame.base.Token; + +/** + * TOKENS - 通行证 + * + * @author author + * @date 2019-12-19 + */ +@Mapper +public interface TokensMapper { + + /** + * 插入 + * + * @param request 请求对象 + * @param token 令牌 + * @return 返回数量 + */ + long insert(@Param("request") Tokens request, @Param("token") Token token); + + /** + * 批量插入 + * + * @param request 请求对象 + * @param token 令牌 + * @return 返回数量 + */ + long insertBatch(@Param("list") List request, @Param("token") Token token); + + /** + * 逻辑删除 + * + * @param request 请求对象 + * @param token 令牌 + * @return 返回数量 + */ + long delete(@Param("request") TokensDeleteRequest request, @Param("token") Token token); + + /** + * 更新 + * + * @param request 请求对象 + * @param token 令牌 + * @return 返回数量 + */ + long update(@Param("request") TokensUpdateRequest request, @Param("token") Token token); + + /** + * 查询 + * + * @param request 请求对象 + * @param token 令牌 + * @return 返回对象 + */ + List find(@Param("request") TokensFindRequest request, @Param("token") Token token); + + /** + * 获得对象 + * + * @param request 请求对象 + * @param token 令牌 + * @return 返回对象 + */ + Tokens get(@Param("request") TokensGetRequest request, @Param("token") Token token); +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/TokensMapper_MySQL.xml b/src/main/resources/modules/SpringBoot/java/module/system/mpr/TokensMapper_MySQL.xml new file mode 100644 index 00000000..afec4c54 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/TokensMapper_MySQL.xml @@ -0,0 +1,189 @@ + + + + + `SYS_TOKENS` + + + `ID`,`USER_ID`,`USER_NAME`,`LOGIN_TIME`,`VALID_TIME`,`VALID`,`DEPT_ID`,`DEPT_CODE`,`DEPT_NAME`,`TERMINAL_TYPE`,`TERMINAL_IP`,`TERMINAL_INFO`,`ROW_VERSION`,`IS_DELETED`,`CREATE_BY`,`CREATE_TIME`,`LAST_UPDATE_BY`,`LAST_UPDATE_TIME` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO + + ( + + ) + VALUES + ( + ${r"#"}{request.id}, + ${r"#"}{request.userId,jdbcType=BIGINT}, + ${r"#"}{request.userName,jdbcType=VARCHAR}, + ${r"#"}{request.loginTime,jdbcType=TIMESTAMP}, + ${r"#"}{request.validTime,jdbcType=TIMESTAMP}, + ${r"#"}{request.valid,jdbcType=BIT}, + ${r"#"}{request.deptId,jdbcType=BIGINT}, + ${r"#"}{request.deptCode,jdbcType=VARCHAR}, + ${r"#"}{request.deptName,jdbcType=VARCHAR}, + ${r"#"}{request.terminalType,jdbcType=VARCHAR}, + ${r"#"}{request.terminalIp,jdbcType=VARCHAR}, + ${r"#"}{request.terminalInfo,jdbcType=VARCHAR}, + 0, + 0, + ${r"#"}{token.userId,jdbcType=NUMERIC}, + sysdate(), + NULL, + NULL + ) + + + + INSERT INTO + + ( + + ) + VALUES + + ( + ${r"#"}{item.id}, + ${r"#"}{item.userId,jdbcType=BIGINT}, + ${r"#"}{item.userName,jdbcType=VARCHAR}, + ${r"#"}{item.loginTime,jdbcType=TIMESTAMP}, + ${r"#"}{item.validTime,jdbcType=TIMESTAMP}, + ${r"#"}{item.valid,jdbcType=BIT}, + ${r"#"}{item.deptId,jdbcType=BIGINT}, + ${r"#"}{item.deptCode,jdbcType=VARCHAR}, + ${r"#"}{item.deptName,jdbcType=VARCHAR}, + ${r"#"}{item.terminalType,jdbcType=VARCHAR}, + ${r"#"}{item.terminalIp,jdbcType=VARCHAR}, + ${r"#"}{item.terminalInfo,jdbcType=VARCHAR}, + 0, + 0, + ${r"#"}{token.userId,jdbcType=NUMERIC}, + sysdate(), + NULL, + NULL + ) + + + + + UPDATE + + SET `IS_DELETED` = 1 + WHERE `IS_DELETED` = 0 + AND `ID` = ${r"#"}{request.id} + + + + UPDATE + + SET + `USER_ID` = ${r"#"}{request.userId,jdbcType=BIGINT}, + `USER_NAME` = ${r"#"}{request.userName,jdbcType=VARCHAR}, + `LOGIN_TIME` = ${r"#"}{request.loginTime,jdbcType=TIMESTAMP}, + `VALID_TIME` = ${r"#"}{request.validTime,jdbcType=TIMESTAMP}, + `VALID` = ${r"#"}{request.valid,jdbcType=BIT}, + `DEPT_ID` = ${r"#"}{request.deptId,jdbcType=BIGINT}, + `DEPT_CODE` = ${r"#"}{request.deptCode,jdbcType=VARCHAR}, + `DEPT_NAME` = ${r"#"}{request.deptName,jdbcType=VARCHAR}, + `TERMINAL_TYPE` = ${r"#"}{request.terminalType,jdbcType=VARCHAR}, + `TERMINAL_IP` = ${r"#"}{request.terminalIp,jdbcType=VARCHAR}, + `TERMINAL_INFO` = ${r"#"}{request.terminalInfo,jdbcType=VARCHAR}, + `ROW_VERSION` = `ROW_VERSION` + 1, + `LAST_UPDATE_BY` = ${r"#"}{token.userId}, + `LAST_UPDATE_TIME` = sysdate() + WHERE + `IS_DELETED` = 0 + AND `ID` = ${r"#"}{request.id} + AND `ROW_VERSION` = ${r"#"}{request.rowVersion} + + + + \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceCreateRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceCreateRequest.java new file mode 100644 index 00000000..94a6e9ad --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceCreateRequest.java @@ -0,0 +1,75 @@ +package ${basePackage}.module.system.req; + +import ${basePackage}.frame.base.BaseRequest; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.NotEmpty; +import org.hibernate.validator.constraints.Length; +import ${basePackage}.frame.validation.Dict; + +/** + * ResourceCreateRequest - 资源新增 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public class ResourceCreateRequest extends BaseRequest { + + /** + * 资源内容 + */ + @NotEmpty(message = "资源内容不能为空") + @Length(min = 0, max = 100, message = "资源内容长度不合法(0-100)") + private String value; + + /** + * 资源描述 + */ + @Length(min = 0, max = 255, message = "资源描述长度不合法(0-255)") + private String comment; + + /** + * 资源类型 + */ + @NotEmpty(message = "资源类型不能为NULL") + @Dict(name = "RESOURCE_TYPE") + private String resourceType; + + /** + * 是否有效 + */ + @NotNull(message = "是否有效不能为NULL") + private Boolean valid; + + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getComment() { + return this.comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + public String getResourceType() { + return this.resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public Boolean getValid() { + return this.valid; + } + + public void setValid(Boolean valid) { + this.valid = valid; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceDeleteRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceDeleteRequest.java new file mode 100644 index 00000000..90aa32ab --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceDeleteRequest.java @@ -0,0 +1,28 @@ +package ${basePackage}.module.system.req; + +import ${basePackage}.frame.base.BaseUpdateRequest; +import javax.validation.constraints.NotNull; + +/** + * ResourceDeleteRequest - 资源删除 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public class ResourceDeleteRequest extends BaseUpdateRequest { + + /** + * 主键 + */ + @NotNull(message = "主键不能为空") + private long id; + + public long getId() { + return this.id; + } + + public void setId(long id) { + this.id = id; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceFindRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceFindRequest.java new file mode 100644 index 00000000..e64d630b --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceFindRequest.java @@ -0,0 +1,67 @@ +package ${basePackage}.module.system.req; + +import ${basePackage}.frame.base.BaseFindRequest; +import ${basePackage}.frame.validation.Dict; + +/** + * ResourceRequest - 资源查询 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public class ResourceFindRequest extends BaseFindRequest { + + /** + * 资源内容 + */ + private String value; + + /** + * 资源描述 + */ + private String comment; + + /** + * 资源类型 + */ + @Dict(name = "RESOURCE_TYPE") + private String resourceType; + + /** + * 是否有效 + */ + private Boolean valid; + + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getComment() { + return this.comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + public String getResourceType() { + return this.resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public Boolean getValid() { + return this.valid; + } + + public void setValid(Boolean valid) { + this.valid = valid; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceGetRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceGetRequest.java new file mode 100644 index 00000000..e4e82742 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceGetRequest.java @@ -0,0 +1,28 @@ +package ${basePackage}.module.system.req; + +import ${basePackage}.frame.base.BaseRequest; +import javax.validation.constraints.NotNull; + +/** + * ResourceGetRequest - 资源获取 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public class ResourceGetRequest extends BaseRequest { + + /** + * 主键 + */ + @NotNull(message = "主键不能为空") + private long id; + + public long getId() { + return this.id; + } + + public void setId(long id) { + this.id = id; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceUpdateRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceUpdateRequest.java new file mode 100644 index 00000000..3d80e303 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceUpdateRequest.java @@ -0,0 +1,89 @@ +package ${basePackage}.module.system.req; + +import ${basePackage}.frame.base.BaseUpdateRequest; +import javax.validation.constraints.NotNull; +import org.hibernate.validator.constraints.Length; +import javax.validation.constraints.NotEmpty; +import ${basePackage}.frame.validation.Dict; + +/** + * ResourceUpdateRequest - 资源更新 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public class ResourceUpdateRequest extends BaseUpdateRequest { + + /** + * 主键 + */ + @NotNull(message = "主键不能为NULL") + private Long id; + + /** + * 资源内容 + */ + @NotEmpty(message = "资源内容不能为空") + @Length(min = 0, max = 100, message = "资源内容长度不合法(0-100)") + private String value; + + /** + * 资源描述 + */ + @Length(min = 0, max = 255, message = "资源描述长度不合法(0-255)") + private String comment; + + /** + * 资源类型 + */ + @NotNull(message = "资源类型不能为NULL") + @Dict(name = "RESOURCE_TYPE") + private String resourceType; + + /** + * 是否有效 + */ + @NotNull(message = "是否有效不能为NULL") + private Boolean valid; + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getComment() { + return this.comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + public String getResourceType() { + return this.resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public Boolean getValid() { + return this.valid; + } + + public void setValid(Boolean valid) { + this.valid = valid; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/TokensCreateRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/TokensCreateRequest.java new file mode 100644 index 00000000..8c3f18cb --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/TokensCreateRequest.java @@ -0,0 +1,172 @@ +package ${basePackage}.module.system.req; + +import ${basePackage}.frame.base.BaseRequest; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.NotEmpty; +import org.hibernate.validator.constraints.Length; +import java.util.Date; +import ${basePackage}.frame.validation.Dict; + +/** + * TokensCreateRequest - 通行证新增 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public class TokensCreateRequest extends BaseRequest { + + /** + * 用户主键 + */ + @NotNull(message = "用户主键不能为NULL") + private Long userId; + + /** + * 用户名称 + */ + @NotEmpty(message = "用户名称不能为空") + @Length(min = 0, max = 50, message = "用户名称长度不合法(0-50)") + private String userName; + + /** + * 登录时间 + */ + @NotNull(message = "登录时间不能为NULL") + private Date loginTime; + + /** + * 有效时间 + */ + @NotNull(message = "有效时间不能为NULL") + private Date validTime; + + /** + * 是否有效 + */ + @NotNull(message = "是否有效不能为NULL") + private Boolean valid; + + /** + * 部门主键 + */ + private Long deptId; + + /** + * 部门代码 + */ + @Length(min = 0, max = 50, message = "部门代码长度不合法(0-50)") + private String deptCode; + + /** + * 部门名称 + */ + @Length(min = 0, max = 100, message = "部门名称长度不合法(0-100)") + private String deptName; + + /** + * 终端类型 + */ + @Dict(name = "TERMINAL_TYPE") + private String terminalType; + + /** + * 终端地址 + */ + @Length(min = 0, max = 50, message = "终端地址长度不合法(0-50)") + private String terminalIp; + + /** + * 终端信息 + */ + @Length(min = 0, max = 100, message = "终端信息长度不合法(0-100)") + private String terminalInfo; + + public Long getUserId() { + return this.userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getUserName() { + return this.userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public Date getLoginTime() { + return this.loginTime; + } + + public void setLoginTime(Date loginTime) { + this.loginTime = loginTime; + } + + public Date getValidTime() { + return this.validTime; + } + + public void setValidTime(Date validTime) { + this.validTime = validTime; + } + + public Boolean getValid() { + return this.valid; + } + + public void setValid(Boolean valid) { + this.valid = valid; + } + + public Long getDeptId() { + return this.deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + public String getDeptCode() { + return this.deptCode; + } + + public void setDeptCode(String deptCode) { + this.deptCode = deptCode; + } + + public String getDeptName() { + return this.deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + public String getTerminalType() { + return this.terminalType; + } + + public void setTerminalType(String terminalType) { + this.terminalType = terminalType; + } + + public String getTerminalIp() { + return this.terminalIp; + } + + public void setTerminalIp(String terminalIp) { + this.terminalIp = terminalIp; + } + + public String getTerminalInfo() { + return this.terminalInfo; + } + + public void setTerminalInfo(String terminalInfo) { + this.terminalInfo = terminalInfo; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/TokensDeleteRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/TokensDeleteRequest.java new file mode 100644 index 00000000..48f01fcf --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/TokensDeleteRequest.java @@ -0,0 +1,28 @@ +package ${basePackage}.module.system.req; + +import ${basePackage}.frame.base.BaseUpdateRequest; +import javax.validation.constraints.NotNull; + +/** + * TokensDeleteRequest - 通行证删除 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public class TokensDeleteRequest extends BaseUpdateRequest { + + /** + * 主键 + */ + @NotNull(message = "主键不能为空") + private long id; + + public long getId() { + return this.id; + } + + public void setId(long id) { + this.id = id; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/TokensFindRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/TokensFindRequest.java new file mode 100644 index 00000000..7486e89e --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/TokensFindRequest.java @@ -0,0 +1,159 @@ +package ${basePackage}.module.system.req; + +import ${basePackage}.frame.base.BaseFindRequest; +import java.util.Date; +import ${basePackage}.frame.validation.Dict; + +/** + * TokensRequest - 通行证查询 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public class TokensFindRequest extends BaseFindRequest { + + /** + * 用户主键 + */ + private Long userId; + + /** + * 用户名称 + */ + private String userName; + + /** + * 登录时间 + */ + private Date loginTime; + + /** + * 有效时间 + */ + private Date validTime; + + /** + * 是否有效 + */ + private Boolean valid; + + /** + * 部门主键 + */ + private Long deptId; + + /** + * 部门代码 + */ + private String deptCode; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 终端类型 + */ + @Dict(name = "TERMINAL_TYPE") + private String terminalType; + + /** + * 终端地址 + */ + private String terminalIp; + + /** + * 终端信息 + */ + private String terminalInfo; + + public Long getUserId() { + return this.userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getUserName() { + return this.userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public Date getLoginTime() { + return this.loginTime; + } + + public void setLoginTime(Date loginTime) { + this.loginTime = loginTime; + } + + public Date getValidTime() { + return this.validTime; + } + + public void setValidTime(Date validTime) { + this.validTime = validTime; + } + + public Boolean getValid() { + return this.valid; + } + + public void setValid(Boolean valid) { + this.valid = valid; + } + + public Long getDeptId() { + return this.deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + public String getDeptCode() { + return this.deptCode; + } + + public void setDeptCode(String deptCode) { + this.deptCode = deptCode; + } + + public String getDeptName() { + return this.deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + public String getTerminalType() { + return this.terminalType; + } + + public void setTerminalType(String terminalType) { + this.terminalType = terminalType; + } + + public String getTerminalIp() { + return this.terminalIp; + } + + public void setTerminalIp(String terminalIp) { + this.terminalIp = terminalIp; + } + + public String getTerminalInfo() { + return this.terminalInfo; + } + + public void setTerminalInfo(String terminalInfo) { + this.terminalInfo = terminalInfo; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/TokensGetRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/TokensGetRequest.java new file mode 100644 index 00000000..53ca09dc --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/TokensGetRequest.java @@ -0,0 +1,28 @@ +package ${basePackage}.module.system.req; + +import ${basePackage}.frame.base.BaseRequest; +import javax.validation.constraints.NotNull; + +/** + * TokensGetRequest - 通行证获取 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public class TokensGetRequest extends BaseRequest { + + /** + * 主键 + */ + @NotNull(message = "主键不能为空") + private long id; + + public long getId() { + return this.id; + } + + public void setId(long id) { + this.id = id; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/TokensUpdateRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/TokensUpdateRequest.java new file mode 100644 index 00000000..2bd86caa --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/TokensUpdateRequest.java @@ -0,0 +1,186 @@ +package ${basePackage}.module.system.req; + +import ${basePackage}.frame.base.BaseUpdateRequest; +import javax.validation.constraints.NotNull; +import org.hibernate.validator.constraints.Length; +import javax.validation.constraints.NotEmpty; +import java.util.Date; +import ${basePackage}.frame.validation.Dict; + +/** + * TokensUpdateRequest - 通行证更新 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public class TokensUpdateRequest extends BaseUpdateRequest { + + /** + * 主键 + */ + @NotNull(message = "主键不能为NULL") + private Long id; + + /** + * 用户主键 + */ + @NotNull(message = "用户主键不能为NULL") + private Long userId; + + /** + * 用户名称 + */ + @NotEmpty(message = "用户名称不能为空") + @Length(min = 0, max = 50, message = "用户名称长度不合法(0-50)") + private String userName; + + /** + * 登录时间 + */ + @NotNull(message = "登录时间不能为NULL") + private Date loginTime; + + /** + * 有效时间 + */ + @NotNull(message = "有效时间不能为NULL") + private Date validTime; + + /** + * 是否有效 + */ + @NotNull(message = "是否有效不能为NULL") + private Boolean valid; + + /** + * 部门主键 + */ + private Long deptId; + + /** + * 部门代码 + */ + @Length(min = 0, max = 50, message = "部门代码长度不合法(0-50)") + private String deptCode; + + /** + * 部门名称 + */ + @Length(min = 0, max = 100, message = "部门名称长度不合法(0-100)") + private String deptName; + + /** + * 终端类型 + */ + @Dict(name = "TERMINAL_TYPE") + private String terminalType; + + /** + * 终端地址 + */ + @Length(min = 0, max = 50, message = "终端地址长度不合法(0-50)") + private String terminalIp; + + /** + * 终端信息 + */ + @Length(min = 0, max = 100, message = "终端信息长度不合法(0-100)") + private String terminalInfo; + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getUserId() { + return this.userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public String getUserName() { + return this.userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public Date getLoginTime() { + return this.loginTime; + } + + public void setLoginTime(Date loginTime) { + this.loginTime = loginTime; + } + + public Date getValidTime() { + return this.validTime; + } + + public void setValidTime(Date validTime) { + this.validTime = validTime; + } + + public Boolean getValid() { + return this.valid; + } + + public void setValid(Boolean valid) { + this.valid = valid; + } + + public Long getDeptId() { + return this.deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + public String getDeptCode() { + return this.deptCode; + } + + public void setDeptCode(String deptCode) { + this.deptCode = deptCode; + } + + public String getDeptName() { + return this.deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + public String getTerminalType() { + return this.terminalType; + } + + public void setTerminalType(String terminalType) { + this.terminalType = terminalType; + } + + public String getTerminalIp() { + return this.terminalIp; + } + + public void setTerminalIp(String terminalIp) { + this.terminalIp = terminalIp; + } + + public String getTerminalInfo() { + return this.terminalInfo; + } + + public void setTerminalInfo(String terminalInfo) { + this.terminalInfo = terminalInfo; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/ResourceCreateResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/ResourceCreateResponse.java new file mode 100644 index 00000000..5a69cfb3 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/ResourceCreateResponse.java @@ -0,0 +1,26 @@ +package ${basePackage}.module.system.rsp; + +import ${basePackage}.frame.base.BaseResponse; + +/** + * ResourceCreateResponse - 资源 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public class ResourceCreateResponse extends BaseResponse { + + /** + * ID + */ + private Long id; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/ResourceDeleteResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/ResourceDeleteResponse.java new file mode 100644 index 00000000..23aa49db --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/ResourceDeleteResponse.java @@ -0,0 +1,26 @@ +package ${basePackage}.module.system.rsp; + +import ${basePackage}.frame.base.BaseResponse; + +/** + * ResourceDeleteResponse - 资源 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public class ResourceDeleteResponse extends BaseResponse { + + /** + * 删除数目 + */ + private Long result; + + public Long getResult() { + return this.result; + } + + public void setResult(Long result) { + this.result = result; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/ResourceFindResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/ResourceFindResponse.java new file mode 100644 index 00000000..179f175d --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/ResourceFindResponse.java @@ -0,0 +1,14 @@ +package ${basePackage}.module.system.rsp; + +import ${basePackage}.frame.base.BaseFindResponse; +import ${basePackage}.module.system.ent.Resource; + +/** + * ResourceFindResponse - 资源 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public class ResourceFindResponse extends BaseFindResponse { +} \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/ResourceGetResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/ResourceGetResponse.java new file mode 100644 index 00000000..8bf19ba2 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/ResourceGetResponse.java @@ -0,0 +1,27 @@ +package ${basePackage}.module.system.rsp; + +import ${basePackage}.module.system.ent.Resource; +import ${basePackage}.frame.base.BaseResponse; + +/** + * ResourceGetResponse - 资源 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public class ResourceGetResponse extends BaseResponse { + + /** + * 资源 + */ + private Resource resource; + + public Resource getResource() { + return this.resource; + } + + public void setResource(Resource resource) { + this.resource = resource; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/ResourceUpdateResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/ResourceUpdateResponse.java new file mode 100644 index 00000000..7b771246 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/ResourceUpdateResponse.java @@ -0,0 +1,26 @@ +package ${basePackage}.module.system.rsp; + +import ${basePackage}.frame.base.BaseResponse; + +/** + * ResourceUpdateResponse - 资源 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public class ResourceUpdateResponse extends BaseResponse { + + /** + * 更新数目 + */ + private Long result; + + public Long getResult() { + return this.result; + } + + public void setResult(Long result) { + this.result = result; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/TokensCreateResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/TokensCreateResponse.java new file mode 100644 index 00000000..b230d4a9 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/TokensCreateResponse.java @@ -0,0 +1,26 @@ +package ${basePackage}.module.system.rsp; + +import ${basePackage}.frame.base.BaseResponse; + +/** + * TokensCreateResponse - 通行证 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public class TokensCreateResponse extends BaseResponse { + + /** + * ID + */ + private Long id; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/TokensDeleteResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/TokensDeleteResponse.java new file mode 100644 index 00000000..9de28f2d --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/TokensDeleteResponse.java @@ -0,0 +1,26 @@ +package ${basePackage}.module.system.rsp; + +import ${basePackage}.frame.base.BaseResponse; + +/** + * TokensDeleteResponse - 通行证 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public class TokensDeleteResponse extends BaseResponse { + + /** + * 删除数目 + */ + private Long result; + + public Long getResult() { + return this.result; + } + + public void setResult(Long result) { + this.result = result; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/TokensFindResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/TokensFindResponse.java new file mode 100644 index 00000000..f3de5de2 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/TokensFindResponse.java @@ -0,0 +1,14 @@ +package ${basePackage}.module.system.rsp; + +import ${basePackage}.frame.base.BaseFindResponse; +import ${basePackage}.module.system.ent.Tokens; + +/** + * TokensFindResponse - 通行证 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public class TokensFindResponse extends BaseFindResponse { +} \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/TokensGetResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/TokensGetResponse.java new file mode 100644 index 00000000..9756287f --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/TokensGetResponse.java @@ -0,0 +1,27 @@ +package ${basePackage}.module.system.rsp; + +import ${basePackage}.module.system.ent.Tokens; +import ${basePackage}.frame.base.BaseResponse; + +/** + * TokensGetResponse - 通行证 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public class TokensGetResponse extends BaseResponse { + + /** + * 通行证 + */ + private Tokens tokens; + + public Tokens getTokens() { + return this.tokens; + } + + public void setTokens(Tokens tokens) { + this.tokens = tokens; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/TokensUpdateResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/TokensUpdateResponse.java new file mode 100644 index 00000000..2d5bda05 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/TokensUpdateResponse.java @@ -0,0 +1,26 @@ +package ${basePackage}.module.system.rsp; + +import ${basePackage}.frame.base.BaseResponse; + +/** + * TokensUpdateResponse - 通行证 + * + * @author author + * @version 0.0.1 + * @since 2019-12-19 + */ +public class TokensUpdateResponse extends BaseResponse { + + /** + * 更新数目 + */ + private Long result; + + public Long getResult() { + return this.result; + } + + public void setResult(Long result) { + this.result = result; + } +} diff --git a/src/main/resources/modules/SpringBoot/resources/application-dev.ftl b/src/main/resources/modules/SpringBoot/resources/application-dev.ftl index a5a96a22..b3ba5502 100644 --- a/src/main/resources/modules/SpringBoot/resources/application-dev.ftl +++ b/src/main/resources/modules/SpringBoot/resources/application-dev.ftl @@ -37,7 +37,7 @@ spring.datasource.two.password=two_pwd spring.datasource.main.driver-class-name=com.mysql.jdbc.Driver spring.datasource.main.url=jdbc:mysql://192.168.31.81:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=false spring.datasource.main.username=test -spring.datasource.main.password=123456# mybatis +spring.datasource.main.password=123456 # 副数据库 spring.datasource.two.driver-class-name=com.mysql.jdbc.Driver @@ -72,7 +72,7 @@ spring.datasource.password=123456 spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.url=jdbc:mysql://192.168.31.81:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=false spring.datasource.username=test -spring.datasource.password=123456# mybatis +spring.datasource.password=123456 <#if dataBase == 'SQLite'> # SQLite spring.datasource.url=jdbc:sqlite::resource:example.db diff --git a/src/main/resources/modules/SpringBoot/resources/application-prod.ftl b/src/main/resources/modules/SpringBoot/resources/application-prod.ftl index 02ad5748..396665ff 100644 --- a/src/main/resources/modules/SpringBoot/resources/application-prod.ftl +++ b/src/main/resources/modules/SpringBoot/resources/application-prod.ftl @@ -37,7 +37,7 @@ spring.datasource.two.password=two_pwd spring.datasource.main.driver-class-name=com.mysql.jdbc.Driver spring.datasource.main.url=jdbc:mysql://192.168.31.81:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=false spring.datasource.main.username=test -spring.datasource.main.password=123456# mybatis +spring.datasource.main.password=123456 # 副数据库 spring.datasource.two.driver-class-name=com.mysql.jdbc.Driver @@ -72,7 +72,7 @@ spring.datasource.password=123456 spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.url=jdbc:mysql://192.168.31.81:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=false spring.datasource.username=test -spring.datasource.password=123456# mybatis +spring.datasource.password=123456 <#if dataBase == 'SQLite'> # SQLite spring.datasource.url=jdbc:sqlite::resource:example.db diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE_MySQL.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE_MySQL.sql index d2d69960..3d4ebb18 100644 --- a/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE_MySQL.sql +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE_MySQL.sql @@ -13,9 +13,9 @@ CREATE TABLE `SYS_DICT` ( `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', - `CREATE_TIME` INTEGER NOT NULL COMMENT '创建时间', + `CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间', `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', - `LAST_UPDATE_TIME` INTEGER DEFAULT NULL COMMENT '最后更新时间', + `LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间', PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字典'; @@ -35,9 +35,9 @@ CREATE TABLE `SYS_DICT_ITEM` ( `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', - `CREATE_TIME` INTEGER NOT NULL COMMENT '创建时间', + `CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间', `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', - `LAST_UPDATE_TIME` INTEGER DEFAULT NULL COMMENT '最后更新时间', + `LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间', PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字典项'; @@ -50,7 +50,7 @@ PRIMARY KEY (`ID`) CREATE TABLE `SYS_FILE` ( `ID` BIGINT(20) NOT NULL COMMENT '主键', `NAME` VARCHAR(250) COMMENT '文件名称', - `FILE_TYPE` VARCHAR(10) COMMENT '文件类型', + `FILE_TYPE` VARCHAR(20) COMMENT '文件类型', `ATTRIBUTE1` VARCHAR(50) COMMENT '扩展属性1', `ATTRIBUTE2` VARCHAR(50) COMMENT '扩展属性2', `LOCATION` VARCHAR(500) COMMENT '存放地址', @@ -59,9 +59,57 @@ CREATE TABLE `SYS_FILE` ( `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', - `CREATE_TIME` INTEGER NOT NULL COMMENT '创建时间', + `CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间', `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', - `LAST_UPDATE_TIME` INTEGER DEFAULT NULL COMMENT '最后更新时间', + `LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间', PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文件'; +-- ---------------------------- +-- Table structure for RESOURCE - 资源 +-- Target : MySQL +-- Author : author +-- Date: : 2019-12-19 +-- ---------------------------- +CREATE TABLE `SYS_RESOURCE` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键', + `VALUE` VARCHAR(100) NOT NULL COMMENT '资源内容', + `COMMENT` VARCHAR(250) COMMENT '资源描述', + `RESOURCE_TYPE` VARCHAR(20) NOT NULL COMMENT '资源类型', + `VALID` TINYINT(1) NOT NULL COMMENT '是否有效', + `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', + `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', + `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', + `CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间', + `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', + `LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间', +PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='资源'; + +-- ---------------------------- +-- Table structure for TOKENS - 通行证 +-- Target : MySQL +-- Author : author +-- Date: : 2019-12-19 +-- ---------------------------- +CREATE TABLE `SYS_TOKENS` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键', + `USER_ID` BIGINT(20) NOT NULL COMMENT '用户主键', + `USER_NAME` VARCHAR(50) NOT NULL COMMENT '用户名称', + `LOGIN_TIME` DATETIME NOT NULL COMMENT '登录时间', + `VALID_TIME` DATETIME NOT NULL COMMENT '有效时间', + `VALID` TINYINT(1) NOT NULL COMMENT '是否有效', + `DEPT_ID` BIGINT(20) COMMENT '部门主键', + `DEPT_CODE` VARCHAR(50) COMMENT '部门代码', + `DEPT_NAME` VARCHAR(100) COMMENT '部门名称', + `TERMINAL_TYPE` VARCHAR(20) COMMENT '终端类型', + `TERMINAL_IP` VARCHAR(50) COMMENT '终端地址', + `TERMINAL_INFO` VARCHAR(100) COMMENT '终端信息', + `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', + `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', + `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', + `CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间', + `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', + `LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间', +PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='通行证'; diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE_Oracle.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE_Oracle.sql index 483922c1..65b49382 100644 --- a/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE_Oracle.sql +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE_Oracle.sql @@ -73,7 +73,7 @@ COMMENT ON COLUMN "SYS_DICT_ITEM"."LAST_UPDATE_TIME" is '最后更新时间'; CREATE TABLE "SYS_FILE" ( "ID" NUMBER(19) NOT NULL, "NAME" VARCHAR2(250) NULL, -"FILE_TYPE" VARCHAR(10) NULL, +"FILE_TYPE" VARCHAR(20) NULL, "ATTRIBUTE1" VARCHAR2(50) NULL, "ATTRIBUTE2" VARCHAR2(50) NULL, "LOCATION" VARCHAR2(500) NULL, diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE_SQLite.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE_SQLite.sql index 0918d6f0..70e03cf7 100644 --- a/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE_SQLite.sql +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/ALL_TABLE_SQLite.sql @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS SYS_FILE ( "ID" BIGINT PRIMARY KEY NOT NULL, "NAME" VARCHAR(250), - "FILE_TYPE" VARCHAR(10), + "FILE_TYPE" VARCHAR(20), "ATTRIBUTE1" VARCHAR(50), "ATTRIBUTE2" VARCHAR(50), "LOCATION" VARCHAR(500), diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_ITEM_MySQL.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_ITEM_MySQL.sql index 0aca2189..2ba81a24 100644 --- a/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_ITEM_MySQL.sql +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_ITEM_MySQL.sql @@ -14,8 +14,8 @@ CREATE TABLE `SYS_DICT_ITEM` ( `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', - `CREATE_TIME` INTEGER NOT NULL COMMENT '创建时间', + `CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间', `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', - `LAST_UPDATE_TIME` INTEGER DEFAULT NULL COMMENT '最后更新时间', + `LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间', PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字典项'; diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_MySQL.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_MySQL.sql index a1cec9de..16965943 100644 --- a/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_MySQL.sql +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/DICT_MySQL.sql @@ -13,8 +13,8 @@ CREATE TABLE `SYS_DICT` ( `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', - `CREATE_TIME` INTEGER NOT NULL COMMENT '创建时间', + `CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间', `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', - `LAST_UPDATE_TIME` INTEGER DEFAULT NULL COMMENT '最后更新时间', + `LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间', PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字典'; diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE_MySQL.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE_MySQL.sql index 9b3aede6..438b6b6a 100644 --- a/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE_MySQL.sql +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE_MySQL.sql @@ -7,7 +7,7 @@ CREATE TABLE `SYS_FILE` ( `ID` BIGINT(20) NOT NULL COMMENT '主键', `NAME` VARCHAR(250) COMMENT '文件名称', - `FILE_TYPE` VARCHAR(10) COMMENT '文件类型', + `FILE_TYPE` VARCHAR(20) COMMENT '文件类型', `ATTRIBUTE1` VARCHAR(50) COMMENT '扩展属性1', `ATTRIBUTE2` VARCHAR(50) COMMENT '扩展属性2', `LOCATION` VARCHAR(500) COMMENT '存放地址', @@ -16,8 +16,8 @@ CREATE TABLE `SYS_FILE` ( `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', - `CREATE_TIME` INTEGER NOT NULL COMMENT '创建时间', + `CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间', `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', - `LAST_UPDATE_TIME` INTEGER DEFAULT NULL COMMENT '最后更新时间', + `LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间', PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文件'; diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE_Oracle.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE_Oracle.sql index 97db02f7..560df725 100644 --- a/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE_Oracle.sql +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE_Oracle.sql @@ -7,7 +7,7 @@ CREATE TABLE "SYS_FILE" ( "ID" NUMBER(19) NOT NULL, "NAME" VARCHAR2(250) NULL, - "FILE_TYPE" VARCHAR(10) NULL, + "FILE_TYPE" VARCHAR(20) NULL, "ATTRIBUTE1" VARCHAR2(50) NULL, "ATTRIBUTE2" VARCHAR2(50) NULL, "LOCATION" VARCHAR2(500) NULL, diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE_SQLite.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE_SQLite.sql index 05ca02fe..49f082e9 100644 --- a/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE_SQLite.sql +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/FILE_SQLite.sql @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS SYS_FILE ( "ID" BIGINT PRIMARY KEY NOT NULL, "NAME" VARCHAR(250), - "FILE_TYPE" VARCHAR(10), + "FILE_TYPE" VARCHAR(20), "ATTRIBUTE1" VARCHAR(50), "ATTRIBUTE2" VARCHAR(50), "LOCATION" VARCHAR(500), diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/RESOURCE_MySQL.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/RESOURCE_MySQL.sql new file mode 100644 index 00000000..01921afb --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/RESOURCE_MySQL.sql @@ -0,0 +1,20 @@ +-- ---------------------------- +-- Table structure for RESOURCE - 资源 +-- Target : MySQL +-- Author : author +-- Date: : 2019-12-19 +-- ---------------------------- +CREATE TABLE `SYS_RESOURCE` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键', + `VALUE` VARCHAR(100) NOT NULL COMMENT '资源内容', + `COMMENT` VARCHAR(250) COMMENT '资源描述', + `RESOURCE_TYPE` VARCHAR(20) NOT NULL COMMENT '资源类型', + `VALID` TINYINT(1) NOT NULL COMMENT '是否有效', + `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', + `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', + `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', + `CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间', + `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', + `LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间', +PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='资源'; diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/TOKENS_MySQL.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/TOKENS_MySQL.sql new file mode 100644 index 00000000..f19d703b --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/TOKENS_MySQL.sql @@ -0,0 +1,27 @@ +-- ---------------------------- +-- Table structure for TOKENS - 通行证 +-- Target : MySQL +-- Author : author +-- Date: : 2019-12-19 +-- ---------------------------- +CREATE TABLE `SYS_TOKENS` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键', + `USER_ID` BIGINT(20) NOT NULL COMMENT '用户主键', + `USER_NAME` VARCHAR(50) NOT NULL COMMENT '用户名称', + `LOGIN_TIME` DATETIME NOT NULL COMMENT '登录时间', + `VALID_TIME` DATETIME NOT NULL COMMENT '有效时间', + `VALID` TINYINT(1) NOT NULL COMMENT '是否有效', + `DEPT_ID` BIGINT(20) COMMENT '部门主键', + `DEPT_CODE` VARCHAR(50) COMMENT '部门代码', + `DEPT_NAME` VARCHAR(100) COMMENT '部门名称', + `TERMINAL_TYPE` VARCHAR(20) COMMENT '终端类型', + `TERMINAL_IP` VARCHAR(50) COMMENT '终端地址', + `TERMINAL_INFO` VARCHAR(100) COMMENT '终端信息', + `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', + `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', + `CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户', + `CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间', + `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', + `LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间', +PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='通行证'; diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/wadmin.xml b/src/main/resources/modules/SpringBoot/resources/dbtool/wadmin.xml index 40aa76bf..cbd13f7e 100644 --- a/src/main/resources/modules/SpringBoot/resources/dbtool/wadmin.xml +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/wadmin.xml @@ -1,6 +1,6 @@ -EXAMPLE-WEB +wadmin com.example author false @@ -8,7 +8,7 @@ 系统 SYS_ -system +system_ true @@ -18,7 +18,7 @@ - + @@ -52,6 +52,7 @@ + @@ -77,8 +78,8 @@ - - + + @@ -107,12 +108,12 @@ - + - + @@ -123,6 +124,55 @@
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
diff --git a/src/main/resources/modules/SpringBoot/resources/templates/screen/index.ftl b/src/main/resources/modules/SpringBoot/resources/templates/screen/index.ftl index 2c376e71..5f84263a 100644 --- a/src/main/resources/modules/SpringBoot/resources/templates/screen/index.ftl +++ b/src/main/resources/modules/SpringBoot/resources/templates/screen/index.ftl @@ -18,6 +18,8 @@ 字典管理 文件管理 + 资源管理 + 登录管理 <#list modules as item> <#if item.hasHtml()> diff --git a/src/main/resources/modules/SpringBoot/resources/templates/screen/module/system/dictItem.ftl b/src/main/resources/modules/SpringBoot/resources/templates/screen/module/system/dictItem.ftl index 65bdebcd..e66740f6 100644 --- a/src/main/resources/modules/SpringBoot/resources/templates/screen/module/system/dictItem.ftl +++ b/src/main/resources/modules/SpringBoot/resources/templates/screen/module/system/dictItem.ftl @@ -185,11 +185,11 @@ }, formRules: { key: [ - {required: true, message: '请输入字典名称', trigger: 'blur'}, - {min: 1, max: 50, message: '长度在 3 到 5 个字符', trigger: 'blur'} + {required: true, message: '请输入字典键', trigger: 'blur'}, + {min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur'} ], value: [ - {required: true, message: '请输入字典代码', trigger: 'blur'}, + {required: true, message: '请输入字典值', trigger: 'blur'}, {min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur'} ], sort: [ diff --git a/src/main/resources/modules/SpringBoot/resources/templates/screen/module/system/resource.ftl b/src/main/resources/modules/SpringBoot/resources/templates/screen/module/system/resource.ftl new file mode 100644 index 00000000..dabaf811 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/templates/screen/module/system/resource.ftl @@ -0,0 +1,238 @@ +
+ + + + + + + + + + + + + + + + + + + 搜索 + 重置 + + + + + + + + 新增 + + 导出 + + + + + + + + + + + + + + + + + + + + + 取 消 + 保存 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ diff --git a/src/main/resources/modules/SpringBoot/resources/templates/screen/module/system/tokens.ftl b/src/main/resources/modules/SpringBoot/resources/templates/screen/module/system/tokens.ftl new file mode 100644 index 00000000..4988d54c --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/templates/screen/module/system/tokens.ftl @@ -0,0 +1,368 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + 搜索 + 重置 + + + + + + + + 新增 + + 导出 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 取 消 + 保存 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ diff --git a/src/main/resources/modules/SpringBoot/test/application.ftl b/src/main/resources/modules/SpringBoot/test/application.ftl index a5a96a22..b3ba5502 100644 --- a/src/main/resources/modules/SpringBoot/test/application.ftl +++ b/src/main/resources/modules/SpringBoot/test/application.ftl @@ -37,7 +37,7 @@ spring.datasource.two.password=two_pwd spring.datasource.main.driver-class-name=com.mysql.jdbc.Driver spring.datasource.main.url=jdbc:mysql://192.168.31.81:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=false spring.datasource.main.username=test -spring.datasource.main.password=123456# mybatis +spring.datasource.main.password=123456 # 副数据库 spring.datasource.two.driver-class-name=com.mysql.jdbc.Driver @@ -72,7 +72,7 @@ spring.datasource.password=123456 spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.url=jdbc:mysql://192.168.31.81:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=false spring.datasource.username=test -spring.datasource.password=123456# mybatis +spring.datasource.password=123456 <#if dataBase == 'SQLite'> # SQLite spring.datasource.url=jdbc:sqlite::resource:example.db