release: PC 用户查询

release-2024-04-25
huangyw 3 months ago
parent e960ef5925
commit 6535780667

@ -87,5 +87,12 @@ public class SimpleUserController {
authors = authors.stream().map(userInfo -> {userInfo.setAvatar(Constants.RESOURCE_PREFIX + userInfo.getAvatar());return userInfo;}).collect(Collectors.toList());
return Result.success(authors);
}
@ApiOperation(value = "获取用户信息")
@GetMapping("/listByNickName")
@GlobalInterceptor(checkAdminLogin = true)
public Result<List<UserInfo>> getUserInfoList(String nickName) {
return Result.success(userInfoService.getUserInfo(nickName));
}
}

@ -54,4 +54,6 @@ public interface UserInfoDao extends JpaRepository<UserInfo, String>, JpaSpecifi
@Query(value = "select * from tb_user_info where vip_status = 1\n" +
" and vip_expire_time < now()", nativeQuery = true)
public List<UserInfo> getExpireVipList();
public List<UserInfo> getUserInfosByNickNameLike(String nickName);
}

@ -864,6 +864,14 @@ public class UserInfoService {
return userInfoDao.findAllByIsAuthor(1);
}
public List<UserInfo> getUserInfo(String nickName) {
if (StringUtils.isBlank(nickName)) {
return null;
} else {
return userInfoDao.getUserInfosByNickNameLike(nickName);
}
}
@Transactional(rollbackFor = Exception.class)
public String createInvitationCode(String token) {
UserLoginDto user = jwtUtil.getUserLoginDto(token);

Loading…
Cancel
Save