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

feat : Implement board delete API #147

Merged
merged 1 commit into from
Nov 5, 2024
Merged

feat : Implement board delete API #147

merged 1 commit into from
Nov 5, 2024

Conversation

hwangjokim
Copy link
Contributor

@hwangjokim hwangjokim commented Nov 5, 2024

๐Ÿ“Œ Related Issue

close #145

๐Ÿš€ Description

  • ๊ณต์ง€ ์‚ญ์ œ api ์ถ”๊ฐ€

๐Ÿ“ข Review Point

  • ์ฐธ์กฐ ๋ฌด๊ฒฐ์„ฑ ์ œ์•ฝ(์–ด๋–ค ํ–‰์„ ์‚ญ์ œํ•  ๋•Œ, ์ด๊ฒƒ์„ ์ฐธ์กฐํ•˜๊ณ  ์žˆ๋Š” ๋ฐ์ดํ„ฐ๊ฐ€ ์žˆ์œผ๋ฉด db๊ฐ€ ์‚ญ์ œ ๋ง‰์Œ)์„ ๊ณ ๋ คํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค.
  • ๊ทธ๋ƒฅ Cascade.delete ๊ฑธ๋ฉด ํŽธํ•œ๋ฐ, ์ €๊ฑฐ ์“ฐ๋ฉด delete ์ฟผ๋ฆฌ๊ฐ€ ๋Œ“๊ธ€ ์ˆ˜๋งŒํผ ๋‚˜๊ฐ€์š”.
  • delete from BoardComment where id = ? ํ˜•ํƒœ๊ฐ€ ๋Œ“๊ธ€ ์ˆ˜๋งŒํผ ๋ฐ˜๋ณตํ•ด์„œ ๋‚˜๊ฐ.. ์ด๊ฑฐ์‹ซ์–ด์„œ ๊ทธ๋ƒฅ Batch delete query ์งฐ์–ด์š”.

๐Ÿ“šEtc (์„ ํƒ)

ํ†ตํ•ฉํ…Œ์ŠคํŠธ ์•ˆํ–ˆ๋Š”๋ฐ ๋™์ž‘ํ•œ๋‹ค๊ณ  ๋‚ด ๋งˆ์Œ์ด ๋ณด์žฅํ•จ
๋ฆฌ๋ทฐ๋ฐ›๊ณ  ๋จธ์ง€์ „ ํ…Œ์ŠคํŠธํ• ๊ฒŒ์š”

@@ -3,10 +3,10 @@
import lombok.Getter;

@Getter
public class BoardValidationExceoption extends RuntimeException {
public class BoardValidationException extends RuntimeException {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

์ด๊ฑด ์˜คํƒ€์žˆ๊ธธ๋ž˜ ๊ฑฐ์Šฌ๋ ค์„œ ๊ณ ์ณค์–ด์š”.

@hwangjokim
Copy link
Contributor Author

์–˜๊ฐ€ ๋„๋ฉ”์ธ ์ด๋ฆ„๋ณ€๊ฒฝ ๋ธ”๋กœํ‚นํ•ด์„œ, ์šฐ์„ ์ˆœ์œ„ ๋†’์—ฌ์ฃผ์‹œ๋ฉด ใ„ฑใ……

@hwangjokim hwangjokim self-assigned this Nov 5, 2024
@hwangjokim hwangjokim added the new-feature ๊ธฐ๋Šฅ ์ถ”๊ฐ€ label Nov 5, 2024
Copy link
Contributor

@rladmstn rladmstn left a comment

Choose a reason for hiding this comment

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

LGTM-


import com.gamzabat.algohub.feature.board.domain.Board;
import com.gamzabat.algohub.feature.board.domain.BoardComment;

public interface BoardCommentRepository extends JpaRepository<BoardComment, Long> {

List<BoardComment> findAllByBoard(Board board);

@Modifying
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

@hwangjokim hwangjokim Nov 5, 2024

Choose a reason for hiding this comment

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

1์ฐจ์บ์‹œ ๋‚ ๋ ค์ฃผ๋Š” ์–ด๋…ธํ…Œ์ด์…˜์ด์—์š”. ์ €๊ฑฐ ์•ˆํ•˜๋ฉด 1์ฐจ์บ์‹œ ๋‚จ์•„์„œ, findByIdํ•˜๋ฉด ์œ ๋ น ํŠ€์–ด๋‚˜์˜ด
์ •ํ™•ํžˆ๋Š” ์ € ์ฟผ๋ฆฌ ์‹คํ–‰ ์งํ›„ ๋‚ ๋ ค์ค๋‹ˆ๋‹ค./

Copy link
Contributor

@sh0723 sh0723 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

@s-hwan s-hwan left a comment

Choose a reason for hiding this comment

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

์‚ญ์ œํ•˜๋Š” api์— ์ง€์‹์ด ๋งŽ์ด ํ•„์š”ํ•˜๋„ค..
ํ•˜๋‚˜ ์ฃผ์›Œ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค

@hwangjokim hwangjokim merged commit 506e516 into develop Nov 5, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature ๊ธฐ๋Šฅ ์ถ”๊ฐ€
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: ๊ณต์ง€ ์‚ญ์ œ api
4 participants