Open
Conversation
duehee
reviewed
Jun 10, 2024
Comment on lines
8
to
12
| private final Long authorId; | ||
| private Long boardId; | ||
| private String title; | ||
| private String content; | ||
| private LocalDateTime createdAt; | ||
| private final LocalDateTime createdAt; |
There was a problem hiding this comment.
author Id와 createdAt에만 final을 선언한 이유가 있나요?
Comment on lines
+16
to
+17
| POST_BOARD_NOT_EXIST(HttpStatus.BAD_REQUEST, "입력한 ID에 해당하는 게시판이 존재하지 않습니다."), | ||
| UPDATE_BOARD_NOT_EXIST(HttpStatus.BAD_REQUEST,"입력한 ID에 해당하는 게시판이 존재하지 않습니다." ), |
Comment on lines
74
to
83
| try { | ||
| member = memberRepository.findById(saved.getAuthorId()); | ||
| } catch(RuntimeException e) { | ||
| throw new RestApiException(CommonErrorCode.POST_MEMBER_NOT_EXIST); | ||
| } | ||
| try { | ||
| board = boardRepository.findById(saved.getBoardId()); | ||
| } catch(RuntimeException e) { | ||
| throw new RestApiException(CommonErrorCode.POST_BOARD_NOT_EXIST); | ||
| } |
There was a problem hiding this comment.
Ctrl + Alt + L 이용하면 라인 포맷팅이 된답니다
한 번씩 눌러주세요~
| private final String field; | ||
| private final String message; | ||
|
|
||
| public static ValidationError of(final FieldError fieldError) { |
There was a problem hiding this comment.
매개변수를 하나 받는 경우에는 of보단 from을 더 사용해요
참고 블로그
| url: jdbc:mysql://localhost:3306/bcsd # 본인의 환경에 맞게 수정한다. | ||
| username: root # 본인의 환경에 맞게 수정한다. | ||
| password: qwer1234 # 본인의 환경에 맞게 수정한다. | ||
| password: "6235" # 본인의 환경에 맞게 수정한다. |
| String description | ||
| @NotNull(message = "멤버ID를 입력해주세요.") Long authorId, | ||
| @NotNull(message = "게시판ID를 입력해주세요.") Long boardId, | ||
| @NotNull(message = "제목을 입력해주세요.") String title, |
MemberRepositoryJpa 추가, Member에 @entity 어노테이션 추가
BoardRepositoryJpa추가 + Board도메인에 @entity 추가
ArticleRepositoryJpa 추가, Article도메인에 @entity 추가
SpringDataJpa형식으로 변경 (extends JpaRepository<Board, Long>
SpringDataJpa형식으로 변경 (extends JpaRepository<Member, Long>
SpringDataJpa형식으로 변경 (extends JpaRepository<Article, Long>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AOP에 관해 공부해 볼 좋은 기회였습니다