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

[OING-322] refactor: 포스트 중복 작성 검증 로그에 today 날짜 추가 #243

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions post/src/main/java/com/oing/service/PostService.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ private void validateUserHasNotCreatedPostToday(String memberId, String familyId

private void validateUserHasNotCreatedSurvivalPostToday(String memberId, String familyId, LocalDate today) {
if (postRepository.existsByMemberIdAndFamilyIdAndTypeAndCreatedAt(memberId, familyId, PostType.SURVIVAL, today)) {
log.warn("Member {} has already created a survival post today", memberId);
log.warn("Member {} has already created a survival post today {}", memberId, today);
throw new DuplicateSurvivalPostUploadException();
}
}

private void validateUserHasNotCreatedMissionPostToday(String memberId, String familyId, LocalDate today) {
if (postRepository.existsByMemberIdAndFamilyIdAndTypeAndCreatedAt(memberId, familyId, PostType.MISSION, today)) {
log.warn("Member {} has already created a mission post today", memberId);
log.warn("Member {} has already created a mission post today {}", memberId, today);
throw new DuplicateMissionPostUploadException();
}
}
Expand Down
Loading