diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.java new file mode 100644 index 0000000000..7820c7475d --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.java @@ -0,0 +1,11 @@ +package io.metersphere.base.mapper.ext; + +import io.metersphere.base.domain.User; +import io.metersphere.controller.request.UserRequest; +import org.apache.ibatis.annotations.Param; +import java.util.List; + +public interface ExtUserMapper { + + List getUserList(@Param("userRequest") UserRequest request); +} diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.xml new file mode 100644 index 0000000000..eb7fa6fd55 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/controller/UserController.java b/backend/src/main/java/io/metersphere/controller/UserController.java index 8d1708ecb4..6c7df388c1 100644 --- a/backend/src/main/java/io/metersphere/controller/UserController.java +++ b/backend/src/main/java/io/metersphere/controller/UserController.java @@ -7,6 +7,7 @@ import io.metersphere.base.domain.User; import io.metersphere.commons.constants.RoleConstants; import io.metersphere.commons.utils.PageUtils; import io.metersphere.commons.utils.Pager; +import io.metersphere.controller.request.UserRequest; import io.metersphere.controller.request.member.AddMemberRequest; import io.metersphere.controller.request.member.QueryMemberRequest; import io.metersphere.controller.request.organization.AddOrgMemberRequest; @@ -44,9 +45,9 @@ public class UserController { @PostMapping("/list/{goPage}/{pageSize}") @RequiresRoles(RoleConstants.ADMIN) - public Pager> getUserList(@PathVariable int goPage, @PathVariable int pageSize) { + public Pager> getUserList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody UserRequest request) { Page page = PageHelper.startPage(goPage, pageSize, true); - return PageUtils.setPageInfo(page, userService.getUserList()); + return PageUtils.setPageInfo(page, userService.getUserListWithRequest(request)); } @GetMapping("/delete/{userId}") diff --git a/backend/src/main/java/io/metersphere/controller/request/UserRequest.java b/backend/src/main/java/io/metersphere/controller/request/UserRequest.java new file mode 100644 index 0000000000..73dab356a3 --- /dev/null +++ b/backend/src/main/java/io/metersphere/controller/request/UserRequest.java @@ -0,0 +1,32 @@ +package io.metersphere.controller.request; + +public class UserRequest { + + private String id; + private String name; + private String email; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } +} diff --git a/backend/src/main/java/io/metersphere/service/UserService.java b/backend/src/main/java/io/metersphere/service/UserService.java index 67eb018ce5..687b10cb81 100644 --- a/backend/src/main/java/io/metersphere/service/UserService.java +++ b/backend/src/main/java/io/metersphere/service/UserService.java @@ -2,9 +2,11 @@ package io.metersphere.service; import io.metersphere.base.domain.*; import io.metersphere.base.mapper.*; +import io.metersphere.base.mapper.ext.ExtUserMapper; import io.metersphere.base.mapper.ext.ExtUserRoleMapper; import io.metersphere.commons.exception.MSException; import io.metersphere.commons.utils.CodingUtil; +import io.metersphere.controller.request.UserRequest; import io.metersphere.controller.request.member.AddMemberRequest; import io.metersphere.controller.request.member.QueryMemberRequest; import io.metersphere.controller.request.organization.AddOrgMemberRequest; @@ -13,7 +15,6 @@ import io.metersphere.dto.OrganizationMemberDTO; import io.metersphere.dto.UserDTO; import io.metersphere.dto.UserRoleDTO; import io.metersphere.dto.UserRoleHelpDTO; -import io.metersphere.i18n.Translator; import io.metersphere.user.SessionUser; import io.metersphere.user.SessionUtils; import org.apache.commons.lang3.StringUtils; @@ -42,6 +43,8 @@ public class UserService { private OrganizationMapper organizationMapper; @Resource private WorkspaceMapper workspaceMapper; + @Resource + private ExtUserMapper extUserMapper; public UserDTO insert(User user) { checkUserParam(user); @@ -112,6 +115,10 @@ public class UserService { return userMapper.selectByExample(null); } + public List getUserListWithRequest(UserRequest request) { + return extUserMapper.getUserList(request); + } + public void deleteUser(String userId) { userMapper.deleteByPrimaryKey(userId); } diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index 8f9438d68c..55d164f5ed 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -61,7 +61,7 @@ export default { 'search_by_name': '根据名称搜索', 'input_name': '请输入项目名称', 'owning_workspace': '所属工作空间', - 'please_choose_workspace': '选择工作空间', + 'please_choose_workspace': '请选择工作空间', }, member: { 'create': '添加成员', diff --git a/frontend/src/performance/components/project/MsProject.vue b/frontend/src/performance/components/project/MsProject.vue index a8995bc0f5..7a74ab6e09 100644 --- a/frontend/src/performance/components/project/MsProject.vue +++ b/frontend/src/performance/components/project/MsProject.vue @@ -53,16 +53,6 @@ - - - - - -