Former-commit-id: 243893d4c836903e1460bfb062b681c15004c0d1
master
wangbing 5 years ago
parent 8726265999
commit d9c49bd2e1

@ -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;

@ -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;
}

@ -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;
}
}

@ -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<ResourceTree> data = new ArrayList<>();
ResourceTree tree = null;
List<ResourceCheck> 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<String, ResourceTree> map = new HashMap<>();
List<Resource> result = resourceFindResponse.getResult();
// 获取最顶级资源
int level = 1;
while (result.size() > 0) {
Iterator<Resource> 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;
}
}

@ -7,14 +7,14 @@
<sql id="table">`SYS_RESOURCE`</sql>
<sql id="entityColumnList">
`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`
</sql>
<resultMap id="resource" type="${basePackage}.module.system.ent.Resource">
<result column="ID" jdbcType="BIGINT" property="id"/>
<result column="CODE" jdbcType="VARCHAR" property="code"/>
<result column="VALUE" jdbcType="VARCHAR" property="value"/>
<result column="COMMENT" jdbcType="VARCHAR" property="comment"/>
<result column="RESOURCE_MODULE" jdbcType="VARCHAR" property="resourceModule"/>
<result column="RESOURCE_TYPE" jdbcType="VARCHAR" property="resourceType"/>
<result column="VALID" jdbcType="BIT" property="valid"/>
<result column="ROW_VERSION" jdbcType="BIGINT" property="rowVersion"/>
@ -32,15 +32,15 @@
<include refid="table"/>
WHERE
`IS_DELETED` = 0
<if test="request.code != null and request.code != ''">
AND `CODE` = ${r"#"}{request.code}
</if>
<if test="request.value != null and request.value != ''">
AND `VALUE` = ${r"#"}{request.value}
</if>
<if test="request.comment != null and request.comment != ''">
AND `COMMENT` = ${r"#"}{request.comment}
</if>
<if test="request.resourceModule != null and request.resourceModule != ''">
AND `RESOURCE_MODULE` = ${r"#"}{request.resourceModule}
</if>
<if test="request.resourceType != null and request.resourceType != ''">
AND `RESOURCE_TYPE` = ${r"#"}{request.resourceType}
</if>
@ -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 @@
<foreach collection="list" item= "item" index ="index" separator=",">
(
${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
<include refid="table"/>
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,

@ -7,14 +7,14 @@
<sql id="table">`SYS_ROLE`</sql>
<sql id="entityColumnList">
`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`
</sql>
<resultMap id="role" type="${basePackage}.module.system.ent.Role">
<result column="ID" jdbcType="BIGINT" property="id"/>
<result column="ROLE_NAME" jdbcType="VARCHAR" property="roleName"/>
<result column="ROLE_CODE" jdbcType="VARCHAR" property="roleCode"/>
<result column="ROLE_COMMENT" jdbcType="VARCHAR" property="roleComment"/>
<result column="CODE" jdbcType="VARCHAR" property="code"/>
<result column="NAME" jdbcType="VARCHAR" property="name"/>
<result column="COMMENT" jdbcType="VARCHAR" property="comment"/>
<result column="ROW_VERSION" jdbcType="BIGINT" property="rowVersion"/>
<result column="IS_DELETED" jdbcType="BIT" property="isDeleted"/>
<result column="CREATE_BY" jdbcType="BIGINT" property="createBy"/>
@ -30,14 +30,14 @@
<include refid="table"/>
WHERE
`IS_DELETED` = 0
<if test="request.roleName != null and request.roleName != ''">
AND `ROLE_NAME` = ${r"#"}{request.roleName}
<if test="request.code != null and request.code != ''">
AND `CODE` = ${r"#"}{request.code}
</if>
<if test="request.roleCode != null and request.roleCode != ''">
AND `ROLE_CODE` = ${r"#"}{request.roleCode}
<if test="request.name != null and request.name != ''">
AND `NAME` = ${r"#"}{request.name}
</if>
<if test="request.roleComment != null and request.roleComment != ''">
AND `ROLE_COMMENT` = ${r"#"}{request.roleComment}
<if test="request.comment != null and request.comment != ''">
AND `COMMENT` = ${r"#"}{request.comment}
</if>
</select>
@ -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 @@
<foreach collection="list" item= "item" index ="index" separator=",">
(
${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
<include refid="table"/>
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()

@ -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;
}

@ -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 {

@ -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;
}

@ -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 {

@ -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 {
}

@ -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 {
}

@ -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;
}

@ -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;
}
}

@ -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 {

@ -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;
}
}

@ -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 {

@ -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;
}
}

@ -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<ResourceTree> data;
public List<ResourceTree> getData() {
return data;
}
public void setData(List<ResourceTree> data) {
this.data = data;
}
}

@ -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<ResourceTree> {
}

@ -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='角色资源关系';

@ -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 '行版本',

@ -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='角色';

@ -46,9 +46,9 @@
<table create="true" delete="true" find="true" get="true" html="true" search="false" sys="true" tableComment="资源" tableName="RESOURCE" update="true">
<fields>
<field IsSystem="true" defaultValue="" fieldComment="主键" fieldLength="0" fieldName="ID" fieldType="Long" isMust="true" isPrimaryKey="true" isQuery="false" isSearch="false"/>
<field IsSystem="false" defaultValue="NULL" fieldComment="资源代码" fieldLength="50" fieldName="CODE" fieldType="String_var50" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false"/>
<field IsSystem="false" defaultValue="NULL" fieldComment="资源内容" fieldLength="100" fieldName="VALUE" fieldType="String_var100" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false"/>
<field IsSystem="false" defaultValue="NULL" fieldComment="资源描述" fieldLength="255" fieldName="COMMENT" fieldType="String_var255" isMust="false" isPrimaryKey="false" isQuery="true" isSearch="false"/>
<field IsSystem="false" defaultValue="NULL" fieldComment="资源模块" fieldLength="20" fieldName="RESOURCE_MODULE" fieldType="Dict" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false"/>
<field IsSystem="false" defaultValue="NULL" fieldComment="资源类型" fieldLength="20" fieldName="RESOURCE_TYPE" fieldType="Dict" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false"/>
<field IsSystem="false" defaultValue="NULL" fieldComment="是否有效" fieldLength="0" fieldName="VALID" fieldType="Boolean" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false"/>
<field IsSystem="true" defaultValue="" fieldComment="行版本" fieldLength="0" fieldName="ROW_VERSION" fieldType="Long" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false"/>
@ -98,9 +98,9 @@
<table create="true" delete="true" find="true" get="true" html="true" search="false" sys="true" tableComment="角色" tableName="ROLE" update="true">
<fields>
<field IsSystem="true" defaultValue="" fieldComment="主键" fieldLength="0" fieldName="ID" fieldType="Long" isMust="true" isPrimaryKey="true" isQuery="false" isSearch="false"/>
<field IsSystem="false" defaultValue="NULL" fieldComment="角色名称" fieldLength="50" fieldName="ROLE_NAME" fieldType="String_var50" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false"/>
<field IsSystem="false" defaultValue="NULL" fieldComment="角色代码" fieldLength="50" fieldName="ROLE_CODE" fieldType="String_var50" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false"/>
<field IsSystem="false" defaultValue="NULL" fieldComment="角色描述" fieldLength="50" fieldName="ROLE_COMMENT" fieldType="String_var50" isMust="false" isPrimaryKey="false" isQuery="true" isSearch="false"/>
<field IsSystem="false" defaultValue="NULL" fieldComment="角色代码" fieldLength="50" fieldName="CODE" fieldType="String_var50" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false"/>
<field IsSystem="false" defaultValue="NULL" fieldComment="角色名称" fieldLength="50" fieldName="NAME" fieldType="String_var50" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false"/>
<field IsSystem="false" defaultValue="NULL" fieldComment="角色描述" fieldLength="50" fieldName="COMMENT" fieldType="String_var50" isMust="false" isPrimaryKey="false" isQuery="true" isSearch="false"/>
<field IsSystem="true" defaultValue="" fieldComment="行版本" fieldLength="0" fieldName="ROW_VERSION" fieldType="Long" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false"/>
<field IsSystem="true" defaultValue="0" fieldComment="是否已删除" fieldLength="0" fieldName="IS_DELETED" fieldType="Boolean" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false"/>
<field IsSystem="true" defaultValue="" fieldComment="创建用户" fieldLength="0" fieldName="CREATE_BY" fieldType="Long" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false"/>

@ -1,15 +1,15 @@
<div id="app" v-cloak>
<el-card class="box-card search">
<el-form :inline="true" :model="vm" ref="vm" label-position="right" label-width="90px">
<el-form-item label="资源代码" prop="code">
<el-input v-model="vm.code" clearable size="small" placeholder="请输入资源代码"></el-input>
</el-form-item>
<el-form-item label="资源内容" prop="value">
<el-input v-model="vm.value" clearable size="small" placeholder="请输入资源内容"></el-input>
</el-form-item>
<el-form-item label="资源描述" prop="comment">
<el-input v-model="vm.comment" clearable size="small" placeholder="请输入资源描述"></el-input>
</el-form-item>
<el-form-item label="资源模块" prop="resourceModule">
<el-input-dict v-model="vm.resourceModule" clearable size="small" placeholder="请输入资源模块" dict-name="RESOURCE_MODULE" ></el-input-dict>
</el-form-item>
<el-form-item label="资源类型" prop="resourceType">
<el-input-dict v-model="vm.resourceType" clearable size="small" placeholder="请输入资源类型" dict-name="RESOURCE_TYPE" ></el-input-dict>
</el-form-item>
@ -35,15 +35,15 @@
<el-dialog class="form" :title="form.title" :visible.sync="form.dialog">
<el-form :model="form" :inline="true" :rules="formRules" ref="form" label-position="right" label-width="90px">
<el-form-item label="资源代码" prop="code">
<el-input v-model="form.code" clearable size="small" placeholder="请输入资源代码"></el-input>
</el-form-item>
<el-form-item label="资源内容" prop="value">
<el-input v-model="form.value" clearable size="small" placeholder="请输入资源内容"></el-input>
</el-form-item>
<el-form-item label="资源描述" prop="comment">
<el-input v-model="form.comment" clearable size="small" placeholder="请输入资源描述"></el-input>
</el-form-item>
<el-form-item label="资源模块" prop="resourceModule">
<el-input-dict v-model="form.resourceModule" clearable size="small" placeholder="请输入资源模块" dict-name="RESOURCE_MODULE" ></el-input-dict>
</el-form-item>
<el-form-item label="资源类型" prop="resourceType">
<el-input-dict v-model="form.resourceType" clearable size="small" placeholder="请输入资源类型" dict-name="RESOURCE_TYPE" ></el-input-dict>
</el-form-item>
@ -98,6 +98,11 @@
label="主键"
width="140">
</el-table-column>
<el-table-column
align="center"
prop="code"
label="资源代码">
</el-table-column>
<el-table-column
align="center"
prop="value"
@ -108,11 +113,6 @@
prop="comment"
label="资源描述">
</el-table-column>
<el-table-column
align="center"
prop="resourceModule"
label="资源模块">
</el-table-column>
<el-table-column
align="center"
prop="resourceType"
@ -167,9 +167,9 @@
module: 'system',
target: 'resource',
vm: {//条件及分页参数
code: "",
value: "",
comment: "",
resourceModule: "",
resourceType: "",
valid: "",
pageNumber: 1,
@ -182,14 +182,18 @@
title: "",
dialog: false,
id: '',
code: "",
value: "",
comment: "",
resourceModule: "",
resourceType: "",
valid: "",
rowVersion: ""
},
formRules: {
code: [
{required: true, message: '资源代码不能为空', trigger: 'blur'},
{min: 1, max: 50, message: '资源代码长度在 1 到 50 个字符', trigger: 'blur'}
],
value: [
{required: true, message: '资源内容不能为空', trigger: 'blur'},
{min: 1, max: 100, message: '资源内容长度在 1 到 100 个字符', trigger: 'blur'}
@ -197,9 +201,6 @@
comment: [
{min: 1, max: 255, message: '资源描述长度在 1 到 255 个字符', trigger: 'blur'}
],
resourceModule: [
{required: true, message: '资源模块不能为空', trigger: 'blur'},
],
resourceType: [
{required: true, message: '资源类型不能为空', trigger: 'blur'},
],
@ -213,9 +214,9 @@
this.form.title = "资源新增";
this.form.dialog = true;
this.form.id = "";
this.form.code = "";
this.form.value = "";
this.form.comment = "";
this.form.resourceModule = "";
this.form.resourceType = "";
this.form.valid = "";
},
@ -227,9 +228,9 @@
this.form.title = "资源编辑";
this.form.dialog = true;
this.form.id = item.id;
this.form.code = item.code;
this.form.value = item.value;
this.form.comment = item.comment;
this.form.resourceModule = item.resourceModule;
this.form.resourceType = item.resourceType;
this.form.valid = item.valid;
this.form.rowVersion = item.rowVersion;

@ -1,15 +1,14 @@
<#-- since 2017-01-01-->
<div id="app" v-cloak>
<el-card class="box-card search">
<el-form :inline="true" :model="vm" ref="vm" label-position="right" label-width="90px">
<el-form-item label="角色名称" prop="roleName">
<el-input v-model="vm.roleName" clearable size="small" placeholder="请输入角色名称"></el-input>
<el-form-item label="角色代码" prop="code">
<el-input v-model="vm.code" clearable size="small" placeholder="请输入角色代码"></el-input>
</el-form-item>
<el-form-item label="角色代码" prop="roleCode">
<el-input v-model="vm.roleCode" clearable size="small" placeholder="请输入角色代码"></el-input>
<el-form-item label="角色名称" prop="name">
<el-input v-model="vm.name" clearable size="small" placeholder="请输入角色名称"></el-input>
</el-form-item>
<el-form-item label="角色描述" prop="roleComment">
<el-input v-model="vm.roleComment" clearable size="small" placeholder="请输入角色描述"></el-input>
<el-form-item label="角色描述" prop="comment">
<el-input v-model="vm.comment" clearable size="small" placeholder="请输入角色描述"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" icon="el-icon-search" @click="onSearch">搜索</el-button>
@ -18,7 +17,7 @@
</el-form>
</el-card>
<el-card class="box-card resourceChecks">
<el-card class="box-card data">
<el-row>
<el-col :span="12">
<el-button type="success" size="small" icon="el-icon-plus" @click="onCreate">新增</el-button>
@ -26,17 +25,15 @@
<el-button type="warning" size="small" icon="el-icon-download" @click="onExport">导出</el-button>
<el-dialog class="form" :title="form.title" :visible.sync="form.dialog">
<el-form :model="form" :inline="true" :rules="formRules" ref="form" label-position="right"
label-width="90px">
<el-form-item label="角色名称" prop="roleName">
<el-input v-model="form.roleName" clearable size="small" placeholder="请输入角色名称"></el-input>
<el-form :model="form" :inline="true" :rules="formRules" ref="form" label-position="right" label-width="90px">
<el-form-item label="角色代码" prop="code">
<el-input v-model="form.code" clearable size="small" placeholder="请输入角色代码"></el-input>
</el-form-item>
<el-form-item label="角色代码" prop="roleCode">
<el-input v-model="form.roleCode" clearable size="small" placeholder="请输入角色代码"></el-input>
<el-form-item label="角色名称" prop="name">
<el-input v-model="form.name" clearable size="small" placeholder="请输入角色名称"></el-input>
</el-form-item>
<el-form-item label="角色描述" prop="roleComment">
<el-input v-model="form.roleComment" clearable size="small"
placeholder="请输入角色描述"></el-input>
<el-form-item label="角色描述" prop="comment">
<el-input v-model="form.comment" clearable size="small" placeholder="请输入角色描述"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
@ -85,17 +82,17 @@
</el-table-column>
<el-table-column
align="center"
prop="roleName"
label="角色名称">
prop="code"
label="角色代码">
</el-table-column>
<el-table-column
align="center"
prop="roleCode"
label="角色代码">
prop="name"
label="角色名称">
</el-table-column>
<el-table-column
align="center"
prop="roleComment"
prop="comment"
label="角色描述">
</el-table-column>
<el-table-column
@ -142,9 +139,9 @@
module: 'system',
target: 'role',
vm: {//条件及分页参数
roleName: "",
roleCode: "",
roleComment: "",
code: "",
name: "",
comment: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
@ -155,34 +152,33 @@
title: "",
dialog: false,
id: '',
roleName: "",
roleCode: "",
roleComment: "",
code: "",
name: "",
comment: "",
rowVersion: ""
},
formRules: {
roleName: [
{required: true, message: '角色名称不能为空', trigger: 'blur'},
{min: 1, max: 50, message: '角色名称长度在 1 到 50 个字符', trigger: 'blur'}
],
roleCode: [
code: [
{required: true, message: '角色代码不能为空', trigger: 'blur'},
{min: 1, max: 50, message: '角色代码长度在 1 到 50 个字符', trigger: 'blur'}
],
roleComment: [
name: [
{required: true, message: '角色名称不能为空', trigger: 'blur'},
{min: 1, max: 50, message: '角色名称长度在 1 到 50 个字符', trigger: 'blur'}
],
comment: [
{min: 1, max: 50, message: '角色描述长度在 1 到 50 个字符', trigger: 'blur'}
],
},
resourceTree: {}
}
},
methods: {
onCreate: function () {
this.form.title = "角色新增";
this.form.dialog = true;
this.form.id = "";
this.form.roleName = "";
this.form.roleCode = "";
this.form.roleComment = "";
this.form.code = "";
this.form.name = "";
this.form.comment = "";
},
onCommand: function (arg) {
const cmd = arg[0];
@ -192,9 +188,9 @@
this.form.title = "角色编辑";
this.form.dialog = true;
this.form.id = item.id;
this.form.roleName = item.roleName;
this.form.roleCode = item.roleCode;
this.form.roleComment = item.roleComment;
this.form.code = item.code;
this.form.name = item.name;
this.form.comment = item.comment;
this.form.rowVersion = item.rowVersion;
break;
case "delete":
@ -205,19 +201,9 @@
break;
}
},
ss: function () {
this.$ajax.load("system", "resource", {}).then(function (response) {
if (response.errors.length > 0) {
console.error(response.errors[0].message)
} else {
this.resourceTree = response.resourceChecks;
}
}.bind(this))
}
},
mounted: function () {
this.onFind();
this.ss();
},
})
</script>

Loading…
Cancel
Save

Powered by TurnKey Linux.