Skip to content

Comments

복습 기능 도메인 계층 구현#32

Merged
hye-on merged 9 commits intomainfrom
feat/domain
Mar 19, 2025
Merged

복습 기능 도메인 계층 구현#32
hye-on merged 9 commits intomainfrom
feat/domain

Conversation

@hye-on
Copy link
Owner

@hye-on hye-on commented Mar 19, 2025

🔗 관련 이슈

resolves #21

📝 작업 내용

디스코드봇의 구현세부사항과 관련없는 비지니스로직 부분을 먼저 작성하였습니다.

  • 오늘 복습할 문제 계산 로직

  • 문제 풀이 후 다음 복습 스케쥴 작성 로직

  • "디스코드 메시지 구성 및 전송 로직"을 제외한 ReviewScheduler 구현

  • 서비스 및 다른 파일에 같이 있던 타입들을 타입파일로 이동시켰습니다.

  • createdAt, reviewDate를 생성시 한번 만들고 그 후 업데이트 안하게 entity를 수정하였습니다.


🍇 고민한 부분

현재 복습 문제를 전송할 때 필요한 데이터(문제, 복습 스케줄 정보, 채널 정보)를 데이터를 한 번에 조회할지, 혹은 별도로 가져와 애플리케이션 레이어에서 조합할지에 대한 고민이 있었습니다.

단일 쿼리로 모든 데이터를 가져오는 방식은 재사용성이 떨어지고, 특정 데이터 구조에 강하게 결합되어 별도로 가져와 조합하는 방식을 선택했습니다. populate 기능을 활용하여 문제 및 복습 스케줄을 한 번에 조회하고, 채널 정보는 별도의 쿼리에서 가져와 애플리케이션 레이어에서 조합하는 방식을 선택했습니다. (populate 기능은 JOIN을 활용하여 한 번의 쿼리로 관련 데이터를 가져오므로, N+1 문제가 일어나지 않습니다.)


@hye-on hye-on added the feature New feature or request label Mar 19, 2025
@hye-on hye-on self-assigned this Mar 19, 2025
@hye-on hye-on merged commit 1f2277e into main Mar 19, 2025
1 check passed
@hye-on hye-on deleted the feat/domain branch March 19, 2025 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

복습 기능 도메인 계층 구현

1 participant