Search in sources :

Example 1 with SysRoleQuery

use of com.easy.cloud.core.operator.sysrole.pojo.query.SysRoleQuery 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);
}
Also used : SysRoleQuery(com.easy.cloud.core.operator.sysrole.pojo.query.SysRoleQuery) ArrayList(java.util.ArrayList) EcBaseBusinessException(com.easy.cloud.core.exception.bo.EcBaseBusinessException) SysRoleEntity(com.easy.cloud.core.operator.sysrole.pojo.entity.SysRoleEntity)

Aggregations

EcBaseBusinessException (com.easy.cloud.core.exception.bo.EcBaseBusinessException)1 SysRoleEntity (com.easy.cloud.core.operator.sysrole.pojo.entity.SysRoleEntity)1 SysRoleQuery (com.easy.cloud.core.operator.sysrole.pojo.query.SysRoleQuery)1 ArrayList (java.util.ArrayList)1