Skip to content

Commit

Permalink
fix the interface
Browse files Browse the repository at this point in the history
  • Loading branch information
liberhe committed Dec 17, 2023
1 parent 26ed0a9 commit 70ec7e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/dl/officialsite/team/TeamController.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ BaseResponse getTeamById(@RequestParam Long teamId, @RequestParam String address
/**
* 查询member属于那个团队
*/
@GetMapping("/member/teams")
@GetMapping("/member-team-info")
BaseResponse getMemberTeamsInfo(@RequestParam Long memberId, @RequestParam String address) {
List<TeamsWithMembers> teamMembers = teamService.getMemberTeamsInfo(memberId);
return BaseResponse.successWithData(teamMembers);
Expand Down
6 changes: 1 addition & 5 deletions src/main/java/com/dl/officialsite/team/TeamService.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ public javax.persistence.criteria.Predicate toPredicate(

List<Long> memberIds = teamMemberRepository.findByTeamIdAndStatus(team.getId(),
teamQueryVo.getStatus());
// memberIds.stream().forEach(memberId -> {
// Member member = memberRepository.findById(memberId).get();
// members.add(member);
// });
List<Member> members = memberRepository.findByIdIn(memberIds);
teamsMembersVo.setMembers(members);
teamsWithMembers.add(teamsMembersVo);
Expand Down Expand Up @@ -215,7 +211,7 @@ public void exit(TeamMemberJoinVO teamMember, String address) {

Optional<Member> member = memberRepository.findByAddress(address);
if(member.isPresent() ) {

// only self or admin
if (checkMemberIsAdmin(address) || member.get().getId().equals(teamMember.getMemberId())) {
teamMemberRepository.findByTeamAndMember(teamMember.getTeamId(),
teamMember.getMemberId()).ifPresent(teamMember1 -> {
Expand Down

0 comments on commit 70ec7e8

Please sign in to comment.