Skip to content

Commit

Permalink
Merge pull request #109 from Princess-in-silvertown/fix/108
Browse files Browse the repository at this point in the history
πŸ› fix: 쀑볡 μ‚¬μš©μžλ₯Ό λ°˜ν™˜ν•˜μ§€ μ•Šλ„λ‘ μˆ˜μ •
  • Loading branch information
woosung1223 authored Oct 3, 2024
2 parents 76ac74f + 2db55f6 commit 3a4f9ef
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ private List<UserResponse> findAllUsersWithSameGroups(User user, String search)
.flatMap(List::stream)
.filter(each -> !each.getUser().getId().equals(user.getId()))
.map(each -> UserResponse.of(each.getUser(), each.getGroup().getId()))
.distinct()
.toList();
}

Expand Down
14 changes: 14 additions & 0 deletions src/main/java/slvtwn/khu/toyouserver/domain/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import java.time.LocalDate;
import java.util.Objects;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
Expand Down Expand Up @@ -57,4 +58,17 @@ public User updateInfo(String name, LocalDate birthday, String introduction, Str
this.profilePicture = profilePicture;
return this;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
User user = (User) o;
return Objects.equals(id, user.id) && Objects.equals(name, user.name);
}

@Override
public int hashCode() {
return Objects.hash(id, name);
}
}

0 comments on commit 3a4f9ef

Please sign in to comment.