[김동규] sprint5#222
Hidden character warning
Conversation
for sprint4 mission
for sprint4 mission
for sprint5 mission
| @ApiResponse(responseCode = "404", description = "사용자를 찾을 수 없음", | ||
| content = @Content(examples = @ExampleObject(value = "User with username {username} not found"))), | ||
| }) | ||
| @RequestMapping(value = "/login", method = {RequestMethod.POST}) |
There was a problem hiding this comment.
RequestMapping 대신 GetMapping ,PostMapping 사용도 한번 고려해보시면 좋을것 같아요 :)
| content = @Content(examples = @ExampleObject(value = ("Channel with id {channelId} not found")))), | ||
| }) | ||
| @RequestMapping(path = "/{channelId}", | ||
| method = RequestMethod.PATCH) |
There was a problem hiding this comment.
google java 코딩 컨벤션을 기준으로 한줄에 100글자가 넘지 않을 경우 특별히 개행 하지 않으시는게 가독성 측면에서 더 좋습니다 :) 현재는 너무 잦은 개행으로 한눈에 코드 보기가 쉽지 않은것 같아요!
| } | ||
|
|
||
| @RequestMapping( | ||
| path = "/{userId}/userStatus", |
There was a problem hiding this comment.
Rest API 설계 권장 사항에 따르면 url에는 카멜케이스 사용이 필요할 경우 - (하이픈)으로 단어를 나누도록 권장하고 있어요!
userStatus 대신 user-status 가 좀더 알맞은 규격이에요!
| import java.time.LocalDateTime; | ||
| import java.util.UUID; | ||
|
|
||
| public class BaseEntity implements Serializable { |
There was a problem hiding this comment.
Lombok 으로 대신 처리가 가능할것 같아요!
더불어 최근 추세는 Setter 사용을 자제하는 추세에요! 참고하시면 좋을것 같아요!
Setter 사용을 지양해야 하는 이유는 아래 블로그글을 참고해보세요
| public ResponseEntity<String> handleException(Exception e) { | ||
| return ResponseEntity.status(500).body(e.getMessage()); | ||
| } | ||
|
|
There was a problem hiding this comment.
ExceptionHandler에서 의도치 않은 예외를 처리해야할경우 (ex. exception)
에러 내용을 콘솔창에 로깅될 수 있도록 해주면 좋아요
일반적을 Slf4j를 사용하지만 여의치 않다면 e.printstacktrace()를 System.out.println()으로 로깅되도록 해두시는게 좋아요!
|
코드 컨플릭트 해결이 필요합니다! |
요구사항
기본
심화
멘토에게