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/feed 01 #10

Merged
merged 12 commits into from
Feb 4, 2025
Merged

Feature/feed 01 #10

merged 12 commits into from
Feb 4, 2025

Conversation

ChoiHyunSan
Copy link
Collaborator

@ChoiHyunSan ChoiHyunSan commented Jan 31, 2025

πŸ“Œ 과제 μ„€λͺ…

Feed μš”μ²­ μ‹œ μ „λ‹¬ν•˜λŠ” 두 λΆ„λ₯˜(νŒ”λ‘œμž‰ κ²Œμ‹œλ¬Ό / μΆ”μ²œ κ²Œμ‹œλ¬Ό) 쀑, νŒ”λ‘œμž‰ κ²Œμ‹œλ¬Όμ— λŒ€ν•œ λ©”μ„œλ“œ κ΅¬ν˜„ 및 ν…ŒμŠ€νŠΈ μ½”λ“œ μΆ”κ°€
기타 μžμž˜ν•œ 였λ₯˜ μˆ˜μ •

πŸ‘©β€πŸ’» μš”κ΅¬ 사항과 κ΅¬ν˜„ λ‚΄μš©

  1. FeedSelector 클래슀 κ΅¬ν˜„ : Feed κ²Œμ‹œλ¬Όμ„ 적절히 κ²€μƒ‰ν•˜μ—¬ μ œκ³΅ν•˜λŠ” 클래슀
  • QueryDsl을 μ΄μš©ν•˜μ—¬ findByFollower λ©”μ„œλ“œ κ΅¬ν˜„
  1. Controller μž‘μ„± 및 Feed 객체 및 Dto μž‘μ„±
  • κ°€μž₯ 졜근 받은 μ‹œκ°„ (timestamp) 와 μ΅œλŒ€ 개수λ₯Ό μ§€μ •ν•˜μ—¬ μš”μ²­
  • 인증 처리λ₯Ό ν†΅ν•œ user 정보λ₯Ό 받지 μ•ŠλŠ” μƒν™©μ΄λ―€λ‘œ ν•˜λ“œ μ½”λ”©μœΌλ‘œ λŒ€μ²΄ => μˆ˜μ • ν•„μš”
  1. Config μΆ”κ°€ 및 기타 μˆ˜μ •
  • QueryDsl μ‚¬μš©ν•˜κΈ° μœ„ν•œ Config μΆ”κ°€
  • CreateDate / ModifyDate κ°€ μ μš©λ˜μ§€ μ•ŠλŠ” 였λ₯˜λ₯Ό μˆ˜μ •ν•˜κΈ° μœ„ν•΄ BaseEntity ν΄λž˜μŠ€μ— μ—λ…Έν…Œμ΄μ…˜ μΆ”κ°€
  • RsData 클래슀의 값을 꺼내지 λͺ»ν•˜λŠ” 였λ₯˜λ₯Ό μˆ˜μ •ν•˜κΈ° μœ„ν•΄ Getter μ—λ…Έν…Œμ΄μ…˜ μΆ”κ°€
  1. ν…ŒμŠ€νŠΈ μ½”λ“œ μž‘μ„±
  • ν…ŒμŠ€νŠΈμ— ν•„μš”ν•œ 정보λ₯Ό μ„ΈνŒ…ν•˜λŠ” 클래슀λ₯Ό 뢄리 (FeedTestHelper)
  • findByFollower λ©”μ„œλ“œμ— λŒ€ν•œ ν…ŒμŠ€νŠΈ μ½”λ“œ μž‘μ„±

βœ… PR 포인트 & κΆκΈˆν•œ 점

  • Dto에 μΆ”κ°€λ‘œ μ œκ³΅ν•΄μ•Ό ν•  정보가 μžˆμ„μ§€
  • μž‘μ„±ν•œ 쿼리가 잠재적으둜 λ°œμƒν•  μ΄μŠˆκ°€ μžˆμ–΄ λ³΄μ΄λŠ”μ§€ or 더 효율적인 방법이 μžˆμ„μ§€
  • Service ν΄λž˜μŠ€μ™€ Exception은 병합 μ‹œ 였λ₯˜κ°€ λ°œμƒν•  수 μžˆμœΌλ―€λ‘œ μž„μ‹œλ‘œ μΆ”κ°€ν•΄λ’€μŠ΅λ‹ˆλ‹€. (μš°μ„ μ€ μ‹ κ²½ μ•ˆμ“°μ…”λ„ λ©λ‹ˆλ‹€!)

Copy link
Collaborator

@Metronon Metronon left a comment

Choose a reason for hiding this comment

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

μˆ˜λ§Žμ€ μ–‘μ˜ QueryDSL을 보고 μ–Όλ§ˆλ‚˜ 깊게 κ³ λ―Όν•˜μ‹ μ§€ ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€..
ν”Όλ“œ κ΄€λ ¨ λ‘œμ§μ€ 처음 λ³΄λŠ”λ° μ „μ²΄μ μœΌλ‘œ κΉ”λ”ν•˜κ²Œ μž‘μ„±ν•˜μ‹  것 κ°™μŠ΅λ‹ˆλ‹€!

.imgUrlList(feed.getImageUrlList())
.postId(feed.getPost().getId())
.content(feed.getPost().getContent())
.likesCount(feed.getLikeCount())
Copy link
Collaborator

Choose a reason for hiding this comment

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

좔후에 κ²Œμ‹œλ¬Ό λ°˜μ •κ·œν™”λ₯Ό 톡해 like_count μΉΌλŸΌμ„ μΆ”κ°€ν•œλ‹€λ©΄,
feed.getPost().getLikeCount() 둜 λ°”κΎΈλ©΄ 될 것 κ°™μŠ΅λ‹ˆλ‹€ !

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

λ„΅ 일단 like_count λ°˜μ •κ·œν™”κ°€ 적용되면 쿼리 μͺ½λ„ 같이 μˆ˜μ •ν•΄μ•Όν•  것 κ°™μŠ΅λ‹ˆλ‹€!


// 0. νŒ”λ‘œμž‰ κ²Œμ‹œλ¬Ό / μΆ”μ²œ κ²Œμ‹œλ¬Ό 개수λ₯Ό
int followingCount = request.getMaxSize() * 100 / 70;
int recommendCount = request.getMaxSize() * 100 / 30;
Copy link
Collaborator

Choose a reason for hiding this comment

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

"νŒ”λ‘œμž‰ν•œ κ²Œμ‹œλ¬Όμ΄ μ—†λ‹€λ©΄ 3ν• μ˜ μΆ”μ²œ κ²Œμ‹œλ¬Όλ§Œ κ°€μ Έμ˜¨λ‹€" κ°€ μ œκ°€ μ΄ν•΄ν•œκ²Œ λ§žμ„κΉŒμš”?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

μ•„μ•„ 이 뢀뢄은 μ’€ 더 μ˜ˆμ™Έμ²˜λ¦¬κ°€ λ˜μ•Όν•˜λŠ” 뢀뢄이 μžˆμ–΄μ„œ 잘 λͺ» λ˜μ–΄μžˆλŠ”κ²Œ λ§žμŠ΅λ‹ˆλ‹€ :)

λŒ€λž΅μ μœΌλ‘œ μš°μ„ μ€ 3ν• μ˜ μΆ”μ²œ κ²Œμ‹œλ¬ΌμœΌλ‘œ μ‘°ν•©ν•œλ‹€~ κ°€ 기초적인 μ•„μ΄λ””μ–΄λΌμ„œ λŒ€λž΅ μ €λ ‡κ²Œ μž‘μ„±λ˜μ–΄μžˆκ³ ,
Feed-02 둜 μž‘μ—… 쀑인 λΈŒλžœμΉ˜μ—μ„œ 이에 λŒ€ν•œ μˆ˜μ • μž‘μ—…μ„ μ§„ν–‰μ€‘μ΄λΌμ„œ 이 뢀뢄은 λŒ€λž΅μ μΈ λΉ„μœ¨λ‘œ μ‘°ν•©λœλ‹€λŠ” κ²ƒλ§Œ μ΄ν•΄ν•΄μ£Όμ‹œλ©΄ 될 것 κ°™μ•„μš”!

Copy link
Collaborator

Choose a reason for hiding this comment

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

μ•„ν•˜- ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€! κ°μ‚¬ν•©λ‹ˆλ‹€ :)

@k-haechan
Copy link
Collaborator

μ—λŸ¬ fix ν•΄μ£Όμ…”μ„œ pr μ˜¬λ €μ£Όμ…¨λ„€μš”! querydslμ½”λ“œκΉŒμ§€ 많이 λ°°μ›λ‹ˆλ‹€.. κ³ μƒν•˜μ…¨μŠ΅λ‹ˆλ‹€!

Copy link
Collaborator

@sobaman sobaman left a comment

Choose a reason for hiding this comment

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

주석이 μ„Έμ„Έν•˜κ²Œ λ‹¬λ €μžˆμ–΄μ„œ μ΄ν•΄ν•˜κΈ° νŽΈν–ˆλ˜κ²ƒ κ°™μŠ΅λ‹ˆλ‹€!

*/
@Getter
@Builder
@AllArgsConstructor(access = AccessLevel.PROTECTED)
Copy link
Collaborator

Choose a reason for hiding this comment

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

jpa 둜 κ΄€λ¦¬λ˜μ§€ μ•ŠμœΌλ©΄ protected λ₯Ό 걸어주지 μ•Šμ•„λ„ λœλ‹€κ³  μ•Œκ³  μžˆλŠ”λ°
ν˜Ήμ‹œ 또 λ‹€λ₯Έ μ΄μœ κ°€ μžˆλŠ”μ§€ κΆκΈˆν•©λ‹ˆλ‹€

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

μ™œ λΆ™μ˜€λŠ”μ§€ 고민을 ν•΄λ΄€λŠ”λ°, 제 μƒκ°μ—λŠ” 볡뢙을 ν•˜λ©΄μ„œ 같이 듀어간거지 μ‹ΆμŠ΅λ‹ˆλ‹€. 이 뢀뢄은 μˆ˜μ •ν•΄μ„œ λ‹€μŒ PR에 λ°˜μ˜ν•˜κ² μŠ΅λ‹ˆλ‹€ :)

@ChoiHyunSan ChoiHyunSan merged commit cc2e880 into main Feb 4, 2025
@ChoiHyunSan ChoiHyunSan deleted the feature/feed-01 branch February 4, 2025 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants