Skip to content
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

Merged
merged 22 commits into from
Feb 21, 2024

Conversation

JIN-076
Copy link
Collaborator

@JIN-076 JIN-076 commented Feb 20, 2024

🚀 개발 사항

  • 사용자가 받은 찔러보기 요청 수 조회 API
  • 사용자가 보낸 찔러보기 요청 수 조회 API
  • 사용자가 보낸 찔러보기 요청 상세 리스트 조회 API
  • 관심 있는 프로필 카드에 대해 찔러보기 요청 생성 API

이슈 번호

특이 사항 🫶

@JIN-076 JIN-076 changed the title Feat/#37 create profile card like [FEAT] 관심 있는 프로필 카드에 찔러보기 요청 생성 API, 찔러보기 요청 수, 상세 정보 조회 API 개발 Feb 20, 2024
Copy link

github-actions bot commented Feb 20, 2024

Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit 9867520.

♻️ This comment has been updated with latest results.

@happyjamy happyjamy added ⭐️ Feat 새로운 기능 🎯 MVP1 mvp1 개발사항 labels Feb 21, 2024
Copy link
Collaborator

@happyjamy happyjamy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤜🏻굳

Comment on lines +36 to +68
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);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Transactional(readOnly = true)를 걸어주지 않은 이유가 있을까요?

Comment on lines +28 to +29
QUser sender = new QUser("sender");
QUser receiver = new QUser("receiver");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

Comment on lines 11 to 15
@Schema
@NotNull
private final Long userId;

@Schema
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

스키마만 있고 설명이 누락된 것 같습니다!

@JIN-076 JIN-076 merged commit ece2405 into develop Feb 21, 2024
3 checks passed
@JIN-076 JIN-076 deleted the feat/#37-create_profile_card_like branch March 4, 2024 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭐️ Feat 새로운 기능 🎯 MVP1 mvp1 개발사항
Projects
None yet
3 participants