diff --git a/src/main/java/xyz/wbsite/dbtool/web/frame/utils/ResourceUtil.java b/src/main/java/xyz/wbsite/dbtool/web/frame/utils/ResourceUtil.java index c35183ab..5c1c1121 100644 --- a/src/main/java/xyz/wbsite/dbtool/web/frame/utils/ResourceUtil.java +++ b/src/main/java/xyz/wbsite/dbtool/web/frame/utils/ResourceUtil.java @@ -49,7 +49,8 @@ public class ResourceUtil extends ResourceUtils { ClassPathResource cpr = new ClassPathResource(resourcePath); File in = cpr.getFile(); for (File file : in.listFiles()) { - result.add(file.getName()); + String name = file.getName(); + if (name.matches(".+\\..+")) result.add(name); } return result; } catch (IOException e) { diff --git a/src/main/resources/modules/SpringBoot/java/action/ajax/system/AuthAjax.java b/src/main/resources/modules/SpringBoot/java/action/ajax/system/AuthAjax.java index 484276b8..e618b024 100644 --- a/src/main/resources/modules/SpringBoot/java/action/ajax/system/AuthAjax.java +++ b/src/main/resources/modules/SpringBoot/java/action/ajax/system/AuthAjax.java @@ -72,7 +72,7 @@ public class AuthAjax { response.addErrors(tokensCreateResponse.getErrors()); return response; } - Cookie cookie = CookieUtil.newCookie("token", tokensCreateRequest.getToken())); + Cookie cookie = CookieUtil.newCookie("token", tokensCreateRequest.getToken()); cookie.setPath("/"); httpServletResponse.addCookie(cookie); } @@ -124,7 +124,7 @@ public class AuthAjax { response.addErrors(tokensCreateResponse.getErrors()); return response; } - Cookie cookie = CookieUtil.newCookie("token", tokensCreateRequest.getToken())); + Cookie cookie = CookieUtil.newCookie("token", tokensCreateRequest.getToken()); cookie.setPath("/"); httpServletResponse.addCookie(cookie); } diff --git a/src/main/resources/modules/SpringBoot/java/frame/utils/ClassUtil.java b/src/main/resources/modules/SpringBoot/java/frame/utils/ClassUtil.java index bc1460e1..4013577e 100644 --- a/src/main/resources/modules/SpringBoot/java/frame/utils/ClassUtil.java +++ b/src/main/resources/modules/SpringBoot/java/frame/utils/ClassUtil.java @@ -1,8 +1,8 @@ package ${basePackage}.frame.utils; - import java.lang.reflect.Field; - import java.lang.reflect.Method; - import java.util.*; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.*; /** * ClassUtil 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 index 257b2832..15c07a69 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceCreateRequest.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceCreateRequest.java @@ -19,7 +19,7 @@ public class ResourceCreateRequest extends BaseRequest { * 资源内容 */ @NotBlank(message = "[value]资源内容不能为空") - @Length(min = 0, max = 100, message = "资源内容长度不合法(0-100)") + @Length(min = 0, max = 100, message = "[value]资源内容长度不合法(0-100)") private String value; /** @@ -31,7 +31,7 @@ public class ResourceCreateRequest extends BaseRequest { /** * 资源类型 */ - @NotBlank(message = "[resourceType]资源类型不能为NULL") + @NotNull(message = "[resourceType]资源类型不能为NULL") @Dict(name = "RESOURCE_TYPE") private String resourceType; @@ -41,6 +41,17 @@ public class ResourceCreateRequest extends BaseRequest { @NotNull(message = "[valid]是否有效不能为NULL") private Boolean valid; + /** + * 是否节点 + */ + @NotNull(message = "[node]是否节点不能为NULL") + private Boolean node; + + /** + * 上级主键 + */ + private Long supId; + public String getValue() { return this.value; } @@ -72,4 +83,20 @@ public class ResourceCreateRequest extends BaseRequest { public void setValid(Boolean valid) { this.valid = valid; } + + public Boolean getNode() { + return this.node; + } + + public void setNode(Boolean node) { + this.node = node; + } + + public Long getSupId() { + return this.supId; + } + + public void setSupId(Long supId) { + this.supId = supId; + } } 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 index e64d630b..67ba6ba4 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceFindRequest.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceFindRequest.java @@ -33,6 +33,16 @@ public class ResourceFindRequest extends BaseFindRequest { */ private Boolean valid; + /** + * 是否节点 + */ + private Boolean node; + + /** + * 上级主键 + */ + private Long supId; + public String getValue() { return this.value; } @@ -64,4 +74,20 @@ public class ResourceFindRequest extends BaseFindRequest { public void setValid(Boolean valid) { this.valid = valid; } -} + + public Boolean getNode() { + return this.node; + } + + public void setNode(Boolean node) { + this.node = node; + } + + public Long getSupId() { + return this.supId; + } + + public void setSupId(Long supId) { + this.supId = supId; + } +} \ No newline at end of file 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 index 29199a50..e4704d2c 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceUpdateRequest.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceUpdateRequest.java @@ -25,7 +25,7 @@ public class ResourceUpdateRequest extends BaseUpdateRequest { * 资源内容 */ @NotBlank(message = "[value]资源内容不能为空") - @Length(min = 0, max = 100, message = "资源内容长度不合法(0-100)") + @Length(min = 0, max = 100, message = "[value]资源内容长度不合法(0-100)") private String value; /** @@ -47,6 +47,17 @@ public class ResourceUpdateRequest extends BaseUpdateRequest { @NotNull(message = "[valid]是否有效不能为NULL") private Boolean valid; + /** + * 是否节点 + */ + @NotNull(message = "[node]是否节点不能为NULL") + private Boolean node; + + /** + * 上级主键 + */ + private Long supId; + public Long getId() { return this.id; } @@ -86,4 +97,20 @@ public class ResourceUpdateRequest extends BaseUpdateRequest { public void setValid(Boolean valid) { this.valid = valid; } + + public Boolean getNode() { + return this.node; + } + + public void setNode(Boolean node) { + this.node = node; + } + + public Long getSupId() { + return this.supId; + } + + public void setSupId(Long supId) { + this.supId = supId; + } } 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 index c82f0103..4bd6e5a7 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/req/TokensCreateRequest.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/TokensCreateRequest.java @@ -2,7 +2,7 @@ package ${basePackage}.module.system.req; import ${basePackage}.frame.base.BaseRequest; import javax.validation.constraints.NotNull; -import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotBlank; import org.hibernate.validator.constraints.Length; import java.util.Date; import ${basePackage}.frame.validation.Dict; @@ -19,7 +19,7 @@ public class TokensCreateRequest extends BaseRequest { /** * 登录令牌 */ - @NotEmpty(message = "[token]登录令牌不能为空") + @NotBlank(message = "[token]登录令牌不能为空") @Length(min = 0, max = 50, message = "[token]登录令牌长度不合法(0-50)") private String token; @@ -32,7 +32,7 @@ public class TokensCreateRequest extends BaseRequest { /** * 用户名称 */ - @NotEmpty(message = "[userName]用户名称不能为空") + @NotBlank(message = "[userName]用户名称不能为空") @Length(min = 0, max = 50, message = "[userName]用户名称长度不合法(0-50)") private String userName; 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 index 74a8981b..e7ea1431 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/req/TokensUpdateRequest.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/TokensUpdateRequest.java @@ -3,7 +3,7 @@ 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 javax.validation.constraints.NotBlank; import java.util.Date; import ${basePackage}.frame.validation.Dict; @@ -25,7 +25,7 @@ public class TokensUpdateRequest extends BaseUpdateRequest { /** * 登录令牌 */ - @NotEmpty(message = "[token]登录令牌不能为空") + @NotBlank(message = "[token]登录令牌不能为空") @Length(min = 0, max = 50, message = "[token]登录令牌长度不合法(0-50)") private String token; @@ -38,7 +38,7 @@ public class TokensUpdateRequest extends BaseUpdateRequest { /** * 用户名称 */ - @NotEmpty(message = "[userName]用户名称不能为空") + @NotBlank(message = "[userName]用户名称不能为空") @Length(min = 0, max = 50, message = "[userName]用户名称长度不合法(0-50)") private String userName;