-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] 마이페이지 - 사용자가 제보한 가게 API #84
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kgy1008
requested changes
Jul 16, 2024
@@ -14,4 +15,8 @@ public class ReportFinder { | |||
public long getReportCount() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제 생각에는 long 보다는 int로 받는 것이 더 좋아보여요.
|
||
@Transactional(readOnly = true) | ||
public UserStoresReportedGetResponse findUserStoreReported(final Long userId) { | ||
return UserStoresReportedGetResponse.of(reportFinder.findAllByUserId(userId).stream().map(Report::getStore).distinct().toList()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hibernate 6 부터는 항상 distinct 가 적용된다고 합니다! distinct()
생략해도 될 것 같아요
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issue 📌
close #59
Description ✔️
To Reviewers
###작성한 JPQL
사용자의 report를 FK값 userId로 찾고, 연관된 store와 storeImage를 fetch join으로 가져왔습니다. 정렬은 생성일 내림차순으로 했습니다.
service
유저가 서로 다른 대학에 같은 가게를 제보했을 경우 가게가 중복으로 나오기 때문에 distinct()를 통해 중복제거를 해주었습니다.
실행쿼리