diff --git a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/team/TeamRestController.java b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/team/TeamRestController.java index 300e3fe4..712addd7 100644 --- a/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/team/TeamRestController.java +++ b/rc-service/rc-service-other/other-adapter/src/main/java/com/red/circle/other/adapter/app/team/TeamRestController.java @@ -90,7 +90,16 @@ public class TeamRestController extends BaseController { return teamService.listTeamMember(cmd); } - /** + /** + * 搜索团队成员列表. + */ + @GetMapping("/search-members") + public List searchTeamMember(AppExtCommand cmd, @RequestParam String account) { + return teamService.searchTeamMember(cmd.getReqUserId(), account); + } + + + /** * 成员数量 */ @GetMapping("/members/count") diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/query/TeamMemberListQryExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/query/TeamMemberListQryExe.java index 187fe39c..7baaea96 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/query/TeamMemberListQryExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/query/TeamMemberListQryExe.java @@ -6,6 +6,7 @@ import com.red.circle.other.app.convertor.user.UserProfileAppConvertor; import com.red.circle.other.app.dto.clientobject.team.TeamMemberCO; import com.red.circle.other.app.dto.clientobject.team.TeamMemberCountResultCO; import com.red.circle.other.domain.gateway.user.UserProfileGateway; +import com.red.circle.other.domain.model.user.UserProfile; import com.red.circle.other.infra.database.mongo.dto.team.TeamPolicy; import com.red.circle.other.infra.database.mongo.entity.team.team.TeamMember; import com.red.circle.other.infra.database.mongo.entity.team.team.TeamMemberTarget; @@ -161,4 +162,23 @@ public class TeamMemberListQryExe { .orElse(0); } + public List searchTeamMember(Long reqUserId, String account) { + TeamMember reqTeamMember = teamMemberService.getByMemberId(reqUserId); + if (reqTeamMember == null) { + return Collections.emptyList(); + } + + List userProfiles = userProfileGateway.getByAccount(account); + if (CollectionUtils.isEmpty(userProfiles)) { + return Collections.emptyList(); + } + UserProfile userProfile = userProfiles.get(0); + TeamMember teamMember = teamMemberService.getByMemberId(userProfile.getId()); + if (teamMember == null || !teamMember.getTeamId().equals(reqTeamMember.getTeamId())) { + return Collections.emptyList(); + } + return Collections.singletonList(new TeamMemberCO().setUserProfile(userProfileAppConvertor.toUserProfileDTO(userProfile))); + } + + } diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/team/TeamServiceImpl.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/team/TeamServiceImpl.java index 89872da4..6ef75799 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/team/TeamServiceImpl.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/service/team/TeamServiceImpl.java @@ -279,4 +279,9 @@ public class TeamServiceImpl implements TeamService { public void processBdInviteMessage(AgentInviteMessageProcessCmd cmd) { agentInviteHostExe.processInvite(cmd); } + + @Override + public List searchTeamMember(Long reqUserId, String account) { + return teamMemberListQryExe.searchTeamMember(reqUserId, account); + } } diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/team/TeamService.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/team/TeamService.java index 19142cd5..bf8a2d9f 100644 --- a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/team/TeamService.java +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/service/team/TeamService.java @@ -202,4 +202,6 @@ public interface TeamService { List listAgentInviteMessageOwn(BdInviteQryCmd cmd); void processBdInviteMessage(AgentInviteMessageProcessCmd cmd); + + List searchTeamMember(Long reqUserId, String account); }