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")); + } + /** * 批量查询用户的角色 *