diff --git a/src/main/resources/modules/SpringBoot/java/action/ajax/system/ResourceAjax.java b/src/main/resources/modules/SpringBoot/java/action/ajax/system/ResourceAjax.java index 22da2635..e6c7e094 100644 --- a/src/main/resources/modules/SpringBoot/java/action/ajax/system/ResourceAjax.java +++ b/src/main/resources/modules/SpringBoot/java/action/ajax/system/ResourceAjax.java @@ -1,32 +1,32 @@ -package xyz.wbsite.action.ajax.system; +package ${basePackage}.action.ajax.system; import com.fasterxml.jackson.core.TreeNode; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.multipart.MultipartFile; -import xyz.wbsite.frame.auth.LocalData; -import xyz.wbsite.frame.base.BaseResponse; -import xyz.wbsite.frame.base.ErrorType; -import xyz.wbsite.frame.excel.WSheet; -import xyz.wbsite.frame.excel.exception.ReadErrorException; -import xyz.wbsite.frame.excel.exception.TemplateNotMatchException; -import xyz.wbsite.frame.utils.LogUtil; -import xyz.wbsite.frame.utils.MapperUtil; -import xyz.wbsite.frame.utils.ResponseUtil; -import xyz.wbsite.frame.utils.ValidationUtil; -import xyz.wbsite.module.system.ent.Resource; -import xyz.wbsite.module.system.mgr.ResourceManager; -import xyz.wbsite.module.system.req.ResourceCreateRequest; -import xyz.wbsite.module.system.req.ResourceDeleteRequest; -import xyz.wbsite.module.system.req.ResourceFindRequest; -import xyz.wbsite.module.system.req.ResourceGetRequest; -import xyz.wbsite.module.system.req.ResourceLoadRequest; -import xyz.wbsite.module.system.req.ResourceUpdateRequest; -import xyz.wbsite.module.system.rsp.ResourceCreateResponse; -import xyz.wbsite.module.system.rsp.ResourceDeleteResponse; -import xyz.wbsite.module.system.rsp.ResourceFindResponse; -import xyz.wbsite.module.system.rsp.ResourceGetResponse; -import xyz.wbsite.module.system.rsp.ResourceLoadResponse; -import xyz.wbsite.module.system.rsp.ResourceUpdateResponse; +import ${basePackage}.frame.auth.LocalData; +import ${basePackage}.frame.base.BaseResponse; +import ${basePackage}.frame.base.ErrorType; +import ${basePackage}.frame.excel.WSheet; +import ${basePackage}.frame.excel.exception.ReadErrorException; +import ${basePackage}.frame.excel.exception.TemplateNotMatchException; +import ${basePackage}.frame.utils.LogUtil; +import ${basePackage}.frame.utils.MapperUtil; +import ${basePackage}.frame.utils.ResponseUtil; +import ${basePackage}.frame.utils.ValidationUtil; +import ${basePackage}.module.system.ent.Resource; +import ${basePackage}.module.system.mgr.ResourceManager; +import ${basePackage}.module.system.req.ResourceCreateRequest; +import ${basePackage}.module.system.req.ResourceDeleteRequest; +import ${basePackage}.module.system.req.ResourceFindRequest; +import ${basePackage}.module.system.req.ResourceGetRequest; +import ${basePackage}.module.system.req.ResourceLoadRequest; +import ${basePackage}.module.system.req.ResourceUpdateRequest; +import ${basePackage}.module.system.rsp.ResourceCreateResponse; +import ${basePackage}.module.system.rsp.ResourceDeleteResponse; +import ${basePackage}.module.system.rsp.ResourceFindResponse; +import ${basePackage}.module.system.rsp.ResourceGetResponse; +import ${basePackage}.module.system.rsp.ResourceLoadResponse; +import ${basePackage}.module.system.rsp.ResourceUpdateResponse; import java.io.IOException; import java.util.List; 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 index 7db635c6..65b74624 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/ent/Resource.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/ent/Resource.java @@ -10,11 +10,17 @@ import ${basePackage}.frame.base.BaseEntity; * * @author wangbing * @version 0.0.1 - * @since 2019-12-26 + * @since 2019-12-27 */ @SheetName("资源") public class Resource extends BaseEntity { + /** + * CODE - 资源代码 + */ + @ColumnName("资源代码") + @ColumnDescription("") + private String code; /** * VALUE - 资源内容 */ @@ -27,12 +33,6 @@ public class Resource extends BaseEntity { @ColumnName("资源描述") @ColumnDescription("") private String comment; - /** - * RESOURCE_MODULE - 资源模块 - */ - @ColumnName("资源模块") - @ColumnDescription("") - private String resourceModule; /** * RESOURCE_TYPE - 资源类型 */ @@ -46,6 +46,14 @@ public class Resource extends BaseEntity { @ColumnDescription("") private Boolean valid; + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + public String getValue() { return this.value; } @@ -62,14 +70,6 @@ public class Resource extends BaseEntity { this.comment = comment; } - public String getResourceModule() { - return this.resourceModule; - } - - public void setResourceModule(String resourceModule) { - this.resourceModule = resourceModule; - } - public String getResourceType() { return this.resourceType; } diff --git a/src/main/resources/modules/SpringBoot/java/module/system/ent/Role.java b/src/main/resources/modules/SpringBoot/java/module/system/ent/Role.java index a4bbf176..5723ccb8 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/ent/Role.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/ent/Role.java @@ -10,51 +10,51 @@ import ${basePackage}.frame.base.BaseEntity; * * @author wangbing * @version 0.0.1 - * @since 2017-01-01 + * @since 2019-12-27 */ @SheetName("角色") public class Role extends BaseEntity { /** - * ROLE_NAME - 角色名称 + * CODE - 角色代码 */ - @ColumnName("角色名称") + @ColumnName("角色代码") @ColumnDescription("") - private String roleName; + private String code; /** - * ROLE_CODE - 角色代码 + * NAME - 角色名称 */ - @ColumnName("角色代码") + @ColumnName("角色名称") @ColumnDescription("") - private String roleCode; + private String name; /** - * ROLE_COMMENT - 角色描述 + * COMMENT - 角色描述 */ @ColumnName("角色描述") @ColumnDescription("") - private String roleComment; + private String comment; - public String getRoleName() { - return this.roleName; + public String getCode() { + return this.code; } - public void setRoleName(String roleName) { - this.roleName = roleName; + public void setCode(String code) { + this.code = code; } - public String getRoleCode() { - return this.roleCode; + public String getName() { + return this.name; } - public void setRoleCode(String roleCode) { - this.roleCode = roleCode; + public void setName(String name) { + this.name = name; } - public String getRoleComment() { - return this.roleComment; + public String getComment() { + return this.comment; } - public void setRoleComment(String roleComment) { - this.roleComment = roleComment; + public void setComment(String comment) { + this.comment = comment; } } \ No newline at end of file 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 index 68e6b8eb..f5da25b3 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mgr/ResourceManagerImpl.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/ResourceManagerImpl.java @@ -184,8 +184,8 @@ public class ResourceManagerImpl implements ResourceManager { } @Override - public ResourceLoadResponse load(ResourceLoadRequest request, Token token) { - ResourceLoadResponse response = new ResourceLoadResponse(); + public ResourceTreeResponse load(ResourceTreeRequest request, Token token) { + ResourceTreeResponse response = new ResourceTreeResponse(); ValidationUtil.validate(request, response); if (response.hasError()) { @@ -196,7 +196,7 @@ public class ResourceManagerImpl implements ResourceManager { resourceFindRequest.setPageSize(0); resourceFindRequest.setValid(true); resourceFindRequest.setSortType(SortType.ASC); - resourceFindRequest.setSortKey("RESOURCE_MODULE,RESOURCE_TYPE"); + resourceFindRequest.setSortKey("CODE"); ResourceFindResponse resourceFindResponse = this.find(resourceFindRequest, token); if (resourceFindResponse.hasError()) { @@ -204,32 +204,38 @@ public class ResourceManagerImpl implements ResourceManager { return response; } - List data = new ArrayList<>(); - ResourceTree tree = null; - List checks = null; - - for (Resource resource : resourceFindResponse.getResult()) { - if (tree != null && tree.getResourceModule().equals(resource.getResourceModule())) { - - ResourceCheck check = new ResourceCheck(); - check.setResourceId(resource.getId()); - check.setResourceValue(resource.getValue()); - checks.add(check); - } else { - tree = new ResourceTree(); - data.add(tree); - tree.setResourceModule(resource.getResourceModule()); - checks = new ArrayList<>(); - tree.setResourceChecks(checks); - - ResourceCheck check = new ResourceCheck(); - check.setResourceId(resource.getId()); - check.setResourceValue(resource.getValue()); - checks.add(check); + Map map = new HashMap<>(); + List result = resourceFindResponse.getResult(); + // 获取最顶级资源 + + int level = 1; + while (result.size() > 0) { + Iterator iterator = result.iterator(); + while (iterator.hasNext()) { + Resource next = iterator.next(); + if (next.getCode() != null && next.getCode().split("_").length == level) { + ResourceTree tree = MapperUtil.map(next, ResourceTree.class); + map.put(tree.getCode(), tree); + iterator.remove(); + {//尝试获取上级资源 + String code = next.getCode(); + ResourceTree Ptree = null; + while (code.contains("_")) { + code = code.substring(0, code.lastIndexOf("_")); + Ptree = map.get(code); + if (Ptree != null) break; + } + if (Ptree != null){ + Ptree.getChildren().add(tree); + } else { + map.put(tree.getCode(), tree); + } + } + } } + level++; } - response.setData(data); return response; } } diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/MySQL_ResourceMapper.xml b/src/main/resources/modules/SpringBoot/java/module/system/mpr/MySQL_ResourceMapper.xml index e7a75ffe..358a90f0 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mpr/MySQL_ResourceMapper.xml +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/MySQL_ResourceMapper.xml @@ -7,14 +7,14 @@ `SYS_RESOURCE` - `ID`,`VALUE`,`COMMENT`,`RESOURCE_MODULE`,`RESOURCE_TYPE`,`VALID`,`ROW_VERSION`,`IS_DELETED`,`CREATE_BY`,`CREATE_TIME`,`LAST_UPDATE_BY`,`LAST_UPDATE_TIME` + `ID`,`CODE`,`VALUE`,`COMMENT`,`RESOURCE_TYPE`,`VALID`,`ROW_VERSION`,`IS_DELETED`,`CREATE_BY`,`CREATE_TIME`,`LAST_UPDATE_BY`,`LAST_UPDATE_TIME` + - @@ -32,15 +32,15 @@ WHERE `IS_DELETED` = 0 + + AND `CODE` = ${r"#"}{request.code} + AND `VALUE` = ${r"#"}{request.value} AND `COMMENT` = ${r"#"}{request.comment} - - AND `RESOURCE_MODULE` = ${r"#"}{request.resourceModule} - AND `RESOURCE_TYPE` = ${r"#"}{request.resourceType} @@ -70,9 +70,9 @@ VALUES ( ${r"#"}{request.id}, + ${r"#"}{request.code,jdbcType=VARCHAR}, ${r"#"}{request.value,jdbcType=VARCHAR}, ${r"#"}{request.comment,jdbcType=VARCHAR}, - ${r"#"}{request.resourceModule,jdbcType=VARCHAR}, ${r"#"}{request.resourceType,jdbcType=VARCHAR}, ${r"#"}{request.valid,jdbcType=BIT}, 0, @@ -94,9 +94,9 @@ ( ${r"#"}{item.id}, + ${r"#"}{item.code,jdbcType=VARCHAR}, ${r"#"}{item.value,jdbcType=VARCHAR}, ${r"#"}{item.comment,jdbcType=VARCHAR}, - ${r"#"}{item.resourceModule,jdbcType=VARCHAR}, ${r"#"}{item.resourceType,jdbcType=VARCHAR}, ${r"#"}{item.valid,jdbcType=BIT}, 0, @@ -121,9 +121,9 @@ UPDATE SET + `CODE` = ${r"#"}{request.code,jdbcType=VARCHAR}, `VALUE` = ${r"#"}{request.value,jdbcType=VARCHAR}, `COMMENT` = ${r"#"}{request.comment,jdbcType=VARCHAR}, - `RESOURCE_MODULE` = ${r"#"}{request.resourceModule,jdbcType=VARCHAR}, `RESOURCE_TYPE` = ${r"#"}{request.resourceType,jdbcType=VARCHAR}, `VALID` = ${r"#"}{request.valid,jdbcType=BIT}, `ROW_VERSION` = `ROW_VERSION` + 1, diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/MySQL_RoleMapper.xml b/src/main/resources/modules/SpringBoot/java/module/system/mpr/MySQL_RoleMapper.xml index 7b1e7979..dfe8b369 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mpr/MySQL_RoleMapper.xml +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/MySQL_RoleMapper.xml @@ -7,14 +7,14 @@ `SYS_ROLE` - `ID`,`ROLE_NAME`,`ROLE_CODE`,`ROLE_COMMENT`,`ROW_VERSION`,`IS_DELETED`,`CREATE_BY`,`CREATE_TIME`,`LAST_UPDATE_BY`,`LAST_UPDATE_TIME` + `ID`,`CODE`,`NAME`,`COMMENT`,`ROW_VERSION`,`IS_DELETED`,`CREATE_BY`,`CREATE_TIME`,`LAST_UPDATE_BY`,`LAST_UPDATE_TIME` - - - + + + @@ -30,14 +30,14 @@ WHERE `IS_DELETED` = 0 - - AND `ROLE_NAME` = ${r"#"}{request.roleName} + + AND `CODE` = ${r"#"}{request.code} - - AND `ROLE_CODE` = ${r"#"}{request.roleCode} + + AND `NAME` = ${r"#"}{request.name} - - AND `ROLE_COMMENT` = ${r"#"}{request.roleComment} + + AND `COMMENT` = ${r"#"}{request.comment} @@ -62,9 +62,9 @@ VALUES ( ${r"#"}{request.id}, - ${r"#"}{request.roleName,jdbcType=VARCHAR}, - ${r"#"}{request.roleCode,jdbcType=VARCHAR}, - ${r"#"}{request.roleComment,jdbcType=VARCHAR}, + ${r"#"}{request.code,jdbcType=VARCHAR}, + ${r"#"}{request.name,jdbcType=VARCHAR}, + ${r"#"}{request.comment,jdbcType=VARCHAR}, 0, 0, ${r"#"}{token.userId,jdbcType=NUMERIC}, @@ -84,9 +84,9 @@ ( ${r"#"}{item.id}, - ${r"#"}{item.roleName,jdbcType=VARCHAR}, - ${r"#"}{item.roleCode,jdbcType=VARCHAR}, - ${r"#"}{item.roleComment,jdbcType=VARCHAR}, + ${r"#"}{item.code,jdbcType=VARCHAR}, + ${r"#"}{item.name,jdbcType=VARCHAR}, + ${r"#"}{item.comment,jdbcType=VARCHAR}, 0, 0, ${r"#"}{token.userId,jdbcType=NUMERIC}, @@ -109,9 +109,9 @@ UPDATE SET - `ROLE_NAME` = ${r"#"}{request.roleName,jdbcType=VARCHAR}, - `ROLE_CODE` = ${r"#"}{request.roleCode,jdbcType=VARCHAR}, - `ROLE_COMMENT` = ${r"#"}{request.roleComment,jdbcType=VARCHAR}, + `CODE` = ${r"#"}{request.code,jdbcType=VARCHAR}, + `NAME` = ${r"#"}{request.name,jdbcType=VARCHAR}, + `COMMENT` = ${r"#"}{request.comment,jdbcType=VARCHAR}, `ROW_VERSION` = `ROW_VERSION` + 1, `LAST_UPDATE_BY` = ${r"#"}{token.userId}, `LAST_UPDATE_TIME` = sysdate() 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 d2370118..9771ebe3 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 @@ -11,10 +11,17 @@ import ${basePackage}.frame.validation.Dict; * * @author wangbing * @version 0.0.1 - * @since 2019-12-26 + * @since 2019-12-27 */ public class ResourceCreateRequest extends BaseRequest { + /** + * 资源代码 + */ + @NotEmpty(message = "[code]资源代码不能为空") + @Length(min = 0, max = 50, message = "[code]资源代码长度不合法(0-50)") + private String code; + /** * 资源内容 */ @@ -28,13 +35,6 @@ public class ResourceCreateRequest extends BaseRequest { @Length(min = 0, max = 255, message = "[comment]资源描述长度不合法(0-255)") private String comment; - /** - * 资源模块 - */ - @NotNull(message = "[resourceModule]资源模块不能为NULL") - @Dict(name = "RESOURCE_MODULE") - private String resourceModule; - /** * 资源类型 */ @@ -48,6 +48,14 @@ public class ResourceCreateRequest extends BaseRequest { @NotNull(message = "[valid]是否有效不能为NULL") private Boolean valid; + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + public String getValue() { return this.value; } @@ -64,14 +72,6 @@ public class ResourceCreateRequest extends BaseRequest { this.comment = comment; } - public String getResourceModule() { - return this.resourceModule; - } - - public void setResourceModule(String resourceModule) { - this.resourceModule = resourceModule; - } - public String getResourceType() { return this.resourceType; } 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 index ac760fa8..c734d985 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceDeleteRequest.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceDeleteRequest.java @@ -8,7 +8,7 @@ import javax.validation.constraints.NotNull; * * @author wangbing * @version 0.0.1 - * @since 2019-12-26 + * @since 2019-12-27 */ public class ResourceDeleteRequest extends BaseUpdateRequest { 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 e9f27c05..2a094f92 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 @@ -8,10 +8,15 @@ import ${basePackage}.frame.validation.Dict; * * @author wangbing * @version 0.0.1 - * @since 2019-12-26 + * @since 2019-12-27 */ public class ResourceFindRequest extends BaseFindRequest { + /** + * 资源代码 + */ + private String code; + /** * 资源内容 */ @@ -22,12 +27,6 @@ public class ResourceFindRequest extends BaseFindRequest { */ private String comment; - /** - * 资源模块 - */ - @Dict(name = "RESOURCE_MODULE") - private String resourceModule; - /** * 资源类型 */ @@ -39,6 +38,14 @@ public class ResourceFindRequest extends BaseFindRequest { */ private Boolean valid; + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + public String getValue() { return this.value; } @@ -55,14 +62,6 @@ public class ResourceFindRequest extends BaseFindRequest { this.comment = comment; } - public String getResourceModule() { - return this.resourceModule; - } - - public void setResourceModule(String resourceModule) { - this.resourceModule = resourceModule; - } - public String getResourceType() { return this.resourceType; } 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 index 80d88753..c00eea90 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceGetRequest.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceGetRequest.java @@ -8,7 +8,7 @@ import javax.validation.constraints.NotNull; * * @author wangbing * @version 0.0.1 - * @since 2019-12-26 + * @since 2019-12-27 */ public class ResourceGetRequest extends BaseRequest { diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceLoadRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceLoadRequest.java deleted file mode 100644 index 54dc4056..00000000 --- a/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceLoadRequest.java +++ /dev/null @@ -1,15 +0,0 @@ -package ${basePackage}.module.system.req; - -import ${basePackage}.frame.base.BaseRequest; - -/** - * ResourceGetRequest - 资源获取 - * - * @author wangbing - * @version 0.0.1 - * @since 2019-12-26 - */ -public class ResourceLoadRequest extends BaseRequest { - - -} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceTreeRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceTreeRequest.java new file mode 100644 index 00000000..a6f04b88 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/ResourceTreeRequest.java @@ -0,0 +1,14 @@ +package xyz.wbsite.module.system.req; + +import xyz.wbsite.frame.base.BaseRequest; + +/** + * ResourceTreeRequest - 资源获取 + * + * @author wangbing + * @version 0.0.1 + * @since 2019-12-26 + */ +public class ResourceTreeRequest extends BaseRequest { + +} 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 0c6570d0..3c2a9966 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 @@ -11,7 +11,7 @@ import ${basePackage}.frame.validation.Dict; * * @author wangbing * @version 0.0.1 - * @since 2019-12-26 + * @since 2019-12-27 */ public class ResourceUpdateRequest extends BaseUpdateRequest { @@ -21,6 +21,13 @@ public class ResourceUpdateRequest extends BaseUpdateRequest { @NotNull(message = "[id]主键不能为NULL") private Long id; + /** + * 资源代码 + */ + @NotEmpty(message = "[code]资源代码不能为空") + @Length(min = 0, max = 50, message = "[code]资源代码长度不合法(0-50)") + private String code; + /** * 资源内容 */ @@ -34,13 +41,6 @@ public class ResourceUpdateRequest extends BaseUpdateRequest { @Length(min = 0, max = 255, message = "[comment]资源描述长度不合法(0-255)") private String comment; - /** - * 资源模块 - */ - @NotNull(message = "[resourceModule]资源模块不能为NULL") - @Dict(name = "RESOURCE_MODULE") - private String resourceModule; - /** * 资源类型 */ @@ -62,6 +62,14 @@ public class ResourceUpdateRequest extends BaseUpdateRequest { this.id = id; } + public String getCode() { + return this.code; + } + + public void setCode(String code) { + this.code = code; + } + public String getValue() { return this.value; } @@ -78,14 +86,6 @@ public class ResourceUpdateRequest extends BaseUpdateRequest { this.comment = comment; } - public String getResourceModule() { - return this.resourceModule; - } - - public void setResourceModule(String resourceModule) { - this.resourceModule = resourceModule; - } - public String getResourceType() { return this.resourceType; } diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/RoleCreateRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/RoleCreateRequest.java index fda7c227..b920e51d 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/req/RoleCreateRequest.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/RoleCreateRequest.java @@ -10,51 +10,51 @@ import org.hibernate.validator.constraints.Length; * * @author wangbing * @version 0.0.1 - * @since 2019-12-24 + * @since 2019-12-27 */ public class RoleCreateRequest extends BaseRequest { /** - * 角色名称 + * 角色代码 */ - @NotEmpty(message = "[roleName]角色名称不能为空") - @Length(min = 0, max = 50, message = "[roleName]角色名称长度不合法(0-50)") - private String roleName; + @NotEmpty(message = "[code]角色代码不能为空") + @Length(min = 0, max = 50, message = "[code]角色代码长度不合法(0-50)") + private String code; /** - * 角色代码 + * 角色名称 */ - @NotEmpty(message = "[roleCode]角色代码不能为空") - @Length(min = 0, max = 50, message = "[roleCode]角色代码长度不合法(0-50)") - private String roleCode; + @NotEmpty(message = "[name]角色名称不能为空") + @Length(min = 0, max = 50, message = "[name]角色名称长度不合法(0-50)") + private String name; /** * 角色描述 */ - @Length(min = 0, max = 50, message = "[roleComment]角色描述长度不合法(0-50)") - private String roleComment; + @Length(min = 0, max = 50, message = "[comment]角色描述长度不合法(0-50)") + private String comment; - public String getRoleName() { - return this.roleName; + public String getCode() { + return this.code; } - public void setRoleName(String roleName) { - this.roleName = roleName; + public void setCode(String code) { + this.code = code; } - public String getRoleCode() { - return this.roleCode; + public String getName() { + return this.name; } - public void setRoleCode(String roleCode) { - this.roleCode = roleCode; + public void setName(String name) { + this.name = name; } - public String getRoleComment() { - return this.roleComment; + public String getComment() { + return this.comment; } - public void setRoleComment(String roleComment) { - this.roleComment = roleComment; + public void setComment(String comment) { + this.comment = comment; } } diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/RoleDeleteRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/RoleDeleteRequest.java index ee75ea7d..b4129fa6 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/req/RoleDeleteRequest.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/RoleDeleteRequest.java @@ -8,7 +8,7 @@ import javax.validation.constraints.NotNull; * * @author wangbing * @version 0.0.1 - * @since 2019-12-24 + * @since 2019-12-27 */ public class RoleDeleteRequest extends BaseUpdateRequest { diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/RoleFindRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/RoleFindRequest.java index 06a1b78e..7876a4fc 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/req/RoleFindRequest.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/RoleFindRequest.java @@ -7,46 +7,46 @@ import ${basePackage}.frame.base.BaseFindRequest; * * @author wangbing * @version 0.0.1 - * @since 2019-12-24 + * @since 2019-12-27 */ public class RoleFindRequest extends BaseFindRequest { /** - * 角色名称 + * 角色代码 */ - private String roleName; + private String code; /** - * 角色代码 + * 角色名称 */ - private String roleCode; + private String name; /** * 角色描述 */ - private String roleComment; + private String comment; - public String getRoleName() { - return this.roleName; + public String getCode() { + return this.code; } - public void setRoleName(String roleName) { - this.roleName = roleName; + public void setCode(String code) { + this.code = code; } - public String getRoleCode() { - return this.roleCode; + public String getName() { + return this.name; } - public void setRoleCode(String roleCode) { - this.roleCode = roleCode; + public void setName(String name) { + this.name = name; } - public String getRoleComment() { - return this.roleComment; + public String getComment() { + return this.comment; } - public void setRoleComment(String roleComment) { - this.roleComment = roleComment; + public void setComment(String comment) { + this.comment = comment; } } diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/RoleGetRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/RoleGetRequest.java index 075c0254..67a69b29 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/req/RoleGetRequest.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/RoleGetRequest.java @@ -8,7 +8,7 @@ import javax.validation.constraints.NotNull; * * @author wangbing * @version 0.0.1 - * @since 2019-12-24 + * @since 2019-12-27 */ public class RoleGetRequest extends BaseRequest { diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/RoleUpdateRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/RoleUpdateRequest.java index 34397dd9..a3e90749 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/req/RoleUpdateRequest.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/RoleUpdateRequest.java @@ -10,7 +10,7 @@ import javax.validation.constraints.NotEmpty; * * @author wangbing * @version 0.0.1 - * @since 2019-12-24 + * @since 2019-12-27 */ public class RoleUpdateRequest extends BaseUpdateRequest { @@ -21,24 +21,24 @@ public class RoleUpdateRequest extends BaseUpdateRequest { private Long id; /** - * 角色名称 + * 角色代码 */ - @NotEmpty(message = "[roleName]角色名称不能为空") - @Length(min = 0, max = 50, message = "[roleName]角色名称长度不合法(0-50)") - private String roleName; + @NotEmpty(message = "[code]角色代码不能为空") + @Length(min = 0, max = 50, message = "[code]角色代码长度不合法(0-50)") + private String code; /** - * 角色代码 + * 角色名称 */ - @NotEmpty(message = "[roleCode]角色代码不能为空") - @Length(min = 0, max = 50, message = "[roleCode]角色代码长度不合法(0-50)") - private String roleCode; + @NotEmpty(message = "[name]角色名称不能为空") + @Length(min = 0, max = 50, message = "[name]角色名称长度不合法(0-50)") + private String name; /** * 角色描述 */ - @Length(min = 0, max = 50, message = "[roleComment]角色描述长度不合法(0-50)") - private String roleComment; + @Length(min = 0, max = 50, message = "[comment]角色描述长度不合法(0-50)") + private String comment; public Long getId() { return this.id; @@ -48,27 +48,27 @@ public class RoleUpdateRequest extends BaseUpdateRequest { this.id = id; } - public String getRoleName() { - return this.roleName; + public String getCode() { + return this.code; } - public void setRoleName(String roleName) { - this.roleName = roleName; + public void setCode(String code) { + this.code = code; } - public String getRoleCode() { - return this.roleCode; + public String getName() { + return this.name; } - public void setRoleCode(String roleCode) { - this.roleCode = roleCode; + public void setName(String name) { + this.name = name; } - public String getRoleComment() { - return this.roleComment; + public String getComment() { + return this.comment; } - public void setRoleComment(String roleComment) { - this.roleComment = roleComment; + public void setComment(String comment) { + this.comment = comment; } } diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/ResourceLoadResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/ResourceLoadResponse.java deleted file mode 100644 index b763a112..00000000 --- a/src/main/resources/modules/SpringBoot/java/module/system/rsp/ResourceLoadResponse.java +++ /dev/null @@ -1,26 +0,0 @@ -package ${basePackage}.module.system.rsp; - -import ${basePackage}.frame.base.BaseResponse; -import ${basePackage}.module.system.ent.ResourceTree; - -import java.util.List; - -/** - * ResourceLoadResponse - 资源 - * - * @author author - * @version 0.0.1 - * @since 2017-01-01 - */ -public class ResourceLoadResponse extends BaseResponse { - - private List data; - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } -} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/ResourceTreeResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/ResourceTreeResponse.java new file mode 100644 index 00000000..496d14eb --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/ResourceTreeResponse.java @@ -0,0 +1,15 @@ +package xyz.wbsite.module.system.rsp; + +import xyz.wbsite.frame.base.BaseFindResponse; +import xyz.wbsite.module.system.ent.ResourceTree; + +/** + * ResourceTreeResponse - 资源 + * + * @author author + * @version 0.0.1 + * @since 2017-01-01 + */ +public class ResourceTreeResponse extends BaseFindResponse { + +} diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/MySQL_ALL_TABLE.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/MySQL_ALL_TABLE.sql index 26b154e5..5e2d000a 100644 --- a/src/main/resources/modules/SpringBoot/resources/dbtool/system/MySQL_ALL_TABLE.sql +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/MySQL_ALL_TABLE.sql @@ -2,14 +2,14 @@ -- Table structure for DICT - 字典 -- Target : MySQL -- Author : wangbing --- Date: : 2019-12-17 +-- Date: : 2019-12-27 -- ---------------------------- CREATE TABLE `SYS_DICT` ( `ID` BIGINT(20) NOT NULL COMMENT '主键', - `DICT_NAME` VARCHAR(50) NOT NULL COMMENT '字典名称', - `DICT_COMMENT` VARCHAR(50) NOT NULL COMMENT '字典描述', - `VERSION` VARCHAR(50) NOT NULL COMMENT '字典版本', - `VALID` TINYINT(1) NOT NULL COMMENT '是否有效', + `DICT_NAME` VARCHAR(50) COMMENT '字典名称', + `DICT_COMMENT` VARCHAR(50) COMMENT '字典描述', + `VERSION` VARCHAR(50) COMMENT '字典版本', + `VALID` TINYINT(1) 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 '创建用户', @@ -23,15 +23,15 @@ PRIMARY KEY (`ID`) -- Table structure for DICT_ITEM - 字典项 -- Target : MySQL -- Author : wangbing --- Date: : 2019-12-17 +-- Date: : 2019-12-27 -- ---------------------------- CREATE TABLE `SYS_DICT_ITEM` ( `ID` BIGINT(20) NOT NULL COMMENT '主键', - `DICT_NAME` VARCHAR(50) NOT NULL COMMENT '字典名称', - `KEY` VARCHAR(20) NOT NULL COMMENT '字典键', - `VALUE` VARCHAR(100) NOT NULL COMMENT '字典值', - `SORT` INTEGER(10) NOT NULL COMMENT '排序', - `VALID` TINYINT(1) NOT NULL COMMENT '是否有效', + `DICT_NAME` VARCHAR(50) COMMENT '字典名称', + `KEY` VARCHAR(20) COMMENT '字典键', + `VALUE` VARCHAR(50) COMMENT '字典值', + `SORT` INTEGER(10) COMMENT '排序', + `VALID` TINYINT(1) 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 '创建用户', @@ -42,20 +42,18 @@ PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='字典项'; -- ---------------------------- --- Table structure for FILE - 文件 +-- Table structure for RESOURCE - 资源 -- Target : MySQL -- Author : wangbing --- Date: : 2019-12-17 +-- Date: : 2019-12-27 -- ---------------------------- -CREATE TABLE `SYS_FILE` ( +CREATE TABLE `SYS_RESOURCE` ( `ID` BIGINT(20) NOT NULL COMMENT '主键', - `NAME` VARCHAR(250) COMMENT '文件名称', - `FILE_TYPE` VARCHAR(20) COMMENT '文件类型', - `ATTRIBUTE1` VARCHAR(50) COMMENT '扩展属性1', - `ATTRIBUTE2` VARCHAR(50) COMMENT '扩展属性2', - `LOCATION` VARCHAR(500) COMMENT '存放地址', - `URL` VARCHAR(500) COMMENT '访问地址', - `URL_DOWNLOAD` VARCHAR(500) COMMENT '下载地址', + `CODE` VARCHAR(50) 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 '创建用户', @@ -63,22 +61,47 @@ CREATE TABLE `SYS_FILE` ( `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', `LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间', PRIMARY KEY (`ID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文件'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='资源'; -- ---------------------------- --- Table structure for RESOURCE - 资源 +-- Table structure for USER - 用户 -- Target : MySQL -- Author : wangbing --- Date: : 2019-12-20 +-- Date: : 2019-12-27 -- ---------------------------- -CREATE TABLE `SYS_RESOURCE` ( +CREATE TABLE `SYS_USER` ( `ID` BIGINT(20) NOT NULL COMMENT '主键', - `VALUE` VARCHAR(100) NOT NULL COMMENT '资源内容', - `COMMENT` VARCHAR(250) COMMENT '资源描述', - `RESOURCE_TYPE` VARCHAR(20) NOT NULL COMMENT '资源类型', + `USER_NAME` VARCHAR(100) NOT NULL COMMENT '用户账户', + `USER_CODE` VARCHAR(50) NOT NULL COMMENT '用户代码', + `USER_ALIAS` VARCHAR(50) COMMENT '用户别名', + `USER_PWD` VARCHAR(50) NOT NULL COMMENT '用户密码', + `USER_STATUS` VARCHAR(20) NOT NULL COMMENT '用户状态', + `DEPT_ID` BIGINT(20) COMMENT '部门主键', + `DEPT_CODE` VARCHAR(50) COMMENT '部门代码', + `DEPT_NAME` 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='用户'; + +-- ---------------------------- +-- Table structure for DEPT - 部门 +-- Target : MySQL +-- Author : wangbing +-- Date: : 2019-12-27 +-- ---------------------------- +CREATE TABLE `SYS_DEPT` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键', + `DEPT_CODE` VARCHAR(50) NOT NULL COMMENT '部门代码', + `DEPT_NAME` VARCHAR(100) NOT NULL COMMENT '部门名称', + `DEPT_ALIAS` VARCHAR(50) COMMENT '部门别名', + `SUP_CODE` VARCHAR(50) COMMENT '父部门代码', + `SUP_NAME` VARCHAR(100) COMMENT '父部门名称', `VALID` TINYINT(1) NOT NULL COMMENT '是否有效', - `NODE` TINYINT(1) NOT NULL COMMENT '是否节点', - `SUP_ID` BIGINT(20) 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 '创建用户', @@ -86,12 +109,33 @@ CREATE TABLE `SYS_RESOURCE` ( `LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户', `LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间', PRIMARY KEY (`ID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='资源'; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='部门'; + +-- ---------------------------- +-- Table structure for ROLE - 角色 +-- Target : MySQL +-- Author : wangbing +-- Date: : 2019-12-27 +-- ---------------------------- +CREATE TABLE `SYS_ROLE` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键', + `CODE` VARCHAR(50) NOT NULL COMMENT '角色代码', + `NAME` VARCHAR(50) NOT NULL COMMENT '角色名称', + `COMMENT` VARCHAR(50) 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 : wangbing --- Date: : 2019-12-20 +-- Date: : 2019-12-27 -- ---------------------------- CREATE TABLE `SYS_TOKENS` ( `ID` BIGINT(20) NOT NULL COMMENT '主键', @@ -115,3 +159,66 @@ CREATE TABLE `SYS_TOKENS` ( `LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间', PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='通行证'; + +-- ---------------------------- +-- Table structure for FILE - 文件 +-- Target : MySQL +-- Author : wangbing +-- Date: : 2019-12-27 +-- ---------------------------- +CREATE TABLE `SYS_FILE` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键', + `NAME` VARCHAR(250) COMMENT '文件名称', + `FILE_TYPE` VARCHAR(20) COMMENT '文件类型', + `ATTRIBUTE1` VARCHAR(50) COMMENT '扩展属性1', + `ATTRIBUTE2` VARCHAR(50) COMMENT '扩展属性2', + `LOCATION` VARCHAR(500) COMMENT '存放地址', + `URL` VARCHAR(500) COMMENT '访问地址', + `URL_DOWNLOAD` VARCHAR(500) 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 USER_ROLE - 用户角色授权 +-- Target : MySQL +-- Author : wangbing +-- Date: : 2019-12-27 +-- ---------------------------- +CREATE TABLE `SYS_USER_ROLE` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键', + `USER_ID` BIGINT(20) NOT NULL COMMENT '用户主键', + `ROLE_ID` BIGINT(20) 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 ROLE_RESOURCE - 角色资源关系 +-- Target : MySQL +-- Author : wangbing +-- Date: : 2019-12-27 +-- ---------------------------- +CREATE TABLE `SYS_ROLE_RESOURCE` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键', + `ROLE_ID` BIGINT(20) NOT NULL COMMENT '角色主键', + `RESOURCE_ID` BIGINT(20) 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/MySQL_RESOURCE.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/MySQL_RESOURCE.sql index 7fb89189..3b29462f 100644 --- a/src/main/resources/modules/SpringBoot/resources/dbtool/system/MySQL_RESOURCE.sql +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/MySQL_RESOURCE.sql @@ -2,13 +2,13 @@ -- Table structure for RESOURCE - 资源 -- Target : MySQL -- Author : wangbing --- Date: : 2019-12-26 +-- Date: : 2019-12-27 -- ---------------------------- CREATE TABLE `SYS_RESOURCE` ( `ID` BIGINT(20) NOT NULL COMMENT '主键', + `CODE` VARCHAR(50) NOT NULL COMMENT '资源代码', `VALUE` VARCHAR(100) NOT NULL COMMENT '资源内容', `COMMENT` VARCHAR(250) COMMENT '资源描述', - `RESOURCE_MODULE` VARCHAR(20) NOT NULL COMMENT '资源模块', `RESOURCE_TYPE` VARCHAR(20) NOT NULL COMMENT '资源类型', `VALID` TINYINT(1) NOT NULL COMMENT '是否有效', `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', diff --git a/src/main/resources/modules/SpringBoot/resources/dbtool/system/MySQL_ROLE.sql b/src/main/resources/modules/SpringBoot/resources/dbtool/system/MySQL_ROLE.sql new file mode 100644 index 00000000..e367673b --- /dev/null +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/system/MySQL_ROLE.sql @@ -0,0 +1,19 @@ +-- ---------------------------- +-- Table structure for ROLE - 角色 +-- Target : MySQL +-- Author : wangbing +-- Date: : 2019-12-27 +-- ---------------------------- +CREATE TABLE `SYS_ROLE` ( + `ID` BIGINT(20) NOT NULL COMMENT '主键', + `CODE` VARCHAR(50) NOT NULL COMMENT '角色代码', + `NAME` VARCHAR(50) NOT NULL COMMENT '角色名称', + `COMMENT` VARCHAR(50) 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 54ffa101..3a5d0820 100644 --- a/src/main/resources/modules/SpringBoot/resources/dbtool/wadmin.xml +++ b/src/main/resources/modules/SpringBoot/resources/dbtool/wadmin.xml @@ -46,9 +46,9 @@ + - @@ -98,9 +98,9 @@
- - - + + + 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 index 8913329a..d711e803 100644 --- 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 @@ -1,15 +1,15 @@
+ + + - - - @@ -35,15 +35,15 @@ + + + - - - @@ -98,6 +98,11 @@ label="主键" width="140"> + + - -
- - + + - - + + - - + + 搜索 @@ -18,7 +17,7 @@ - + 新增 @@ -26,17 +25,15 @@ 导出 - - - + + + - - + + - - + + @@ -85,17 +82,17 @@ + prop="code" + label="角色代码"> + prop="name" + label="角色名称"> 0) { - console.error(response.errors[0].message) - } else { - this.resourceTree = response.resourceChecks; - } - }.bind(this)) - } }, mounted: function () { this.onFind(); - this.ss(); }, })