-
Notifications
You must be signed in to change notification settings - Fork 0
[feat/#137] 기록에 좋아요한 유저 목록을 조회 #138
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
Open
juuuuone
wants to merge
3
commits into
develop
Choose a base branch
from
feat/#137-get-liked-users
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
18 changes: 18 additions & 0 deletions
18
clokey-api/src/main/java/org/clokey/domain/like/dto/response/LikedMembersResponse.java
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| package org.clokey.domain.like.dto.response; | ||
|
|
||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import java.util.List; | ||
|
|
||
| @Schema(description = "좋아요 유저 조회 결과") | ||
| public record LikedMembersResponse( | ||
| @Schema(description = "유저 미리보기 목록") List<LikedMemberPreview> memberPreviews, | ||
| @Schema(description = "마지막 페이지 여부", example = "false") boolean isLast) { | ||
|
|
||
| @Schema(description = "유저 미리보기 DTO") | ||
| public record LikedMemberPreview( | ||
| @Schema(description = "유저 ID", example = "30") Long id, | ||
| @Schema(description = "클로키 ID", example = "@Clokey_USER1") String codiveId, | ||
| @Schema(description = "프로필 이미지 URL") String imageUrl, | ||
| @Schema(description = "닉네임") String nickname, | ||
| @Schema(description = "팔로우 여부") boolean followStatus) {} | ||
| } |
This file contains hidden or 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
4 changes: 4 additions & 0 deletions
4
clokey-api/src/main/java/org/clokey/domain/like/service/LikeService.java
This file contains hidden or 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
This file contains hidden or 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
11 changes: 11 additions & 0 deletions
11
clokey-api/src/main/java/org/clokey/domain/member/repository/FollowRepository.java
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,23 @@ | ||
| package org.clokey.domain.member.repository; | ||
|
|
||
| import java.util.List; | ||
| import java.util.Optional; | ||
| import org.clokey.member.entity.Follow; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
| import org.springframework.data.jpa.repository.Query; | ||
|
|
||
| public interface FollowRepository extends JpaRepository<Follow, Long>, FollowRepositoryCustom { | ||
|
|
||
| boolean existsByFollowFrom_IdAndFollowTo_Id(Long fromMemberId, Long toMemberId); | ||
|
|
||
| @Query( | ||
| """ | ||
| SELECT f.followTo.id | ||
| FROM Follow f | ||
| WHERE f.followFrom.id = :fromMemberId | ||
| AND f.followTo.id IN :toMemberIds | ||
| """) | ||
| List<Long> findFollowedMemberIds(Long fromMemberId, List<Long> toMemberIds); | ||
|
|
||
| Optional<Follow> findByFollowFrom_IdAndFollowTo_Id(Long fromMemberId, Long toMemberId); | ||
| } |
This file contains hidden or 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
Oops, something went wrong.
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.
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.
이 부분 N+1문제가 터질 것 같아요.
페이징은 기존에 사용하던 Projection 적용 부탁드려요(customRepository)! 성능 차이가 큽니다!