From 65357806674431ee6083ff55da89546d33f05838 Mon Sep 17 00:00:00 2001 From: huangyw <1207046171@qq.com> Date: Tue, 3 Sep 2024 08:49:15 +0800 Subject: [PATCH] =?UTF-8?q?release:=20PC=20=E7=94=A8=E6=88=B7=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/luoo/user/controller/SimpleUserController.java | 7 +++++++ .../src/main/java/com/luoo/user/dao/UserInfoDao.java | 2 ++ .../main/java/com/luoo/user/service/UserInfoService.java | 8 ++++++++ 3 files changed, 17 insertions(+) diff --git a/luoo_user/src/main/java/com/luoo/user/controller/SimpleUserController.java b/luoo_user/src/main/java/com/luoo/user/controller/SimpleUserController.java index 6bcc041..d5df043 100644 --- a/luoo_user/src/main/java/com/luoo/user/controller/SimpleUserController.java +++ b/luoo_user/src/main/java/com/luoo/user/controller/SimpleUserController.java @@ -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> getUserInfoList(String nickName) { + return Result.success(userInfoService.getUserInfo(nickName)); + } } diff --git a/luoo_user/src/main/java/com/luoo/user/dao/UserInfoDao.java b/luoo_user/src/main/java/com/luoo/user/dao/UserInfoDao.java index abe09af..89e3e75 100644 --- a/luoo_user/src/main/java/com/luoo/user/dao/UserInfoDao.java +++ b/luoo_user/src/main/java/com/luoo/user/dao/UserInfoDao.java @@ -54,4 +54,6 @@ public interface UserInfoDao extends JpaRepository, JpaSpecifi @Query(value = "select * from tb_user_info where vip_status = 1\n" + " and vip_expire_time < now()", nativeQuery = true) public List getExpireVipList(); + + public List getUserInfosByNickNameLike(String nickName); } diff --git a/luoo_user/src/main/java/com/luoo/user/service/UserInfoService.java b/luoo_user/src/main/java/com/luoo/user/service/UserInfoService.java index ea74db5..b974378 100644 --- a/luoo_user/src/main/java/com/luoo/user/service/UserInfoService.java +++ b/luoo_user/src/main/java/com/luoo/user/service/UserInfoService.java @@ -864,6 +864,14 @@ public class UserInfoService { return userInfoDao.findAllByIsAuthor(1); } + public List 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);