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

[Feature] 공고 끌어올리기 API 구현 #243

Merged
merged 4 commits into from
Dec 22, 2024

Conversation

kyeong-hyeok
Copy link
Member

💡 연관된 이슈
close #242

📝 작업 내용
공고 끌어올리기 API 구현

  • Post 끌어올리기 Column 추가 및 적용
  • 공고 끌어올리기 API 구현
  • Controller 테스트 코드 추가

@kyeong-hyeok kyeong-hyeok added ✨ Feature 기능 개발 Priority: Medium 우선순위 중간 🐯 Koeyhk 담당자 labels Dec 14, 2024
@kyeong-hyeok kyeong-hyeok linked an issue Dec 14, 2024 that may be closed by this pull request
3 tasks
Copy link
Member

@hojeong2747 hojeong2747 left a 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")
Copy link
Member

Choose a reason for hiding this comment

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

boost 작명은 경혁님 아이디어인가요?

Copy link
Member Author

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);
Copy link
Member

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();
Copy link
Member

Choose a reason for hiding this comment

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

새 컬럼을 생성해서 끌올 시간을 관리하니, postId 외에 추가로 필요한 값 없이 끌올 기능을 구현할 수 있어 좋네요~!

@kyeong-hyeok kyeong-hyeok merged commit 6595429 into develop Dec 22, 2024
1 check passed
@kyeong-hyeok kyeong-hyeok deleted the feat/242-boost-post-api branch December 22, 2024 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature 기능 개발 🐯 Koeyhk 담당자 Priority: Medium 우선순위 중간
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] 공고 끌어올리기 API 구현
2 participants