From 1a54eef1a63550d6718a2079c863fcc7eb0624e4 Mon Sep 17 00:00:00 2001 From: b2894lxlx <517289602@qq.com> Date: Sun, 10 Aug 2025 00:25:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9F=A5=E8=AF=A2=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=8E=A5=E5=8F=A3(=E6=97=A0=E9=9C=80=E7=99=BB?= =?UTF-8?q?=E5=BD=95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gxwebsoft/common/core/security/SecurityConfig.java | 1 + .../gxwebsoft/common/system/controller/UserController.java | 6 ++++++ .../com/gxwebsoft/common/system/service/UserService.java | 2 ++ .../common/system/service/impl/UserServiceImpl.java | 5 +++++ 4 files changed, 14 insertions(+) diff --git a/src/main/java/com/gxwebsoft/common/core/security/SecurityConfig.java b/src/main/java/com/gxwebsoft/common/core/security/SecurityConfig.java index 63b9c19..046378f 100644 --- a/src/main/java/com/gxwebsoft/common/core/security/SecurityConfig.java +++ b/src/main/java/com/gxwebsoft/common/core/security/SecurityConfig.java @@ -69,6 +69,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { "/api/system/user/getUserWithoutLogin", "/api/system/user/batchBackUserId", "/api/system/user/getByPhone/**", + "/api/system/user/getByUserId/**", "/api/system/user/getByUnionid/**", "/api/system/user/updateUserOfficeOpenidWithoutLogin", "/api/system/user-referee/getReferee/**", diff --git a/src/main/java/com/gxwebsoft/common/system/controller/UserController.java b/src/main/java/com/gxwebsoft/common/system/controller/UserController.java index 51e332d..106206d 100644 --- a/src/main/java/com/gxwebsoft/common/system/controller/UserController.java +++ b/src/main/java/com/gxwebsoft/common/system/controller/UserController.java @@ -93,6 +93,12 @@ public class UserController extends BaseController { return success(userService.getByPhone(phone)); } + @ApiOperation("根据UserId查询用户(无需登录)") + @GetMapping("/getByUserId/{userId}") + public ApiResult getByUserId(@PathVariable("userId") String userId) { + return success(userService.getAllByUserId(userId)); + } + @ApiOperation("根据unionid查询用户") @GetMapping("/getByUnionid/{unionid}") public ApiResult getByUnionid(@PathVariable("unionid") String unionid) { diff --git a/src/main/java/com/gxwebsoft/common/system/service/UserService.java b/src/main/java/com/gxwebsoft/common/system/service/UserService.java index 79b377e..c367a30 100644 --- a/src/main/java/com/gxwebsoft/common/system/service/UserService.java +++ b/src/main/java/com/gxwebsoft/common/system/service/UserService.java @@ -114,6 +114,8 @@ public interface UserService extends IService, UserDetailsService { User getAdminByPhone(UserParam param); + User getAllByUserId(String userId); + Integer userNumInPark(UserParam param); Integer orgNumInPark(UserParam param); diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/UserServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/UserServiceImpl.java index 9ff9868..65333de 100644 --- a/src/main/java/com/gxwebsoft/common/system/service/impl/UserServiceImpl.java +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/UserServiceImpl.java @@ -296,6 +296,11 @@ public class UserServiceImpl extends ServiceImpl implements Us return baseMapper.getByUserId(userId); } + @Override + public User getAllByUserId(String userId) { + return getOne(new LambdaQueryWrapper().eq(User::getUserId, userId).last("limit 1")); + } + /** * 批量查询用户的角色 *