Skip to content

Conversation

@yeokyunghyun
Copy link

AOP에 관해 공부해 볼 좋은 기회였습니다

Copy link

@duehee duehee left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~

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

Choose a reason for hiding this comment

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

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에 해당하는 게시판이 존재하지 않습니다." ),
Copy link

Choose a reason for hiding this comment

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

동일한 상태코드와 반환 메세지라면 하나 통일해서 써도 될 것 같아요

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

Choose a reason for hiding this comment

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

Ctrl + Alt + L 이용하면 라인 포맷팅이 된답니다
한 번씩 눌러주세요~

private final String field;
private final String message;

public static ValidationError of(final FieldError fieldError) {
Copy link

Choose a reason for hiding this comment

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

매개변수를 하나 받는 경우에는 of보단 from을 더 사용해요
참고 블로그

url: jdbc:mysql://localhost:3306/bcsd # 본인의 환경에 맞게 수정한다.
username: root # 본인의 환경에 맞게 수정한다.
password: qwer1234 # 본인의 환경에 맞게 수정한다.
password: "6235" # 본인의 환경에 맞게 수정한다.
Copy link

Choose a reason for hiding this comment

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

.gitignore를 사용해보세요!

String description
@NotNull(message = "멤버ID를 입력해주세요.") Long authorId,
@NotNull(message = "게시판ID를 입력해주세요.") Long boardId,
@NotNull(message = "제목을 입력해주세요.") String title,
Copy link

Choose a reason for hiding this comment

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

@NotNull 어노테이션 잘 사용하셨네요!

MemberRepositoryJpa 추가, Member에 @entity 어노테이션 추가
BoardRepositoryJpa추가 + Board도메인에 @entity 추가
ArticleRepositoryJpa 추가, Article도메인에 @entity 추가
SpringDataJpa형식으로 변경 (extends JpaRepository<Board, Long>
SpringDataJpa형식으로 변경 (extends JpaRepository<Member, Long>
SpringDataJpa형식으로 변경 (extends JpaRepository<Article, Long>
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.

2 participants