Search in sources :

Example 1 with UserVo

use of com.paascloud.provider.model.vo.UserVo in project paascloud-master by paascloud.

the class UacUserCommonController method queryUserInfo.

/**
 * 根据userId查询用户详细信息(连表查询).
 *
 * @return the wrapper
 */
@PostMapping(value = "/queryUserInfo/{loginName}")
@ApiOperation(httpMethod = "POST", value = "根据userId查询用户详细信息")
public Wrapper<UserVo> queryUserInfo(@PathVariable String loginName) {
    logger.info("根据userId查询用户详细信息");
    UserVo userVo = new UserVo();
    UacUser uacUser = uacUserService.findByLoginName(loginName);
    uacUser = uacUserService.findUserInfoByUserId(uacUser.getId());
    List<UacRole> roleList = uacRoleService.findAllRoleInfoByUserId(uacUser.getId());
    List<MenuVo> authTree = uacRoleService.getOwnAuthTree(uacUser.getId());
    BeanUtils.copyProperties(uacUser, userVo);
    if (PublicUtil.isNotEmpty(roleList)) {
        userVo.setRoles(new HashSet<>(roleList));
    }
    userVo.setAuthTree(authTree);
    return WrapMapper.ok(userVo);
}
Also used : MenuVo(com.paascloud.provider.model.vo.MenuVo) UacUser(com.paascloud.provider.model.domain.UacUser) UserVo(com.paascloud.provider.model.vo.UserVo) UacRole(com.paascloud.provider.model.domain.UacRole) ApiOperation(io.swagger.annotations.ApiOperation)

Aggregations

UacRole (com.paascloud.provider.model.domain.UacRole)1 UacUser (com.paascloud.provider.model.domain.UacUser)1 MenuVo (com.paascloud.provider.model.vo.MenuVo)1 UserVo (com.paascloud.provider.model.vo.UserVo)1 ApiOperation (io.swagger.annotations.ApiOperation)1