新增 搜索团队成员列表接口

This commit is contained in:
tianfeng 2025-11-21 10:57:28 +08:00
parent 7fdf4e4232
commit b3f4e9c665
4 changed files with 37 additions and 1 deletions

View File

@ -90,7 +90,16 @@ public class TeamRestController extends BaseController {
return teamService.listTeamMember(cmd);
}
/**
/**
* 搜索团队成员列表.
*/
@GetMapping("/search-members")
public List<TeamMemberCO> searchTeamMember(AppExtCommand cmd, @RequestParam String account) {
return teamService.searchTeamMember(cmd.getReqUserId(), account);
}
/**
* 成员数量
*/
@GetMapping("/members/count")

View File

@ -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<TeamMemberCO> searchTeamMember(Long reqUserId, String account) {
TeamMember reqTeamMember = teamMemberService.getByMemberId(reqUserId);
if (reqTeamMember == null) {
return Collections.emptyList();
}
List<UserProfile> 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)));
}
}

View File

@ -279,4 +279,9 @@ public class TeamServiceImpl implements TeamService {
public void processBdInviteMessage(AgentInviteMessageProcessCmd cmd) {
agentInviteHostExe.processInvite(cmd);
}
@Override
public List<TeamMemberCO> searchTeamMember(Long reqUserId, String account) {
return teamMemberListQryExe.searchTeamMember(reqUserId, account);
}
}

View File

@ -202,4 +202,6 @@ public interface TeamService {
List<BdInviteMessageCO> listAgentInviteMessageOwn(BdInviteQryCmd cmd);
void processBdInviteMessage(AgentInviteMessageProcessCmd cmd);
List<TeamMemberCO> searchTeamMember(Long reqUserId, String account);
}