Skip to content

Commit

Permalink
[HOTFIX] 그룹 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
ohksj77 committed Jan 13, 2024
1 parent 3a47967 commit b7247bf
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ public void inviteAll(final List<Member> friends) {
}

public List<GroupMember> getGroupMembers() {
checkExpireAll();
return this.groupMembers.stream().filter(GroupMember::isAccepted).toList();
}

Expand All @@ -86,24 +85,18 @@ private void addGroupMember(final GroupMember groupMember) {
}

private boolean hasSameMember(final GroupMember groupMember) {
checkExpireAll();
return this.groupMembers.stream()
.map(GroupMember::getMember)
.anyMatch(groupMember::isSameMember);
}

private void checkExpireAll() {
this.groupMembers.forEach(GroupMember::checkExpire);
}

public void updateMemberLocation(
final Member member, final Double longitude, final Double latitude) {
final GroupMember groupMember = getGroupMember(member);
groupMember.updateCoordinate(longitude, latitude);
}

private GroupMember getGroupMember(final Member member) {
checkExpireAll();
return this.groupMembers.stream()
.filter(groupMember -> groupMember.isSameMember(member))
.findAny()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,6 @@ public boolean isAccepted() {
return this.groupInviteCode == GroupInviteCode.ACCEPTED;
}

public void checkExpire() {
if (isRequestNotExpired()) {
return;
}
remove();
}

private boolean isRequestNotExpired() {
return this.baseTime == null
|| (this.groupInviteCode == GroupInviteCode.REQUESTED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,12 @@ public UUID getPlanMakerId() {
}

public void acceptInvite(final Member member) {
checkExpireAll();
this.planMembers.stream()
.filter(planMember -> planMember.isSameMember(member))
.findFirst()
.ifPresent(PlanMember::acceptInvite);
}

private void checkExpireAll() {
this.planMembers.forEach(PlanMember::checkExpire);
}

public void deleteInvite(final Member member) {
this.planMembers.removeIf(planMember -> planMember.isSameMember(member));
}
Expand Down

0 comments on commit b7247bf

Please sign in to comment.