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