Skip to content

Commit

Permalink
refactor: add today date log to validateUserHasNotCreatedPost logic (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Ji-soo708 authored Apr 25, 2024
1 parent 9b9698c commit 5c04adf
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 5c04adf

Please sign in to comment.