Conversation
- 변경 내용: entity -> dto 디렉토리로 위치 이동 - 이유: entity는 DB의 테이블과 매칭되는 JPA 객체를 다루는 디렉토리이기 때문에, 단순히 코드 안에서 사용되는 local 디렉토리는 dto 디렉토리가 더 적합할거라고 생각
- 변경 이유: entity와 Dto를 구별하기 위해서 - entity는 기본 클래스명이고 Dto로 끝나는 클래스들은 전부 dto로 분류
- 문제1: keyword text를 기준으로 처리하다 보니 중복 충돌 상황 발생 - 문제2: question을 text기반으로 DB 데이터와 일일이 비교하다 보니 불필요한 연산이 과도하게 발생 - 해결1-1: keywordId를 specialQuestionDto의 필드로 추가해서 모든 비교 관리를 id를 기준으로 진행 - 해결1-2: keywordId를 null로 받는 경우 새로 생성한 keyword임을 구별 - 해결2-1: request와 DB 데이터값의 질문 리스트들을 순서대로 한번만 비교한 후 생성, 수정을 한번에 진행 - 해결2-2: Map 자료구조와 groupingBy를 이용해서 keywordId를 기반의 QuestionList 조회를 시간복잡도 O(1)로 변경 - 추가 변경사항 - 질문 조회 메서드를 재사용해서 질문 수정 메서드의 중복코드 제거 - 일일이 DB에 접근하는 것이 아니라 deleteAll, saveAll 등을 사용해 일괄적으로 DB에 접근
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
API Docs
✴️ request
✅ response
Comment