parent
bf4fa31dce
commit
d41f1c42b7
@ -0,0 +1,104 @@
|
||||
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 ${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.Res;
|
||||
import ${basePackage}.module.system.mgr.ResManager;
|
||||
import ${basePackage}.module.system.req.ResCreateRequest;
|
||||
import ${basePackage}.module.system.req.ResDeleteRequest;
|
||||
import ${basePackage}.module.system.req.ResFindRequest;
|
||||
import ${basePackage}.module.system.req.ResGetRequest;
|
||||
import ${basePackage}.module.system.req.ResTreeRequest;
|
||||
import ${basePackage}.module.system.req.ResUpdateRequest;
|
||||
import ${basePackage}.module.system.rsp.ResCreateResponse;
|
||||
import ${basePackage}.module.system.rsp.ResDeleteResponse;
|
||||
import ${basePackage}.module.system.rsp.ResFindResponse;
|
||||
import ${basePackage}.module.system.rsp.ResGetResponse;
|
||||
import ${basePackage}.module.system.rsp.ResTreeResponse;
|
||||
import ${basePackage}.module.system.rsp.ResUpdateResponse;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
public class ResAjax {
|
||||
|
||||
@Autowired
|
||||
private ResManager resManager;
|
||||
|
||||
public ResCreateResponse create(ResCreateRequest request) {
|
||||
return resManager.create(request, LocalData.getToken());
|
||||
}
|
||||
|
||||
public ResDeleteResponse delete(ResDeleteRequest request) {
|
||||
return resManager.delete(request, LocalData.getToken());
|
||||
}
|
||||
|
||||
public ResUpdateResponse update(ResUpdateRequest request) {
|
||||
return resManager.update(request, LocalData.getToken());
|
||||
}
|
||||
|
||||
public ResFindResponse find(ResFindRequest request) {
|
||||
return resManager.find(request, LocalData.getToken());
|
||||
}
|
||||
|
||||
public ResGetResponse get(ResGetRequest request) {
|
||||
return resManager.get(request, LocalData.getToken());
|
||||
}
|
||||
|
||||
public ResTreeResponse tree(ResTreeRequest request) {
|
||||
return resManager.tree(request, LocalData.getToken());
|
||||
}
|
||||
|
||||
public Object template() {
|
||||
return ResponseUtil.apply(new WSheet<>(Res.class));
|
||||
}
|
||||
|
||||
public Object exports(TreeNode jsonParam) {
|
||||
ResFindRequest request = MapperUtil.toJava(jsonParam, ResFindRequest.class);
|
||||
ResFindResponse response = resManager.find(request, LocalData.getToken());
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
} else if (response.getTotalCount() == 0) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, "导出数据为空");
|
||||
return response;
|
||||
}
|
||||
return ResponseUtil.apply(new WSheet<>(response.getResult()));
|
||||
}
|
||||
|
||||
public Object imports(MultipartFile file) {
|
||||
BaseResponse baseResponse = new BaseResponse();
|
||||
try {
|
||||
WSheet<Res> sheet = new WSheet<>(file.getBytes(), Res.class, new WSheet.Validator<Res>() {
|
||||
@Override
|
||||
public List<String> validate(Res o) {
|
||||
ResCreateRequest request = MapperUtil.map(o, ResCreateRequest.class);
|
||||
return ValidationUtil.validate(request);
|
||||
}
|
||||
});
|
||||
|
||||
if (sheet.hasError()) {
|
||||
return ResponseUtil.apply(sheet.getBytes(), sheet.getName() + "-检查.xlsx");
|
||||
} else {
|
||||
return baseResponse;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
LogUtil.dumpException(e);
|
||||
baseResponse.addError(ErrorType.BUSINESS_ERROR, "上传文件出错");
|
||||
} catch (TemplateNotMatchException | ReadErrorException e) {
|
||||
baseResponse.addError(ErrorType.BUSINESS_ERROR, e.getMessage());
|
||||
}
|
||||
return baseResponse;
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
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 ${basePackage}.frame.excel.WSheet;
|
||||
import ${basePackage}.frame.utils.LogUtil;
|
||||
import ${basePackage}.frame.auth.LocalData;
|
||||
import ${basePackage}.frame.base.ErrorType;
|
||||
import ${basePackage}.frame.utils.MapperUtil;
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
import ${basePackage}.frame.utils.ResponseUtil;
|
||||
import ${basePackage}.frame.utils.ValidationUtil;
|
||||
import ${basePackage}.frame.excel.exception.ReadErrorException;
|
||||
import ${basePackage}.frame.excel.exception.TemplateNotMatchException;
|
||||
import ${basePackage}.module.system.ent.RoleRes;
|
||||
import ${basePackage}.module.system.mgr.RoleResManager;
|
||||
import ${basePackage}.module.system.req.*;
|
||||
import ${basePackage}.module.system.rsp.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
public class RoleResAjax{
|
||||
|
||||
@Autowired
|
||||
private RoleResManager roleResManager;
|
||||
|
||||
public RoleResCreateResponse create(RoleResCreateRequest request) {
|
||||
return roleResManager.create(request, LocalData.getToken());
|
||||
}
|
||||
|
||||
public RoleResDeleteResponse delete(RoleResDeleteRequest request) {
|
||||
return roleResManager.delete(request, LocalData.getToken());
|
||||
}
|
||||
|
||||
public RoleResUpdateResponse update(RoleResUpdateRequest request) {
|
||||
return roleResManager.update(request, LocalData.getToken());
|
||||
}
|
||||
|
||||
public RoleResFindResponse find(RoleResFindRequest request) {
|
||||
return roleResManager.find(request, LocalData.getToken());
|
||||
}
|
||||
|
||||
public RoleResGetResponse get(RoleResGetRequest request) {
|
||||
return roleResManager.get(request, LocalData.getToken());
|
||||
}
|
||||
}
|
@ -0,0 +1,116 @@
|
||||
package ${basePackage}.module.system.ent;
|
||||
|
||||
import ${basePackage}.frame.excel.annotation.ColumnDescription;
|
||||
import ${basePackage}.frame.excel.annotation.ColumnName;
|
||||
import ${basePackage}.frame.excel.annotation.SheetName;
|
||||
import ${basePackage}.frame.base.BaseEntity;
|
||||
|
||||
/**
|
||||
* RES - 资源
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
@SheetName("资源")
|
||||
public class Res extends BaseEntity {
|
||||
|
||||
/**
|
||||
* RES_CODE - 资源代码
|
||||
*/
|
||||
@ColumnName("资源代码")
|
||||
@ColumnDescription("")
|
||||
private String resCode;
|
||||
/**
|
||||
* RES_NAME - 资源名称
|
||||
*/
|
||||
@ColumnName("资源名称")
|
||||
@ColumnDescription("")
|
||||
private String resName;
|
||||
/**
|
||||
* RES_TYPE - 资源类型
|
||||
*/
|
||||
@ColumnName("资源类型")
|
||||
@ColumnDescription("")
|
||||
private String resType;
|
||||
/**
|
||||
* RES_VALUE - 资源内容
|
||||
*/
|
||||
@ColumnName("资源内容")
|
||||
@ColumnDescription("")
|
||||
private String resValue;
|
||||
/**
|
||||
* SUP_CODE - 上级代码
|
||||
*/
|
||||
@ColumnName("上级代码")
|
||||
@ColumnDescription("")
|
||||
private String supCode;
|
||||
/**
|
||||
* SUP_NAME - 上级名称
|
||||
*/
|
||||
@ColumnName("上级名称")
|
||||
@ColumnDescription("")
|
||||
private String supName;
|
||||
/**
|
||||
* VALID - 是否有效
|
||||
*/
|
||||
@ColumnName("是否有效")
|
||||
@ColumnDescription("")
|
||||
private Boolean valid;
|
||||
|
||||
public String getResCode() {
|
||||
return this.resCode;
|
||||
}
|
||||
|
||||
public void setResCode(String resCode) {
|
||||
this.resCode = resCode;
|
||||
}
|
||||
|
||||
public String getResName() {
|
||||
return this.resName;
|
||||
}
|
||||
|
||||
public void setResName(String resName) {
|
||||
this.resName = resName;
|
||||
}
|
||||
|
||||
public String getResType() {
|
||||
return this.resType;
|
||||
}
|
||||
|
||||
public void setResType(String resType) {
|
||||
this.resType = resType;
|
||||
}
|
||||
|
||||
public String getResValue() {
|
||||
return this.resValue;
|
||||
}
|
||||
|
||||
public void setResValue(String resValue) {
|
||||
this.resValue = resValue;
|
||||
}
|
||||
|
||||
public String getSupCode() {
|
||||
return this.supCode;
|
||||
}
|
||||
|
||||
public void setSupCode(String supCode) {
|
||||
this.supCode = supCode;
|
||||
}
|
||||
|
||||
public String getSupName() {
|
||||
return this.supName;
|
||||
}
|
||||
|
||||
public void setSupName(String supName) {
|
||||
this.supName = supName;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package ${basePackage}.module.system.ent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ResTree - 资源树
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-24
|
||||
*/
|
||||
public class ResTree extends Res {
|
||||
|
||||
private String label;
|
||||
|
||||
private String value;
|
||||
|
||||
private List<ResTree> children;
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public List<ResTree> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<ResTree> children) {
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
public void addChild(ResTree deptTree) {
|
||||
if (this.children == null) this.children = new ArrayList<>();
|
||||
this.children.add(deptTree);
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package ${basePackage}.module.system.ent;
|
||||
|
||||
import ${basePackage}.frame.base.BaseEntity;
|
||||
|
||||
/**
|
||||
* ROLE_RES - 角色资源关系
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class RoleRes extends BaseEntity {
|
||||
|
||||
/**
|
||||
* ROLE_ID - 角色主键
|
||||
*/
|
||||
private Long roleId;
|
||||
/**
|
||||
* ROLE_CODE - 角色代码
|
||||
*/
|
||||
private String roleCode;
|
||||
/**
|
||||
* RES_ID - 资源主键
|
||||
*/
|
||||
private Long resId;
|
||||
/**
|
||||
* RES_CODE - 资源代码
|
||||
*/
|
||||
private String resCode;
|
||||
|
||||
public Long getRoleId() {
|
||||
return this.roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public String getRoleCode() {
|
||||
return this.roleCode;
|
||||
}
|
||||
|
||||
public void setRoleCode(String roleCode) {
|
||||
this.roleCode = roleCode;
|
||||
}
|
||||
|
||||
public Long getResId() {
|
||||
return this.resId;
|
||||
}
|
||||
|
||||
public void setResId(Long resId) {
|
||||
this.resId = resId;
|
||||
}
|
||||
|
||||
public String getResCode() {
|
||||
return this.resCode;
|
||||
}
|
||||
|
||||
public void setResCode(String resCode) {
|
||||
this.resCode = resCode;
|
||||
}
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package ${basePackage}.module.system.mgr;
|
||||
|
||||
import ${basePackage}.module.system.req.ResCreateRequest;
|
||||
import ${basePackage}.module.system.req.ResDeleteRequest;
|
||||
import ${basePackage}.module.system.req.ResFindRequest;
|
||||
import ${basePackage}.module.system.req.ResGetRequest;
|
||||
import ${basePackage}.module.system.req.ResTreeRequest;
|
||||
import ${basePackage}.module.system.req.ResUpdateRequest;
|
||||
import ${basePackage}.module.system.rsp.ResCreateResponse;
|
||||
import ${basePackage}.module.system.rsp.ResDeleteResponse;
|
||||
import ${basePackage}.module.system.rsp.ResFindResponse;
|
||||
import ${basePackage}.module.system.rsp.ResGetResponse;
|
||||
import ${basePackage}.module.system.rsp.ResTreeResponse;
|
||||
import ${basePackage}.module.system.rsp.ResUpdateResponse;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
|
||||
/**
|
||||
* 资源
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public interface ResManager {
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
ResCreateResponse create(ResCreateRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
ResDeleteResponse delete(ResDeleteRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
ResUpdateResponse update(ResUpdateRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
ResFindResponse find(ResFindRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 获得对象
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
ResGetResponse get(ResGetRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 获得资源树
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
ResTreeResponse tree(ResTreeRequest request, Token token);
|
||||
}
|
@ -0,0 +1,249 @@
|
||||
package ${basePackage}.module.system.mgr;
|
||||
|
||||
import ${basePackage}.frame.base.SortType;
|
||||
import ${basePackage}.frame.utils.IDgenerator;
|
||||
import ${basePackage}.frame.utils.Message;
|
||||
import ${basePackage}.frame.base.ErrorType;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
import ${basePackage}.frame.utils.MapperUtil;
|
||||
import ${basePackage}.frame.utils.ValidationUtil;
|
||||
import ${basePackage}.module.system.ent.Res;
|
||||
import ${basePackage}.module.system.ent.ResTree;
|
||||
import ${basePackage}.module.system.mpr.ResMapper;
|
||||
import ${basePackage}.module.system.req.ResCreateRequest;
|
||||
import ${basePackage}.module.system.req.ResDeleteRequest;
|
||||
import ${basePackage}.module.system.req.ResFindRequest;
|
||||
import ${basePackage}.module.system.req.ResGetRequest;
|
||||
import ${basePackage}.module.system.req.ResTreeRequest;
|
||||
import ${basePackage}.module.system.req.ResUpdateRequest;
|
||||
import ${basePackage}.module.system.rsp.ResCreateResponse;
|
||||
import ${basePackage}.module.system.rsp.ResDeleteResponse;
|
||||
import ${basePackage}.module.system.rsp.ResFindResponse;
|
||||
import ${basePackage}.module.system.rsp.ResGetResponse;
|
||||
import ${basePackage}.module.system.rsp.ResTreeResponse;
|
||||
import ${basePackage}.module.system.rsp.ResUpdateResponse;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.github.pagehelper.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* RES - 资源
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
@Transactional
|
||||
@Service
|
||||
public class ResManagerImpl implements ResManager {
|
||||
|
||||
@Autowired
|
||||
private ResMapper resMapper;
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
public ResCreateResponse create(ResCreateRequest request, Token token) {
|
||||
ResCreateResponse response = new ResCreateResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
long id = IDgenerator.nextId();
|
||||
Res entity = MapperUtil.map(request, Res.class);
|
||||
entity.setId(id);
|
||||
|
||||
long result = resMapper.insert(entity, token);
|
||||
if (1L != result) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.CREATE_FAILURE);
|
||||
return response;
|
||||
}
|
||||
response.setId(id);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
public ResDeleteResponse delete(ResDeleteRequest request, Token token) {
|
||||
ResDeleteResponse response = new ResDeleteResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
long result = resMapper.delete(request, token);
|
||||
if (1L != result) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.DELETE_FAILURE);
|
||||
return response;
|
||||
}
|
||||
response.setResult(result);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
public ResUpdateResponse update(ResUpdateRequest request, Token token) {
|
||||
ResUpdateResponse response = new ResUpdateResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
long result = resMapper.update(request, token);
|
||||
if (1L != result) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.UPDATE_FAILURE);
|
||||
return response;
|
||||
}
|
||||
response.setResult(result);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
public ResFindResponse find(ResFindRequest request, Token token) {
|
||||
ResFindResponse response = new ResFindResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
|
||||
if (StringUtil.isNotEmpty(request.getSortKey())) {
|
||||
PageHelper.orderBy(request.getSortKey() + " " + request.getSortType());
|
||||
}
|
||||
PageInfo<Res> pageInfo = new PageInfo<>(resMapper.find(request, token));
|
||||
|
||||
response.setResult(pageInfo.getList());
|
||||
response.setTotalCount(pageInfo.getTotal());
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得对象
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
public ResGetResponse get(ResGetRequest request, Token token) {
|
||||
ResGetResponse response = new ResGetResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
Res po = resMapper.get(request, token);
|
||||
|
||||
if (po != null) {
|
||||
response.setRes(po);
|
||||
} else {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.GET_FAILURE);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResTreeResponse tree(ResTreeRequest request, Token token) {
|
||||
ResTreeResponse response = new ResTreeResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
ResFindRequest resourceFindRequest = new ResFindRequest();
|
||||
resourceFindRequest.setPageSize(0);
|
||||
resourceFindRequest.setValid(true);
|
||||
resourceFindRequest.setSortType(SortType.ASC);
|
||||
resourceFindRequest.setSortKey("CODE");
|
||||
ResFindResponse resourceFindResponse = this.find(resourceFindRequest, token);
|
||||
|
||||
if (resourceFindResponse.hasError()) {
|
||||
response.addErrors(resourceFindResponse.getErrors());
|
||||
return response;
|
||||
}
|
||||
|
||||
List<ResTree> data = new ArrayList<>();
|
||||
Map<String, ResTree> allMap = new HashMap<>();
|
||||
List<Res> result = resourceFindResponse.getResult();
|
||||
// 获取最顶级资源
|
||||
int level = 1;
|
||||
while (result.size() > 0) {
|
||||
Iterator<Res> iterator = result.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Res next = iterator.next();
|
||||
ResTree tree = new ResTree();
|
||||
tree.setId(next.getId());
|
||||
tree.setResCode(next.getResCode());
|
||||
tree.setResName(next.getResName());
|
||||
tree.setResType(next.getResType());
|
||||
tree.setResValue(next.getResValue());
|
||||
tree.setValid(next.getValid());
|
||||
tree.setRowVersion(next.getRowVersion());
|
||||
|
||||
if (next.getResCode() != null && next.getResCode().split("_").length == level) {
|
||||
allMap.put(tree.getResCode(), tree);
|
||||
iterator.remove();
|
||||
//尝试获取上级资源
|
||||
String code = next.getResCode();
|
||||
ResTree Ptree = null;
|
||||
while (code.contains("_")) {
|
||||
code = code.substring(0, code.lastIndexOf("_"));
|
||||
Ptree = allMap.get(code);
|
||||
if (Ptree != null) break;
|
||||
}
|
||||
if (Ptree != null) {
|
||||
Ptree.getChildren().add(tree);
|
||||
} else {
|
||||
data.add(tree);
|
||||
}
|
||||
}
|
||||
}
|
||||
level++;
|
||||
}
|
||||
|
||||
response.setResult(data);
|
||||
return response;
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package ${basePackage}.module.system.mgr;
|
||||
|
||||
import ${basePackage}.module.system.req.RoleResCreateRequest;
|
||||
import ${basePackage}.module.system.req.RoleResDeleteRequest;
|
||||
import ${basePackage}.module.system.req.RoleResFindRequest;
|
||||
import ${basePackage}.module.system.req.RoleResGetRequest;
|
||||
import ${basePackage}.module.system.req.RoleResUpdateRequest;
|
||||
import ${basePackage}.module.system.rsp.RoleResCreateResponse;
|
||||
import ${basePackage}.module.system.rsp.RoleResDeleteResponse;
|
||||
import ${basePackage}.module.system.rsp.RoleResFindResponse;
|
||||
import ${basePackage}.module.system.rsp.RoleResGetResponse;
|
||||
import ${basePackage}.module.system.rsp.RoleResUpdateResponse;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
|
||||
/**
|
||||
* 角色资源关系
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public interface RoleResManager {
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
RoleResCreateResponse create(RoleResCreateRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
RoleResDeleteResponse delete(RoleResDeleteRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
RoleResUpdateResponse update(RoleResUpdateRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
RoleResFindResponse find(RoleResFindRequest request, Token token);
|
||||
|
||||
/**
|
||||
* 获得对象
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return
|
||||
*/
|
||||
RoleResGetResponse get(RoleResGetRequest request, Token token);
|
||||
}
|
@ -0,0 +1,175 @@
|
||||
package ${basePackage}.module.system.mgr;
|
||||
|
||||
import ${basePackage}.frame.utils.IDgenerator;
|
||||
import ${basePackage}.frame.utils.Message;
|
||||
import ${basePackage}.frame.base.ErrorType;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
import ${basePackage}.frame.utils.MapperUtil;
|
||||
import ${basePackage}.frame.utils.ValidationUtil;
|
||||
import ${basePackage}.module.system.ent.RoleRes;
|
||||
import ${basePackage}.module.system.mpr.RoleResMapper;
|
||||
import ${basePackage}.module.system.req.RoleResCreateRequest;
|
||||
import ${basePackage}.module.system.req.RoleResDeleteRequest;
|
||||
import ${basePackage}.module.system.req.RoleResFindRequest;
|
||||
import ${basePackage}.module.system.req.RoleResGetRequest;
|
||||
import ${basePackage}.module.system.req.RoleResUpdateRequest;
|
||||
import ${basePackage}.module.system.rsp.RoleResCreateResponse;
|
||||
import ${basePackage}.module.system.rsp.RoleResDeleteResponse;
|
||||
import ${basePackage}.module.system.rsp.RoleResFindResponse;
|
||||
import ${basePackage}.module.system.rsp.RoleResGetResponse;
|
||||
import ${basePackage}.module.system.rsp.RoleResUpdateResponse;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.github.pagehelper.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* ROLE_RES - 角色资源关系
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
@Transactional
|
||||
@Service
|
||||
public class RoleResManagerImpl implements RoleResManager {
|
||||
|
||||
@Autowired
|
||||
private RoleResMapper roleResMapper;
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
public RoleResCreateResponse create(RoleResCreateRequest request, Token token) {
|
||||
RoleResCreateResponse response = new RoleResCreateResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
long id = IDgenerator.nextId();
|
||||
RoleRes entity = MapperUtil.map(request, RoleRes.class);
|
||||
entity.setId(id);
|
||||
|
||||
long result = roleResMapper.insert(entity, token);
|
||||
if (1L != result) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.CREATE_FAILURE);
|
||||
return response;
|
||||
}
|
||||
response.setId(id);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
public RoleResDeleteResponse delete(RoleResDeleteRequest request, Token token) {
|
||||
RoleResDeleteResponse response = new RoleResDeleteResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
long result = roleResMapper.delete(request, token);
|
||||
if (1L != result) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.DELETE_FAILURE);
|
||||
return response;
|
||||
}
|
||||
response.setResult(result);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
public RoleResUpdateResponse update(RoleResUpdateRequest request, Token token) {
|
||||
RoleResUpdateResponse response = new RoleResUpdateResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
long result = roleResMapper.update(request, token);
|
||||
if (1L != result) {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.UPDATE_FAILURE);
|
||||
return response;
|
||||
}
|
||||
response.setResult(result);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
public RoleResFindResponse find(RoleResFindRequest request, Token token) {
|
||||
RoleResFindResponse response = new RoleResFindResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
PageHelper.startPage(request.getPageNumber(), request.getPageSize());
|
||||
if (StringUtil.isNotEmpty(request.getSortKey())) {
|
||||
PageHelper.orderBy(request.getSortKey() + " " + request.getSortType());
|
||||
}
|
||||
PageInfo<RoleRes> pageInfo = new PageInfo<>(roleResMapper.find(request, token));
|
||||
|
||||
response.setResult(pageInfo.getList());
|
||||
response.setTotalCount(pageInfo.getTotal());
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得对象
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 响应
|
||||
*/
|
||||
@Transactional(readOnly = true)
|
||||
public RoleResGetResponse get(RoleResGetRequest request, Token token) {
|
||||
RoleResGetResponse response = new RoleResGetResponse();
|
||||
|
||||
ValidationUtil.validate(request, response);
|
||||
if (response.hasError()) {
|
||||
return response;
|
||||
}
|
||||
|
||||
RoleRes po = roleResMapper.get(request, token);
|
||||
|
||||
if (po != null) {
|
||||
response.setRoleRes(po);
|
||||
} else {
|
||||
response.addError(ErrorType.BUSINESS_ERROR, Message.GET_FAILURE);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
@ -0,0 +1,161 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="${basePackage}.module.system.mpr.ResMapper">
|
||||
|
||||
<sql id="table">`SYS_RES`</sql>
|
||||
|
||||
<sql id="entityColumnList">
|
||||
`ID`,`RES_CODE`,`RES_NAME`,`RES_TYPE`,`RES_VALUE`,`SUP_CODE`,`SUP_NAME`,`VALID`,`ROW_VERSION`,`IS_DELETED`,`CREATE_BY`,`CREATE_TIME`,`LAST_UPDATE_BY`,`LAST_UPDATE_TIME`
|
||||
</sql>
|
||||
|
||||
<resultMap id="res" type="${basePackage}.module.system.ent.Res">
|
||||
<result column="ID" jdbcType="BIGINT" property="id"/>
|
||||
<result column="RES_CODE" jdbcType="VARCHAR" property="resCode"/>
|
||||
<result column="RES_NAME" jdbcType="VARCHAR" property="resName"/>
|
||||
<result column="RES_TYPE" jdbcType="VARCHAR" property="resType"/>
|
||||
<result column="RES_VALUE" jdbcType="VARCHAR" property="resValue"/>
|
||||
<result column="SUP_CODE" jdbcType="VARCHAR" property="supCode"/>
|
||||
<result column="SUP_NAME" jdbcType="VARCHAR" property="supName"/>
|
||||
<result column="VALID" jdbcType="BIT" property="valid"/>
|
||||
<result column="ROW_VERSION" jdbcType="BIGINT" property="rowVersion"/>
|
||||
<result column="IS_DELETED" jdbcType="BIT" property="isDeleted"/>
|
||||
<result column="CREATE_BY" jdbcType="BIGINT" property="createBy"/>
|
||||
<result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="LAST_UPDATE_BY" jdbcType="BIGINT" property="lastUpdateBy"/>
|
||||
<result column="LAST_UPDATE_TIME" jdbcType="TIMESTAMP" property="lastUpdateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="find" resultMap="res">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
<if test="request.resCode != null and request.resCode != ''">
|
||||
AND `RES_CODE` = ${r'#'}{request.resCode}
|
||||
</if>
|
||||
<if test="request.resName != null and request.resName != ''">
|
||||
AND `RES_NAME` = ${r'#'}{request.resName}
|
||||
</if>
|
||||
<if test="request.resType != null and request.resType != ''">
|
||||
AND `RES_TYPE` = ${r'#'}{request.resType}
|
||||
</if>
|
||||
<if test="request.resValue != null and request.resValue != ''">
|
||||
AND `RES_VALUE` = ${r'#'}{request.resValue}
|
||||
</if>
|
||||
<if test="request.supCode != null and request.supCode != ''">
|
||||
AND `SUP_CODE` = ${r'#'}{request.supCode}
|
||||
</if>
|
||||
<if test="request.supName != null and request.supName != ''">
|
||||
AND `SUP_NAME` = ${r'#'}{request.supName}
|
||||
</if>
|
||||
<if test="request.valid != null">
|
||||
AND `VALID` = ${r'#'}{request.valid}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="search" resultMap="res">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
<if test="request.keyword != null and request.keyword != ''">
|
||||
1 = 2
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insert">
|
||||
INSERT INTO
|
||||
<include refid="table"/>
|
||||
(
|
||||
<include refid="entityColumnList"/>
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
${r'#'}{request.id},
|
||||
${r'#'}{request.resCode,jdbcType=VARCHAR},
|
||||
${r'#'}{request.resName,jdbcType=VARCHAR},
|
||||
${r'#'}{request.resType,jdbcType=VARCHAR},
|
||||
${r'#'}{request.resValue,jdbcType=VARCHAR},
|
||||
${r'#'}{request.supCode,jdbcType=VARCHAR},
|
||||
${r'#'}{request.supName,jdbcType=VARCHAR},
|
||||
${r'#'}{request.valid,jdbcType=BIT},
|
||||
0,
|
||||
0,
|
||||
${r'#'}{token.userId,jdbcType=NUMERIC},
|
||||
sysdate(),
|
||||
NULL,
|
||||
NULL
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch">
|
||||
INSERT INTO
|
||||
<include refid="table"/>
|
||||
(
|
||||
<include refid="entityColumnList"/>
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item= "item" index ="index" separator=",">
|
||||
(
|
||||
${r'#'}{item.id},
|
||||
${r'#'}{item.resCode,jdbcType=VARCHAR},
|
||||
${r'#'}{item.resName,jdbcType=VARCHAR},
|
||||
${r'#'}{item.resType,jdbcType=VARCHAR},
|
||||
${r'#'}{item.resValue,jdbcType=VARCHAR},
|
||||
${r'#'}{item.supCode,jdbcType=VARCHAR},
|
||||
${r'#'}{item.supName,jdbcType=VARCHAR},
|
||||
${r'#'}{item.valid,jdbcType=BIT},
|
||||
0,
|
||||
0,
|
||||
${r'#'}{token.userId,jdbcType=NUMERIC},
|
||||
sysdate(),
|
||||
NULL,
|
||||
NULL
|
||||
)
|
||||
</foreach >
|
||||
</insert>
|
||||
|
||||
<update id="delete">
|
||||
UPDATE
|
||||
<include refid="table"/>
|
||||
SET `IS_DELETED` = 1
|
||||
WHERE `IS_DELETED` = 0
|
||||
AND `ID` = ${r'#'}{request.id}
|
||||
</update>
|
||||
|
||||
<update id="update">
|
||||
UPDATE
|
||||
<include refid="table"/>
|
||||
SET
|
||||
`RES_CODE` = ${r'#'}{request.resCode,jdbcType=VARCHAR},
|
||||
`RES_NAME` = ${r'#'}{request.resName,jdbcType=VARCHAR},
|
||||
`RES_TYPE` = ${r'#'}{request.resType,jdbcType=VARCHAR},
|
||||
`RES_VALUE` = ${r'#'}{request.resValue,jdbcType=VARCHAR},
|
||||
`SUP_CODE` = ${r'#'}{request.supCode,jdbcType=VARCHAR},
|
||||
`SUP_NAME` = ${r'#'}{request.supName,jdbcType=VARCHAR},
|
||||
`VALID` = ${r'#'}{request.valid,jdbcType=BIT},
|
||||
`ROW_VERSION` = `ROW_VERSION` + 1,
|
||||
`LAST_UPDATE_BY` = ${r'#'}{token.userId},
|
||||
`LAST_UPDATE_TIME` = sysdate()
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
AND `ID` = ${r'#'}{request.id}
|
||||
AND `ROW_VERSION` = ${r'#'}{request.rowVersion}
|
||||
</update>
|
||||
|
||||
<select id="get" resultMap="res">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
AND `ID` = ${r'#'}{request.id}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="${basePackage}.module.system.mpr.RoleResMapper">
|
||||
|
||||
<sql id="table">`SYS_ROLE_RES`</sql>
|
||||
|
||||
<sql id="entityColumnList">
|
||||
`ID`,`ROLE_ID`,`ROLE_CODE`,`RES_ID`,`RES_CODE`,`ROW_VERSION`,`IS_DELETED`,`CREATE_BY`,`CREATE_TIME`,`LAST_UPDATE_BY`,`LAST_UPDATE_TIME`
|
||||
</sql>
|
||||
|
||||
<resultMap id="roleRes" type="${basePackage}.module.system.ent.RoleRes">
|
||||
<result column="ID" jdbcType="BIGINT" property="id"/>
|
||||
<result column="ROLE_ID" jdbcType="BIGINT" property="roleId"/>
|
||||
<result column="ROLE_CODE" jdbcType="VARCHAR" property="roleCode"/>
|
||||
<result column="RES_ID" jdbcType="BIGINT" property="resId"/>
|
||||
<result column="RES_CODE" jdbcType="VARCHAR" property="resCode"/>
|
||||
<result column="ROW_VERSION" jdbcType="BIGINT" property="rowVersion"/>
|
||||
<result column="IS_DELETED" jdbcType="BIT" property="isDeleted"/>
|
||||
<result column="CREATE_BY" jdbcType="BIGINT" property="createBy"/>
|
||||
<result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="LAST_UPDATE_BY" jdbcType="BIGINT" property="lastUpdateBy"/>
|
||||
<result column="LAST_UPDATE_TIME" jdbcType="TIMESTAMP" property="lastUpdateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="find" resultMap="roleRes">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
<if test="request.roleId != null and request.roleId != 0">
|
||||
AND `ROLE_ID` = ${r'#'}{request.roleId}
|
||||
</if>
|
||||
<if test="request.roleCode != null and request.roleCode != ''">
|
||||
AND `ROLE_CODE` = ${r'#'}{request.roleCode}
|
||||
</if>
|
||||
<if test="request.resId != null and request.resId != 0">
|
||||
AND `RES_ID` = ${r'#'}{request.resId}
|
||||
</if>
|
||||
<if test="request.resCode != null and request.resCode != ''">
|
||||
AND `RES_CODE` = ${r'#'}{request.resCode}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="search" resultMap="roleRes">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
<if test="request.keyword != null and request.keyword != ''">
|
||||
1 = 2
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insert">
|
||||
INSERT INTO
|
||||
<include refid="table"/>
|
||||
(
|
||||
<include refid="entityColumnList"/>
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
${r'#'}{request.id},
|
||||
${r'#'}{request.roleId,jdbcType=BIGINT},
|
||||
${r'#'}{request.roleCode,jdbcType=VARCHAR},
|
||||
${r'#'}{request.resId,jdbcType=BIGINT},
|
||||
${r'#'}{request.resCode,jdbcType=VARCHAR},
|
||||
0,
|
||||
0,
|
||||
${r'#'}{token.userId,jdbcType=NUMERIC},
|
||||
sysdate(),
|
||||
NULL,
|
||||
NULL
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertBatch">
|
||||
INSERT INTO
|
||||
<include refid="table"/>
|
||||
(
|
||||
<include refid="entityColumnList"/>
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="list" item= "item" index ="index" separator=",">
|
||||
(
|
||||
${r'#'}{item.id},
|
||||
${r'#'}{item.roleId,jdbcType=BIGINT},
|
||||
${r'#'}{item.roleCode,jdbcType=VARCHAR},
|
||||
${r'#'}{item.resId,jdbcType=BIGINT},
|
||||
${r'#'}{item.resCode,jdbcType=VARCHAR},
|
||||
0,
|
||||
0,
|
||||
${r'#'}{token.userId,jdbcType=NUMERIC},
|
||||
sysdate(),
|
||||
NULL,
|
||||
NULL
|
||||
)
|
||||
</foreach >
|
||||
</insert>
|
||||
|
||||
<update id="delete">
|
||||
UPDATE
|
||||
<include refid="table"/>
|
||||
SET `IS_DELETED` = 1
|
||||
WHERE `IS_DELETED` = 0
|
||||
AND `ID` = ${r'#'}{request.id}
|
||||
</update>
|
||||
|
||||
<update id="update">
|
||||
UPDATE
|
||||
<include refid="table"/>
|
||||
SET
|
||||
`ROLE_ID` = ${r'#'}{request.roleId,jdbcType=BIGINT},
|
||||
`ROLE_CODE` = ${r'#'}{request.roleCode,jdbcType=VARCHAR},
|
||||
`RES_ID` = ${r'#'}{request.resId,jdbcType=BIGINT},
|
||||
`RES_CODE` = ${r'#'}{request.resCode,jdbcType=VARCHAR},
|
||||
`ROW_VERSION` = `ROW_VERSION` + 1,
|
||||
`LAST_UPDATE_BY` = ${r'#'}{token.userId},
|
||||
`LAST_UPDATE_TIME` = sysdate()
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
AND `ID` = ${r'#'}{request.id}
|
||||
AND `ROW_VERSION` = ${r'#'}{request.rowVersion}
|
||||
</update>
|
||||
|
||||
<select id="get" resultMap="roleRes">
|
||||
SELECT
|
||||
<include refid="entityColumnList"/>
|
||||
FROM
|
||||
<include refid="table"/>
|
||||
WHERE
|
||||
`IS_DELETED` = 0
|
||||
AND `ID` = ${r'#'}{request.id}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,78 @@
|
||||
package ${basePackage}.module.system.mpr;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import ${basePackage}.module.system.ent.Res;
|
||||
import ${basePackage}.module.system.req.ResCreateRequest;
|
||||
import ${basePackage}.module.system.req.ResDeleteRequest;
|
||||
import ${basePackage}.module.system.req.ResFindRequest;
|
||||
import ${basePackage}.module.system.req.ResGetRequest;
|
||||
import ${basePackage}.module.system.req.ResUpdateRequest;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
|
||||
/**
|
||||
* RES - 资源
|
||||
*
|
||||
* @author wangbing
|
||||
* @date 2020-01-05
|
||||
*/
|
||||
@Mapper
|
||||
public interface ResMapper {
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long insert(@Param("request") Res request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long insertBatch(@Param("list") List<Res> request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long delete(@Param("request") ResDeleteRequest request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long update(@Param("request") ResUpdateRequest request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回对象
|
||||
*/
|
||||
List<Res> find(@Param("request") ResFindRequest request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 获得对象
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回对象
|
||||
*/
|
||||
Res get(@Param("request") ResGetRequest request, @Param("token") Token token);
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package ${basePackage}.module.system.mpr;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import ${basePackage}.module.system.ent.RoleRes;
|
||||
import ${basePackage}.module.system.req.RoleResCreateRequest;
|
||||
import ${basePackage}.module.system.req.RoleResDeleteRequest;
|
||||
import ${basePackage}.module.system.req.RoleResFindRequest;
|
||||
import ${basePackage}.module.system.req.RoleResGetRequest;
|
||||
import ${basePackage}.module.system.req.RoleResUpdateRequest;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
|
||||
/**
|
||||
* ROLE_RES - 角色资源关系
|
||||
*
|
||||
* @author wangbing
|
||||
* @date 2020-01-05
|
||||
*/
|
||||
@Mapper
|
||||
public interface RoleResMapper {
|
||||
|
||||
/**
|
||||
* 插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long insert(@Param("request") RoleRes request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long insertBatch(@Param("list") List<RoleRes> request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 逻辑删除
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long delete(@Param("request") RoleResDeleteRequest request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回数量
|
||||
*/
|
||||
long update(@Param("request") RoleResUpdateRequest request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回对象
|
||||
*/
|
||||
List<RoleRes> find(@Param("request") RoleResFindRequest request, @Param("token") Token token);
|
||||
|
||||
/**
|
||||
* 获得对象
|
||||
*
|
||||
* @param request 请求对象
|
||||
* @param token 令牌
|
||||
* @return 返回对象
|
||||
*/
|
||||
RoleRes get(@Param("request") RoleResGetRequest request, @Param("token") Token token);
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import ${basePackage}.frame.validation.Dict;
|
||||
|
||||
/**
|
||||
* ResCreateRequest - 资源新增
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class ResCreateRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 资源代码
|
||||
*/
|
||||
@NotEmpty(message = "[resCode]资源代码不能为空")
|
||||
@Length(min = 0, max = 50, message = "[resCode]资源代码长度不合法(0-50)")
|
||||
private String resCode;
|
||||
|
||||
/**
|
||||
* 资源名称
|
||||
*/
|
||||
@Length(min = 0, max = 255, message = "[resName]资源名称长度不合法(0-255)")
|
||||
private String resName;
|
||||
|
||||
/**
|
||||
* 资源类型
|
||||
*/
|
||||
@NotNull(message = "[resType]资源类型不能为NULL")
|
||||
@Dict(name = "RES_TYPE")
|
||||
private String resType;
|
||||
|
||||
/**
|
||||
* 资源内容
|
||||
*/
|
||||
@Length(min = 0, max = 100, message = "[resValue]资源内容长度不合法(0-100)")
|
||||
private String resValue;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
@NotNull(message = "[valid]是否有效不能为NULL")
|
||||
private Boolean valid;
|
||||
|
||||
public String getResCode() {
|
||||
return this.resCode;
|
||||
}
|
||||
|
||||
public void setResCode(String resCode) {
|
||||
this.resCode = resCode;
|
||||
}
|
||||
|
||||
public String getResName() {
|
||||
return this.resName;
|
||||
}
|
||||
|
||||
public void setResName(String resName) {
|
||||
this.resName = resName;
|
||||
}
|
||||
|
||||
public String getResType() {
|
||||
return this.resType;
|
||||
}
|
||||
|
||||
public void setResType(String resType) {
|
||||
this.resType = resType;
|
||||
}
|
||||
|
||||
public String getResValue() {
|
||||
return this.resValue;
|
||||
}
|
||||
|
||||
public void setResValue(String resValue) {
|
||||
this.resValue = resValue;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseUpdateRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* ResDeleteRequest - 资源删除
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class ResDeleteRequest extends BaseUpdateRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "[id]主键不能为空")
|
||||
private long id;
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseFindRequest;
|
||||
import ${basePackage}.frame.validation.Dict;
|
||||
|
||||
/**
|
||||
* ResRequest - 资源查询
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class ResFindRequest extends BaseFindRequest {
|
||||
|
||||
/**
|
||||
* 资源代码
|
||||
*/
|
||||
private String resCode;
|
||||
|
||||
/**
|
||||
* 资源名称
|
||||
*/
|
||||
private String resName;
|
||||
|
||||
/**
|
||||
* 资源类型
|
||||
*/
|
||||
@Dict(name = "RES_TYPE")
|
||||
private String resType;
|
||||
|
||||
/**
|
||||
* 资源内容
|
||||
*/
|
||||
private String resValue;
|
||||
|
||||
/**
|
||||
* 上级代码
|
||||
*/
|
||||
private String supCode;
|
||||
|
||||
/**
|
||||
* 上级名称
|
||||
*/
|
||||
private String supName;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
private Boolean valid;
|
||||
|
||||
public String getResCode() {
|
||||
return this.resCode;
|
||||
}
|
||||
|
||||
public void setResCode(String resCode) {
|
||||
this.resCode = resCode;
|
||||
}
|
||||
|
||||
public String getResName() {
|
||||
return this.resName;
|
||||
}
|
||||
|
||||
public void setResName(String resName) {
|
||||
this.resName = resName;
|
||||
}
|
||||
|
||||
public String getResType() {
|
||||
return this.resType;
|
||||
}
|
||||
|
||||
public void setResType(String resType) {
|
||||
this.resType = resType;
|
||||
}
|
||||
|
||||
public String getResValue() {
|
||||
return this.resValue;
|
||||
}
|
||||
|
||||
public void setResValue(String resValue) {
|
||||
this.resValue = resValue;
|
||||
}
|
||||
|
||||
public String getSupCode() {
|
||||
return this.supCode;
|
||||
}
|
||||
|
||||
public void setSupCode(String supCode) {
|
||||
this.supCode = supCode;
|
||||
}
|
||||
|
||||
public String getSupName() {
|
||||
return this.supName;
|
||||
}
|
||||
|
||||
public void setSupName(String supName) {
|
||||
this.supName = supName;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* ResGetRequest - 资源获取
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class ResGetRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "[id]主键不能为空")
|
||||
private long id;
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
|
||||
/**
|
||||
* ResTreeRequest - 资源获取
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-26
|
||||
*/
|
||||
public class ResTreeRequest extends BaseRequest {
|
||||
|
||||
}
|
@ -0,0 +1,132 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseUpdateRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import ${basePackage}.frame.validation.Dict;
|
||||
|
||||
/**
|
||||
* ResUpdateRequest - 资源更新
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class ResUpdateRequest extends BaseUpdateRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "[id]主键不能为NULL")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 资源代码
|
||||
*/
|
||||
@NotEmpty(message = "[resCode]资源代码不能为空")
|
||||
@Length(min = 0, max = 50, message = "[resCode]资源代码长度不合法(0-50)")
|
||||
private String resCode;
|
||||
|
||||
/**
|
||||
* 资源名称
|
||||
*/
|
||||
@Length(min = 0, max = 255, message = "[resName]资源名称长度不合法(0-255)")
|
||||
private String resName;
|
||||
|
||||
/**
|
||||
* 资源类型
|
||||
*/
|
||||
@NotNull(message = "[resType]资源类型不能为NULL")
|
||||
@Dict(name = "RES_TYPE")
|
||||
private String resType;
|
||||
|
||||
/**
|
||||
* 资源内容
|
||||
*/
|
||||
@NotEmpty(message = "[resValue]资源内容不能为空")
|
||||
@Length(min = 0, max = 100, message = "[resValue]资源内容长度不合法(0-100)")
|
||||
private String resValue;
|
||||
|
||||
/**
|
||||
* 上级代码
|
||||
*/
|
||||
@Length(min = 0, max = 50, message = "[supCode]上级代码长度不合法(0-50)")
|
||||
private String supCode;
|
||||
|
||||
/**
|
||||
* 上级名称
|
||||
*/
|
||||
@Length(min = 0, max = 50, message = "[supName]上级名称长度不合法(0-50)")
|
||||
private String supName;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
@NotNull(message = "[valid]是否有效不能为NULL")
|
||||
private Boolean valid;
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getResCode() {
|
||||
return this.resCode;
|
||||
}
|
||||
|
||||
public void setResCode(String resCode) {
|
||||
this.resCode = resCode;
|
||||
}
|
||||
|
||||
public String getResName() {
|
||||
return this.resName;
|
||||
}
|
||||
|
||||
public void setResName(String resName) {
|
||||
this.resName = resName;
|
||||
}
|
||||
|
||||
public String getResType() {
|
||||
return this.resType;
|
||||
}
|
||||
|
||||
public void setResType(String resType) {
|
||||
this.resType = resType;
|
||||
}
|
||||
|
||||
public String getResValue() {
|
||||
return this.resValue;
|
||||
}
|
||||
|
||||
public void setResValue(String resValue) {
|
||||
this.resValue = resValue;
|
||||
}
|
||||
|
||||
public String getSupCode() {
|
||||
return this.supCode;
|
||||
}
|
||||
|
||||
public void setSupCode(String supCode) {
|
||||
this.supCode = supCode;
|
||||
}
|
||||
|
||||
public String getSupName() {
|
||||
return this.supName;
|
||||
}
|
||||
|
||||
public void setSupName(String supName) {
|
||||
this.supName = supName;
|
||||
}
|
||||
|
||||
public Boolean getValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void setValid(Boolean valid) {
|
||||
this.valid = valid;
|
||||
}
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
/**
|
||||
* RoleResCreateRequest - 角色资源关系新增
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class RoleResCreateRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 角色主键
|
||||
*/
|
||||
@NotNull(message = "[roleId]角色主键不能为NULL")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 角色代码
|
||||
*/
|
||||
@NotEmpty(message = "[roleCode]角色代码不能为空")
|
||||
@Length(min = 0, max = 50, message = "[roleCode]角色代码长度不合法(0-50)")
|
||||
private String roleCode;
|
||||
|
||||
/**
|
||||
* 资源主键
|
||||
*/
|
||||
@NotNull(message = "[resId]资源主键不能为NULL")
|
||||
private Long resId;
|
||||
|
||||
/**
|
||||
* 资源代码
|
||||
*/
|
||||
@NotEmpty(message = "[resCode]资源代码不能为空")
|
||||
@Length(min = 0, max = 50, message = "[resCode]资源代码长度不合法(0-50)")
|
||||
private String resCode;
|
||||
|
||||
public Long getRoleId() {
|
||||
return this.roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public String getRoleCode() {
|
||||
return this.roleCode;
|
||||
}
|
||||
|
||||
public void setRoleCode(String roleCode) {
|
||||
this.roleCode = roleCode;
|
||||
}
|
||||
|
||||
public Long getResId() {
|
||||
return this.resId;
|
||||
}
|
||||
|
||||
public void setResId(Long resId) {
|
||||
this.resId = resId;
|
||||
}
|
||||
|
||||
public String getResCode() {
|
||||
return this.resCode;
|
||||
}
|
||||
|
||||
public void setResCode(String resCode) {
|
||||
this.resCode = resCode;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseUpdateRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* RoleResDeleteRequest - 角色资源关系删除
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class RoleResDeleteRequest extends BaseUpdateRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "[id]主键不能为空")
|
||||
private long id;
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseFindRequest;
|
||||
|
||||
/**
|
||||
* RoleResRequest - 角色资源关系查询
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class RoleResFindRequest extends BaseFindRequest {
|
||||
|
||||
/**
|
||||
* 角色主键
|
||||
*/
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 角色代码
|
||||
*/
|
||||
private String roleCode;
|
||||
|
||||
/**
|
||||
* 资源主键
|
||||
*/
|
||||
private Long resId;
|
||||
|
||||
/**
|
||||
* 资源代码
|
||||
*/
|
||||
private String resCode;
|
||||
|
||||
public Long getRoleId() {
|
||||
return this.roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public String getRoleCode() {
|
||||
return this.roleCode;
|
||||
}
|
||||
|
||||
public void setRoleCode(String roleCode) {
|
||||
this.roleCode = roleCode;
|
||||
}
|
||||
|
||||
public Long getResId() {
|
||||
return this.resId;
|
||||
}
|
||||
|
||||
public void setResId(Long resId) {
|
||||
this.resId = resId;
|
||||
}
|
||||
|
||||
public String getResCode() {
|
||||
return this.resCode;
|
||||
}
|
||||
|
||||
public void setResCode(String resCode) {
|
||||
this.resCode = resCode;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package ${basePackage}.module.system.req;
|
||||
|
||||
import ${basePackage}.frame.base.BaseRequest;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* RoleResGetRequest - 角色资源关系获取
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class RoleResGetRequest extends BaseRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "[id]主键不能为空")
|
||||
private long id;
|
||||
|
||||
public long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* RoleResUpdateRequest - 角色资源关系更新
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class RoleResUpdateRequest extends BaseUpdateRequest {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@NotNull(message = "[id]主键不能为NULL")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 角色主键
|
||||
*/
|
||||
@NotNull(message = "[roleId]角色主键不能为NULL")
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 角色代码
|
||||
*/
|
||||
@NotEmpty(message = "[roleCode]角色代码不能为空")
|
||||
@Length(min = 0, max = 50, message = "[roleCode]角色代码长度不合法(0-50)")
|
||||
private String roleCode;
|
||||
|
||||
/**
|
||||
* 资源主键
|
||||
*/
|
||||
@NotNull(message = "[resId]资源主键不能为NULL")
|
||||
private Long resId;
|
||||
|
||||
/**
|
||||
* 资源代码
|
||||
*/
|
||||
@NotEmpty(message = "[resCode]资源代码不能为空")
|
||||
@Length(min = 0, max = 50, message = "[resCode]资源代码长度不合法(0-50)")
|
||||
private String resCode;
|
||||
|
||||
public Long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getRoleId() {
|
||||
return this.roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId) {
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public String getRoleCode() {
|
||||
return this.roleCode;
|
||||
}
|
||||
|
||||
public void setRoleCode(String roleCode) {
|
||||
this.roleCode = roleCode;
|
||||
}
|
||||
|
||||
public Long getResId() {
|
||||
return this.resId;
|
||||
}
|
||||
|
||||
public void setResId(Long resId) {
|
||||
this.resId = resId;
|
||||
}
|
||||
|
||||
public String getResCode() {
|
||||
return this.resCode;
|
||||
}
|
||||
|
||||
public void setResCode(String resCode) {
|
||||
this.resCode = resCode;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* ResCreateResponse - 资源
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class ResCreateResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* ResDeleteResponse - 资源
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class ResDeleteResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 删除数目
|
||||
*/
|
||||
private Long result;
|
||||
|
||||
public Long getResult() {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
public void setResult(Long result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseFindResponse;
|
||||
import ${basePackage}.module.system.ent.Res;
|
||||
|
||||
/**
|
||||
* ResFindResponse - 资源
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class ResFindResponse extends BaseFindResponse<Res> {
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.module.system.ent.Res;
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* ResGetResponse - 资源
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class ResGetResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 资源
|
||||
*/
|
||||
private Res res;
|
||||
|
||||
public Res getRes() {
|
||||
return this.res;
|
||||
}
|
||||
|
||||
public void setRes(Res res) {
|
||||
this.res = res;
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseFindResponse;
|
||||
import ${basePackage}.module.system.ent.ResTree;
|
||||
|
||||
/**
|
||||
* ResTreeResponse - 资源
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
public class ResTreeResponse extends BaseFindResponse<ResTree> {
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* ResUpdateResponse - 资源
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class ResUpdateResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 更新数目
|
||||
*/
|
||||
private Long result;
|
||||
|
||||
public Long getResult() {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
public void setResult(Long result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* RoleResCreateResponse - 角色资源关系
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class RoleResCreateResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* RoleResDeleteResponse - 角色资源关系
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class RoleResDeleteResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 删除数目
|
||||
*/
|
||||
private Long result;
|
||||
|
||||
public Long getResult() {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
public void setResult(Long result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseFindResponse;
|
||||
import ${basePackage}.module.system.ent.RoleRes;
|
||||
|
||||
/**
|
||||
* RoleResFindResponse - 角色资源关系
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class RoleResFindResponse extends BaseFindResponse<RoleRes> {
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.module.system.ent.RoleRes;
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* RoleResGetResponse - 角色资源关系
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class RoleResGetResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 角色资源关系
|
||||
*/
|
||||
private RoleRes roleRes;
|
||||
|
||||
public RoleRes getRoleRes() {
|
||||
return this.roleRes;
|
||||
}
|
||||
|
||||
public void setRoleRes(RoleRes roleRes) {
|
||||
this.roleRes = roleRes;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package ${basePackage}.module.system.rsp;
|
||||
|
||||
import ${basePackage}.frame.base.BaseResponse;
|
||||
|
||||
/**
|
||||
* RoleResUpdateResponse - 角色资源关系
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2020-01-05
|
||||
*/
|
||||
public class RoleResUpdateResponse extends BaseResponse {
|
||||
|
||||
/**
|
||||
* 更新数目
|
||||
*/
|
||||
private Long result;
|
||||
|
||||
public Long getResult() {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
public void setResult(Long result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
-- ----------------------------
|
||||
-- Table structure for RES - 资源
|
||||
-- Target : MySQL
|
||||
-- Author : wangbing
|
||||
-- Date: : 2020-01-05
|
||||
-- ----------------------------
|
||||
CREATE TABLE `SYS_RES` (
|
||||
`ID` BIGINT(20) NOT NULL COMMENT '主键',
|
||||
`RES_CODE` VARCHAR(50) NOT NULL COMMENT '资源代码',
|
||||
`RES_NAME` VARCHAR(250) COMMENT '资源名称',
|
||||
`RES_TYPE` VARCHAR(20) NOT NULL COMMENT '资源类型',
|
||||
`RES_VALUE` VARCHAR(100) NOT NULL COMMENT '资源内容',
|
||||
`SUP_CODE` VARCHAR(50) COMMENT '上级代码',
|
||||
`SUP_NAME` VARCHAR(50) COMMENT '上级名称',
|
||||
`VALID` TINYINT(1) NOT NULL COMMENT '是否有效',
|
||||
`ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本',
|
||||
`IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除',
|
||||
`CREATE_BY` BIGINT(20) NOT NULL COMMENT '创建用户',
|
||||
`CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间',
|
||||
`LAST_UPDATE_BY` BIGINT(20) DEFAULT NULL COMMENT '最后更新用户',
|
||||
`LAST_UPDATE_TIME` DATETIME DEFAULT NULL COMMENT '最后更新时间',
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='资源';
|
@ -0,0 +1,20 @@
|
||||
-- ----------------------------
|
||||
-- Table structure for ROLE_RES - 角色资源关系
|
||||
-- Target : MySQL
|
||||
-- Author : wangbing
|
||||
-- Date: : 2020-01-05
|
||||
-- ----------------------------
|
||||
CREATE TABLE `SYS_ROLE_RES` (
|
||||
`ID` BIGINT(20) NOT NULL COMMENT '主键',
|
||||
`ROLE_ID` BIGINT(20) NOT NULL COMMENT '角色主键',
|
||||
`ROLE_CODE` VARCHAR(50) NOT NULL COMMENT '角色代码',
|
||||
`RES_ID` BIGINT(20) NOT NULL COMMENT '资源主键',
|
||||
`RES_CODE` VARCHAR(50) 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='角色资源关系';
|
@ -1,139 +0,0 @@
|
||||
package ${basePackage}.system;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
import ${basePackage}.module.system.req.*;
|
||||
import ${basePackage}.module.system.rsp.*;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
|
||||
/**
|
||||
* ResourceTest - - 资源测试用例
|
||||
*
|
||||
* @author author
|
||||
* @version 0.0.1
|
||||
* @since 2017-01-01
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
@Transactional
|
||||
public class ResourceTest {
|
||||
|
||||
@Autowired
|
||||
private Token token;
|
||||
|
||||
@Autowired
|
||||
private ${basePackage}.module.system.mgr.ResourceManager resourceManager;
|
||||
|
||||
@Test
|
||||
public void testCreate() {
|
||||
ResourceCreateRequest request = new ResourceCreateRequest();
|
||||
request.setValue("资源内容");
|
||||
request.setComment("资源描述");
|
||||
request.setResourceType("code");
|
||||
request.setValid(true);
|
||||
|
||||
ResourceCreateResponse response = resourceManager.create(request,token);
|
||||
|
||||
assertTrue(!response.hasError());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDelete() {
|
||||
|
||||
//创建数据
|
||||
ResourceCreateRequest createRequest = new ResourceCreateRequest();
|
||||
createRequest.setValue("资源内容");
|
||||
createRequest.setComment("资源描述");
|
||||
createRequest.setResourceType("code");
|
||||
createRequest.setValid(true);
|
||||
|
||||
ResourceCreateResponse createResponse = resourceManager.create(createRequest,token);
|
||||
|
||||
assertTrue(!createResponse.hasError() && createResponse.getId() > 0);
|
||||
//删除数据
|
||||
ResourceDeleteRequest request = new ResourceDeleteRequest();
|
||||
request.setId(createResponse.getId());
|
||||
|
||||
ResourceDeleteResponse response = resourceManager.delete(request,token);
|
||||
|
||||
assertTrue(!response.hasError() && response.getResult() == 1L);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdate() {
|
||||
//创建数据
|
||||
ResourceCreateRequest createRequest = new ResourceCreateRequest();
|
||||
createRequest.setValue("资源内容");
|
||||
createRequest.setComment("资源描述");
|
||||
createRequest.setResourceType("code");
|
||||
createRequest.setValid(true);
|
||||
|
||||
ResourceCreateResponse createResponse = resourceManager.create(createRequest, token);
|
||||
|
||||
assertTrue(!createResponse.hasError());
|
||||
|
||||
//更新数据
|
||||
ResourceUpdateRequest request = new ResourceUpdateRequest();
|
||||
request.setId(createResponse.getId());
|
||||
request.setValue("资源内容");
|
||||
request.setComment("资源描述");
|
||||
request.setResourceType("code");
|
||||
request.setValid(true);
|
||||
|
||||
ResourceUpdateResponse response = resourceManager.update(request,token);
|
||||
|
||||
assertTrue(!response.hasError() && response.getResult() == 1L);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFind() {
|
||||
ResourceFindRequest request = new ResourceFindRequest();
|
||||
request.setValue("资源内容");
|
||||
request.setComment("资源描述");
|
||||
request.setResourceType("code");
|
||||
request.setValid(true);
|
||||
|
||||
ResourceFindResponse response = resourceManager.find(request,token);
|
||||
|
||||
assertTrue(!response.hasError());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGet() {
|
||||
//创建数据
|
||||
ResourceCreateRequest createRequest = new ResourceCreateRequest();
|
||||
createRequest.setValue("资源内容");
|
||||
createRequest.setComment("资源描述");
|
||||
createRequest.setResourceType("code");
|
||||
createRequest.setValid(true);
|
||||
|
||||
ResourceCreateResponse createResponse = resourceManager.create(createRequest, token);
|
||||
|
||||
assertTrue(!createResponse.hasError());
|
||||
|
||||
//获得数据
|
||||
ResourceGetRequest request = new ResourceGetRequest();
|
||||
request.setId(createResponse.getId());
|
||||
|
||||
ResourceGetResponse response = resourceManager.get(request,token);
|
||||
|
||||
assertTrue(!response.hasError() && response.getResource() != null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTree() {
|
||||
//创建数据
|
||||
ResourceTreeRequest request = new ResourceTreeRequest();
|
||||
|
||||
ResourceTreeResponse response = resourceManager.tree(request, token);
|
||||
|
||||
assertTrue(!response.hasError());
|
||||
}
|
||||
}
|
@ -1,118 +0,0 @@
|
||||
package ${basePackage}.system;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ${basePackage}.frame.base.Token;
|
||||
import ${basePackage}.module.system.mgr.RoleResourceManager;
|
||||
import ${basePackage}.module.system.req.*;
|
||||
import ${basePackage}.module.system.rsp.*;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
|
||||
/**
|
||||
* RoleResourceTest - - 角色资源关系测试用例
|
||||
*
|
||||
* @author wangbing
|
||||
* @version 0.0.1
|
||||
* @since 2019-12-27
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
@Transactional
|
||||
public class RoleResourceTest {
|
||||
|
||||
@Autowired
|
||||
private Token token;
|
||||
|
||||
@Autowired
|
||||
private RoleResourceManager roleResourceManager;
|
||||
|
||||
@Test
|
||||
public void testCreate() {
|
||||
RoleResourceCreateRequest request = new RoleResourceCreateRequest();
|
||||
request.setRoleId(1L);
|
||||
request.setResourceId(1L);
|
||||
|
||||
RoleResourceCreateResponse response = roleResourceManager.create(request,token);
|
||||
|
||||
assertTrue(!response.hasError());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDelete() {
|
||||
|
||||
//创建数据
|
||||
RoleResourceCreateRequest createRequest = new RoleResourceCreateRequest();
|
||||
createRequest.setRoleId(1L);
|
||||
createRequest.setResourceId(1L);
|
||||
|
||||
RoleResourceCreateResponse createResponse = roleResourceManager.create(createRequest,token);
|
||||
|
||||
assertTrue(!createResponse.hasError() && createResponse.getId() > 0);
|
||||
//删除数据
|
||||
RoleResourceDeleteRequest request = new RoleResourceDeleteRequest();
|
||||
request.setId(createResponse.getId());
|
||||
|
||||
RoleResourceDeleteResponse response = roleResourceManager.delete(request,token);
|
||||
|
||||
assertTrue(!response.hasError() && response.getResult() == 1L);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdate() {
|
||||
//创建数据
|
||||
RoleResourceCreateRequest createRequest = new RoleResourceCreateRequest();
|
||||
createRequest.setRoleId(1L);
|
||||
createRequest.setResourceId(1L);
|
||||
|
||||
RoleResourceCreateResponse createResponse = roleResourceManager.create(createRequest, token);
|
||||
|
||||
assertTrue(!createResponse.hasError());
|
||||
|
||||
//更新数据
|
||||
RoleResourceUpdateRequest request = new RoleResourceUpdateRequest();
|
||||
request.setId(createResponse.getId());
|
||||
request.setRoleId(1L);
|
||||
request.setResourceId(1L);
|
||||
|
||||
RoleResourceUpdateResponse response = roleResourceManager.update(request,token);
|
||||
|
||||
assertTrue(!response.hasError() && response.getResult() == 1L);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFind() {
|
||||
RoleResourceFindRequest request = new RoleResourceFindRequest();
|
||||
request.setRoleId(1L);
|
||||
request.setResourceId(1L);
|
||||
|
||||
RoleResourceFindResponse response = roleResourceManager.find(request,token);
|
||||
|
||||
assertTrue(!response.hasError());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGet() {
|
||||
//创建数据
|
||||
RoleResourceCreateRequest createRequest = new RoleResourceCreateRequest();
|
||||
createRequest.setRoleId(1L);
|
||||
createRequest.setResourceId(1L);
|
||||
|
||||
RoleResourceCreateResponse createResponse = roleResourceManager.create(createRequest, token);
|
||||
|
||||
assertTrue(!createResponse.hasError());
|
||||
|
||||
//获得数据
|
||||
RoleResourceGetRequest request = new RoleResourceGetRequest();
|
||||
request.setId(createResponse.getId());
|
||||
|
||||
RoleResourceGetResponse response = roleResourceManager.get(request,token);
|
||||
|
||||
assertTrue(!response.hasError() && response.getRoleResource() != null);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue