-
Notifications
You must be signed in to change notification settings - Fork 13
[Spring Core] 김태우 과제 제출합니다. #7
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
base: main
Are you sure you want to change the base?
Conversation
daheeParkk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다! 👍🏻
| Member_IsNull(400, "유저가 존재하지 않습니다."), | ||
| Board_NotNullName(400, "'name' 값이 Null이 될 수 없습니다."), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
카멜케이스와 스네이크케이스를 섞어 사용하는 것 보다 ExceptionType을 domain별로 나누는 건 어떨까요?
| public ArticleResponse create(ArticleCreateRequest request) throws HTTPApiException { | ||
| if(request.authorId()==null) throw new HTTPApiException(ExceptionType.Article_NotNullAuthorId); | ||
| if(request.boardId()==null) throw new HTTPApiException(ExceptionType.Article_NotNullBoardId); | ||
| if(request.title()==null) throw new HTTPApiException(ExceptionType.Article_NotNullTitle); | ||
| if(request.description()==null) throw new HTTPApiException(ExceptionType.Article_NotNullDescription); | ||
| if(!articleservice.isExistBoard(request.boardId())) throw new HTTPApiException(ExceptionType.Board_IsNull); | ||
| if(!articleservice.isExistUser(request.authorId())) throw new HTTPApiException(ExceptionType.Member_IsNull); | ||
| return articleservice.create(request); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Valid를 사용하면 코드가 더 깔끔해질 것 같습니다!
daheeParkk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다!
| datasource: | ||
| url: jdbc:mysql://localhost:3306/bcsd # 본인의 환경에 맞게 수정한다. | ||
| username: root # 본인의 환경에 맞게 수정한다. | ||
| password: qwer1234 # 본인의 환경에 맞게 수정한다. | ||
| password: 1234 # 본인의 환경에 맞게 수정한다. | ||
| driver-class-name: com.mysql.cj.jdbc.Driver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yml같이 중요한 정보는 안 보이게 해야 합니다!
| } | ||
|
|
||
| @Transactional | ||
| public void delete(Long id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
예외처리도 필요할 것 같아요
| } | ||
|
|
||
| public boolean isExistEmail(Long notthis, String email) { | ||
| System.out.println("a"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a는 왜 출력하고 있나요
No description provided.