use of com.easy.cloud.core.operator.sysrole.pojo.entity.SysRoleEntity in project dq-easy-cloud by dq-open-cloud.
the class SysRoleServiceImpl method save.
@Override
public EcBaseServiceResult save(SysRoleDTO roleDTO) {
SysRoleEntity roleEntity = EcJSONUtils.parseObject(roleDTO, SysRoleEntity.class);
sysRoleDAO.save(roleEntity);
return EcBaseServiceResult.newInstanceOfSucResult(roleEntity);
}
use of com.easy.cloud.core.operator.sysrole.pojo.entity.SysRoleEntity in project dq-easy-cloud by dq-open-cloud.
the class SysRoleServiceImpl method findByUserId.
@Override
public List<SysRoleDTO> findByUserId(Long userId) {
if (EcBaseUtils.isNull(userId)) {
throw new EcBaseBusinessException("A_11111111", "用户编号不能为空");
}
SysRoleQuery query = new SysRoleQuery();
query.setUserId(userId);
List<SysRoleEntity> sysRoleEntities = sysRoleDAO.listByQuery(query);
if (EcCollectionsUtils.isEmpty(sysRoleEntities)) {
return new ArrayList<>();
}
return EcJSONUtils.parseArray(sysRoleEntities, SysRoleDTO.class);
}
Aggregations