use of com.easy.cloud.core.operator.sysresource.pojo.entity.SysResourceEntity in project dq-easy-cloud by dq-open-cloud.
the class SysResourceServiceImpl method findByRoleNos.
@Override
public List<SysResourceDTO> findByRoleNos(List<Integer> roleNos) {
if (EcCollectionsUtils.isEmpty(roleNos)) {
return new ArrayList<>();
}
SysResourceQuery query = new SysResourceQuery();
query.setRoleNos(roleNos);
List<SysResourceEntity> sysRoleEntities = sysResourceDAO.listRoleResourceByQuery(query);
if (EcCollectionsUtils.isEmpty(sysRoleEntities)) {
return new ArrayList<>();
}
return EcJSONUtils.parseArray(sysRoleEntities, SysResourceDTO.class);
}
use of com.easy.cloud.core.operator.sysresource.pojo.entity.SysResourceEntity in project dq-easy-cloud by dq-open-cloud.
the class SysResourceServiceImpl method getPermissionTree.
@Override
public EcBaseServiceResult getPermissionTree() {
SysResourceQuery query = new SysResourceQuery();
query.setAvailable(EcBaseConstant.EcAvailableEnum.YES.type());
List<SysResourceEntity> resourceEntities = sysResourceDAO.listByQuery(query);
List<SysResourceDTO> resourceDTOS = EcJSONUtils.parseArray(resourceEntities, SysResourceDTO.class);
for (SysResourceDTO sysResourceDTO : resourceDTOS) {
for (SysResourceDTO sysResourceDTOTemp : resourceDTOS) {
if (EcBaseUtils.equals(sysResourceDTOTemp.getParentNo(), sysResourceDTO.getResourceNo())) {
sysResourceDTO.getChildren().add(sysResourceDTOTemp);
}
}
}
for (SysResourceDTO sysResourceDTO : resourceDTOS) {
if (sysResourceDTO.getParentNo() == 0) {
return EcBaseServiceResult.newInstanceOfSucResult(sysResourceDTO);
}
}
return EcBaseServiceResult.newInstanceOfSuccess();
}
use of com.easy.cloud.core.operator.sysresource.pojo.entity.SysResourceEntity in project dq-easy-cloud by dq-open-cloud.
the class SysResourceServiceImpl method save.
@Transactional(rollbackFor = Exception.class)
@Override
public EcBaseServiceResult save(SysResourceDTO resourceDTO) {
SysResourceEntity resourceEntity = EcJSONUtils.parseObject(resourceDTO, SysResourceEntity.class);
sysResourceDAO.save(resourceEntity);
return EcBaseServiceResult.newInstanceOfSucResult(resourceEntity);
}
use of com.easy.cloud.core.operator.sysresource.pojo.entity.SysResourceEntity in project dq-easy-cloud by dq-open-cloud.
the class SysResourceServiceImpl method getInitData.
private List<SysResourceEntity> getInitData() {
List<SysResourceEntity> sysResourceEntities = new ArrayList<>();
// Integer resourceNo, String name, String type, String url, Integer parentNo,String parentNos, String permission
sysResourceEntities.add(new SysResourceEntity(1, "资源", "menu", "", 0, ""));
sysResourceEntities.add(new SysResourceEntity(11, "组织机构管理", "menu", "/organization", 1, "organization:*"));
sysResourceEntities.add(new SysResourceEntity(12, "组织机构新增", "button", "", 11, "organization:create"));
sysResourceEntities.add(new SysResourceEntity(13, "组织机构修改", "button", "", 11, "organization:update"));
sysResourceEntities.add(new SysResourceEntity(14, "组织机构删除", "button", "", 11, "organization:delete"));
sysResourceEntities.add(new SysResourceEntity(15, "组织机构查看", "button", "", 11, "organization:view"));
sysResourceEntities.add(new SysResourceEntity(21, "用户管理", "menu", "/user", 1, "user:*"));
sysResourceEntities.add(new SysResourceEntity(22, "用户新增", "button", "", 21, "user:create"));
sysResourceEntities.add(new SysResourceEntity(23, "用户修改", "button", "", 21, "user:update"));
sysResourceEntities.add(new SysResourceEntity(24, "用户删除", "button", "", 21, "user:delete"));
sysResourceEntities.add(new SysResourceEntity(25, "用户查看", "button", "", 21, "user:view"));
sysResourceEntities.add(new SysResourceEntity(31, "资源管理", "menu", "/token", 1, "token:*"));
sysResourceEntities.add(new SysResourceEntity(32, "资源新增", "button", "", 31, "token:create"));
sysResourceEntities.add(new SysResourceEntity(33, "资源修改", "button", "", 31, "token:update"));
sysResourceEntities.add(new SysResourceEntity(34, "资源删除", "button", "", 31, "token:delete"));
sysResourceEntities.add(new SysResourceEntity(35, "资源查看", "button", "", 31, "token:view"));
sysResourceEntities.add(new SysResourceEntity(41, "角色管理", "menu", "/role", 1, "role:*"));
sysResourceEntities.add(new SysResourceEntity(42, "角色新增", "button", "", 41, "role:create"));
sysResourceEntities.add(new SysResourceEntity(43, "角色修改", "button", "", 41, "role:update"));
sysResourceEntities.add(new SysResourceEntity(44, "角色删除", "button", "", 41, "role:delete"));
sysResourceEntities.add(new SysResourceEntity(45, "角色查看", "button", "", 41, "role:view"));
return sysResourceEntities;
}
Aggregations