Conversation
| private Long id; | ||
| private LocalDateTime createDate; | ||
| private LocalDateTime modifyDate; | ||
| private Boolean isDeleted; |
There was a problem hiding this comment.
넵! 네 개 중 어떤 필드를 말씀하신 걸까요 ??
우선 생성일자랑 수정일자, 삭제 여부를 위한 필드값입니다 !
| return of(resultCode, msg, null); | ||
| } | ||
|
|
||
| public static <T> RsData<T> successOf(T data) { |
There was a problem hiding this comment.
여러 case를 위해 of를 별도로 두신걸로 보이는데, code는 에러 코드만 전달하는 요구사항이었던것 같은데 어떻게 생각하시나요
There was a problem hiding this comment.
앗 맞네요..! 이 부분은 제가 요구사항을 제대로 구현하지 못한 것 같습니다
에러 코드만 전달하도록 수정하겠습니다 !
|
|
||
| @RestControllerAdvice | ||
| public class GlobalExceptionHandler { | ||
| private static final String INVALID_KEY_VALUE = "키 값이 유효하지 않습니다."; |
There was a problem hiding this comment.
Property클래스들을 별도의 Enum으로 관리하는 편이 좋지않았을까요?
|
|
||
| @GetMapping("/{id}") | ||
| public RsData<ViewSingleResponse> getSingleTodo(@PathVariable("id") Long id) { | ||
| try { |
There was a problem hiding this comment.
try-catch를 controller에서 처리한 이유가 따로있나요?
| import java.util.stream.Collectors; | ||
|
|
||
| @Component | ||
| public class InMemoryDB<K, V> { |
There was a problem hiding this comment.
K,V로 처리한건 아주 좋은 방법인것같네요 배워갑니다
| this.deleted = todo.isDeleted(); | ||
| } | ||
|
|
||
| public Long getId() { |
There was a problem hiding this comment.
Getter어노테이션 사용후 별도로 getter를 구현하신이유가 있나요?
|
|
||
| import study.todolist.domain.todo.util.Priority; | ||
|
|
||
| public class ViewAllResponse { |
|
|
||
| @Service | ||
| @RequiredArgsConstructor | ||
| public class TodoServiceImpl implements TodoService { |
| @Override | ||
| public List<ViewSingleResponse> getAllTodos() { | ||
| return inMemoryDB.findAll().stream() | ||
| .filter(todo -> !todo.isDeleted()) |
There was a problem hiding this comment.
지원진 ToDo값은 null이 포함되기에 작성한 로직인가요?
| @@ -0,0 +1,5 @@ | |||
| package study.todolist.domain.todo.util; | |||
|
|
|||
| public enum Priority { | |||
| public boolean isFail() { | ||
| return !isSuccess(); | ||
| } | ||
| } |
There was a problem hiding this comment.
이런 형식으로 작성하는군요!
감사합니다! 배워갈게요😊
| public int hashCode() { | ||
| return Objects.hash(task); | ||
| } | ||
| } |
There was a problem hiding this comment.
유효성처리에 대한 고민이 있었는데, 해소가 되네요!
저라면 단순 자료형으로 필드를 구성하고 Service단에서 처리했을 것 같은데,
이렇게 사용할 수도 있겠구나 라는 생각을 하게 됩니다!
시야가 넓어지는 느낌이네요 😄
구현 내용
변경 사항
비고