-
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, 찔러보기 요청 수, 상세 정보 조회 API 개발 #124
Conversation
Test Results0 tests 0 ✅ 0s ⏱️ Results for commit 9867520. ♻️ This comment has been updated with latest results. |
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.
🤜🏻굳
User receiver = userCommonService.getUserById(request.getReceiverId()); | ||
ProfileCardLike profileCardLike = request.toEntity(tokenUser, receiver); | ||
profileCardLikeRepository.save(profileCardLike); | ||
|
||
profileCardService.increaseTotalLikeAmount(receiver.getId()); | ||
userProfileService.decreaseAvailableLikeCount(userId); | ||
|
||
return profileCardLike.getId(); | ||
} | ||
|
||
// 나의 찔러보기 요청 수 조회 | ||
public Long getReceivedLikeCountForProfileCard(Long userId, Long id) { | ||
User tokenUser = validateToken(userId); | ||
validateSendor(tokenUser, userId); | ||
|
||
return profileCardLikeRepository.getLikeCount(id); | ||
} | ||
|
||
// 내가 보낸 찔러보기 요청 수 조회 | ||
public Long getSentLikeCountForProfileCard(Long userId, Long id) { | ||
User tokenUser = validateToken(userId); | ||
validateSendor(tokenUser, userId); | ||
|
||
return profileCardLikeRepository.getLikeCountByCondition(id, null); | ||
} | ||
|
||
public CursorPaginationResult<UserProfileLikeInfoAPIRes> getLikeInfoSenderProfile( | ||
Long userId, Long id, CursorPaginationInfoReq pageable) { | ||
User tokenUser = validateToken(userId); | ||
validateSendor(tokenUser, userId); | ||
|
||
return profileCardLikeRepository.getLikeInfoBySender(id, pageable); | ||
} |
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.
@Transactional(readOnly = true)
를 걸어주지 않은 이유가 있을까요?
QUser sender = new QUser("sender"); | ||
QUser receiver = new QUser("receiver"); |
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.
👍🏻
@Schema | ||
@NotNull | ||
private final Long userId; | ||
|
||
@Schema |
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.
스키마만 있고 설명이 누락된 것 같습니다!
🚀 개발 사항
이슈 번호
특이 사항 🫶