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

[BE] 아티클에 대표이미지를 추가한다. #612

Merged
merged 5 commits into from
Sep 23, 2024

Conversation

tsulocalize
Copy link
Contributor

❗ Issue

✨ 구현한 기능

아티클 내 thumbnail 추가
DB 구조 변경

📢 논의하고 싶은 내용

API 엔드포인트 바꿨는데 괜찮은지 한번 봐주세요~

🎸 기타

Copy link
Contributor

@tkdgur0906 tkdgur0906 left a comment

Choose a reason for hiding this comment

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

고생하셨습니닷

Copy link
Contributor

@shin-jisong shin-jisong left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~ 👍

@GetMapping("/articles/latest")
public ResponseEntity<ArticlesPreviewResponse> readLatestArticles() {
return ResponseEntity.ok(articleService.readLatestArticles());
@GetMapping("/articles/detail")
Copy link
Contributor

Choose a reason for hiding this comment

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

전의 명명이 더 나은 것 같은데 바꾼 이유가 궁금해요!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. 모든 아티클 조회 API가 최신순으로 불러오기 때문에 latest가 불필요하다고 생각했습니다!
  2. 일반 목록과 디테일 목록의 엔드포인트를 명확히 분리해주고 싶었습니다!

public ResponseEntity<ArticlesPreviewResponse> readLatestArticles() {
return ResponseEntity.ok(articleService.readLatestArticles());
@GetMapping("/articles/detail")
public ResponseEntity<ArticlesDetailPreviewResponse> readArticlesDetail() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Detail과 Preview는 반대되는 개념이라고 생각하는데요,, 일반 목록과 디테일 목록이 어떻게 다른거죠?-?

Copy link
Contributor

Choose a reason for hiding this comment

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

저도 detail 명명이 하나를 세부적으로 본다는 것으로 느껴져서 preview와는 대치되는 개념이라 느껴져요!
Partial 등 일부분을 뜻하는 용어를 사용하거나 List 명명을 선택하는 것이 좋을 듯합니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

DTO 명 수정해주었습니다!

public ArticlesDetailPreviewResponse readArticles() {
List<ArticleDetailPreviewResponse> articles = articleRepository.findAll().stream()
public ArticlesDetailPreviewResponse readArticleDetailPreviews() {
List<ArticleDetailPreviewResponse> articles = articleRepository.findLatest().stream()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
List<ArticleDetailPreviewResponse> articles = articleRepository.findLatest().stream()
List<ArticleDetailPreviewResponse> articles = articleRepository.findLatestArticles().stream()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

반영했습니다!

@JINU-CHANG JINU-CHANG merged commit bde6eed into dev-be Sep 23, 2024
2 checks passed
@JINU-CHANG JINU-CHANG deleted the feat/601-article-thumbnail branch September 23, 2024 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants