-
Notifications
You must be signed in to change notification settings - Fork 2
[feat/#317] 마이노트 - 상세 - 체크리스트 조회 API #332
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
Conversation
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.
고생하셨습니다.!!
| .answerType(entity.getQuestionId().getAnswerType()) | ||
| .build()) | ||
| .collect(Collectors.toList()); | ||
| } |
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.
해당 부분에서 ChecklistAnswerResponseDTO 에서 정적 메서드를 만들어서 dto 로 변환을 로직을 넣으면 코드가 한눈에 보기가 좋아지고, 관심사도 정확히 분리될 거 같아서 더 좋지 않을 까 하는 의견이 있습니다.!
List<ChecklistAnswer> answerList = checklistAnswerRepository.findChecklistAnswerByLimjangId(limjang);
return ChecklistAnswerResponseDTO.fromEntityList(answerList);
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.
저두 동의합니다 그리구 자바 16부터 .collect(Collectors.toList()); -> toList() 로 대체 가능한데 저희가 쓰는거 17이라 고려해보시면 조을 것 같아요!!
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.
이 객체에서는 repository 같이 엔티티만 리턴하고 서비스나 DTO에서 가공하는건 어떨까요?? Limjang도 서비스에서 NoteFinder(LimjangFinder)에서 찾으면 더 좋을 것 같아요
| private final LimjangRepository limjangRepository; | ||
|
|
||
| public List<ChecklistAnswerResponseDTO.AnswerDto> findByLimjangId(Long limjangId) { | ||
| Limjang limjang = limjangRepository.findById(limjangId) |
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.
임장찾을 때 deleted 필드가 false인 것으로 찾아주셔야할 것 같습니다!! 현재 softdelete 되는 형태라 삭제된 임장들도 다 찾아질 것 같습니다
| .answerType(entity.getQuestionId().getAnswerType()) | ||
| .build()) | ||
| .collect(Collectors.toList()); | ||
| } |
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.
이 객체에서는 repository 같이 엔티티만 리턴하고 서비스나 DTO에서 가공하는건 어떨까요?? Limjang도 서비스에서 NoteFinder(LimjangFinder)에서 찾으면 더 좋을 것 같아요
[feat/#317] 마이노트 - 상세 - 체크리스트 조회 API
작업내용
상세설명_ & 캡쳐
스웨거 통해서 테스팅한 결과입니다~!
Finder 사용하는 로직으로 변경했습니다!