-
Notifications
You must be signed in to change notification settings - Fork 1
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
#60 [feat] Scheduling 추천 글감 #63
Conversation
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.
스케줄링 해낸 당신은 천재만재 ✨ 고생하셨어요!
@@ -22,6 +22,7 @@ public enum ErrorMessage { | |||
COMMENT_NOT_FOUND(HttpStatus.NOT_FOUND.value(), "해당 댓글이 존재하지 않습니다."), | |||
CURIOUS_NOT_FOUND(HttpStatus.NOT_FOUND.value(), "해당 궁금해요는 존재하지 않습니다."), | |||
TOPIC_NOT_FOUND(HttpStatus.NOT_FOUND.value(), "해당 주제가 존재하지 않습니다."), | |||
RECCOMEND_NOT_FOUND(HttpStatus.NOT_FOUND.value(), "추천 글감을 받아오는데 실패했습니다."), |
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.
P3 요기 스펠링 오타가 있는 것 같아요!
public RecommendResponse getRandomRecommendation() { | ||
return RecommendResponse.of(getRandomContentDaily()); | ||
} | ||
@Scheduled(cron = "0 0 0 * * *") |
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.
0시 0분 0초마다 메소드가 실행되는 cron 표현식이군요..! 배워갑니닷
() -> new NotFoundException(ErrorMessage.RECCOMEND_NOT_FOUND) | ||
); | ||
}).getContent(); | ||
} |
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.
아예 랜덤한 추천을 찾는 게 아니라 매일 GROUND-ID + INDEX에 해당하는 추천을 가져오는군요! orElseGet으로 resetGroundId를 호출하는 게 좋은 아이디어 같아요!
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.
그런데 INDEX 필드가 매일 1씩 증가해야 하지 않나요!?
✒️ 관련 이슈번호
Key Changes 🔑
To Reviewers 📢