Search in sources :

Example 1 with SysRoleEntity

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);
}
Also used : SysRoleEntity(com.easy.cloud.core.operator.sysrole.pojo.entity.SysRoleEntity)

Example 2 with SysRoleEntity

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

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