From 26079198e12eb36783cb34225cc8ec94265f20be Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Tue, 9 Jun 2020 15:18:40 +0800 Subject: [PATCH] get user --- .../java/io/metersphere/controller/UserController.java | 5 +++-- .../src/main/java/io/metersphere/service/UserService.java | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/io/metersphere/controller/UserController.java b/backend/src/main/java/io/metersphere/controller/UserController.java index 7b374435a4..0deb7b9ba6 100644 --- a/backend/src/main/java/io/metersphere/controller/UserController.java +++ b/backend/src/main/java/io/metersphere/controller/UserController.java @@ -10,9 +10,9 @@ import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; import io.metersphere.commons.utils.SessionUtils; import io.metersphere.controller.request.member.AddMemberRequest; -import io.metersphere.controller.request.member.UserRequest; import io.metersphere.controller.request.member.EditPassWordRequest; import io.metersphere.controller.request.member.QueryMemberRequest; +import io.metersphere.controller.request.member.UserRequest; import io.metersphere.controller.request.organization.AddOrgMemberRequest; import io.metersphere.controller.request.organization.QueryOrgMemberRequest; import io.metersphere.dto.UserDTO; @@ -25,6 +25,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.shiro.authz.annotation.Logical; import org.apache.shiro.authz.annotation.RequiresRoles; import org.springframework.web.bind.annotation.*; + import javax.annotation.Resource; import java.util.List; @@ -161,7 +162,7 @@ public class UserController { } @GetMapping("/info/{userId}") - public User getUserInfo(@PathVariable(value = "userId") String userId) { + public UserDTO getUserInfo(@PathVariable(value = "userId") String userId) { return userService.getUserInfo(userId); } diff --git a/backend/src/main/java/io/metersphere/service/UserService.java b/backend/src/main/java/io/metersphere/service/UserService.java index 86b3bfe98d..0d07677969 100644 --- a/backend/src/main/java/io/metersphere/service/UserService.java +++ b/backend/src/main/java/io/metersphere/service/UserService.java @@ -11,9 +11,9 @@ import io.metersphere.commons.user.SessionUser; import io.metersphere.commons.utils.CodingUtil; import io.metersphere.commons.utils.SessionUtils; import io.metersphere.controller.request.member.AddMemberRequest; -import io.metersphere.controller.request.member.UserRequest; import io.metersphere.controller.request.member.EditPassWordRequest; import io.metersphere.controller.request.member.QueryMemberRequest; +import io.metersphere.controller.request.member.UserRequest; import io.metersphere.controller.request.organization.AddOrgMemberRequest; import io.metersphere.controller.request.organization.QueryOrgMemberRequest; import io.metersphere.dto.UserDTO; @@ -25,6 +25,7 @@ import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; + import javax.annotation.Resource; import java.util.*; import java.util.stream.Collectors; @@ -252,8 +253,8 @@ public class UserService { userMapper.updateByPrimaryKeySelective(newUser); } - public User getUserInfo(String userId) { - return userMapper.selectByPrimaryKey(userId); + public UserDTO getUserInfo(String userId) { + return getUserDTO(userId); } public List getMemberList(QueryMemberRequest request) {