-
Notifications
You must be signed in to change notification settings - Fork 2
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
[Feature] 공고 끌어올리기 API 구현 #243
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.
추가 기능을 아주 깔끔하게 구현하셨네요. 고생하셨습니다~!
, description = "M2, 해당 이동봉사 중개를 찾을 수 없습니다. \t\n P2, 해당 공고를 찾을 수 없습니다." | ||
, content = @Content(schema = @Schema(implementation = ErrorResponse.class))) | ||
}) | ||
@PatchMapping(value = "/intermediaries/posts/{postId}/boost") |
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.
boost 작명은 경혁님 아이디어인가요?
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.
gpt 작명소 이용했습니다.
LocalDateTime now = LocalDateTime.now(); | ||
// 공고 끌어올린 시점에서 48시간이 지나지 않았다면 exception | ||
if (now.isBefore(post.getBoostDate().plusHours(48))) { | ||
throw new BadRequestException(INVALID_BOOST_REQUEST); |
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.
끌어올리기 시간 48시간 통일되니 기획도, 코드도 깔끔하네요!
if (now.isBefore(post.getBoostDate().plusHours(48))) { | ||
throw new BadRequestException(INVALID_BOOST_REQUEST); | ||
} | ||
post.updateBoostDate(); |
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.
새 컬럼을 생성해서 끌올 시간을 관리하니, postId 외에 추가로 필요한 값 없이 끌올 기능을 구현할 수 있어 좋네요~!
💡 연관된 이슈
close #242
📝 작업 내용
공고 끌어올리기 API 구현