-
Notifications
You must be signed in to change notification settings - Fork 3
Feat/#26 문제 검증 핸들러 패턴 구현 #29
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
- ValidationHandler 인터페이스 정의 (support, validate 메서드) - 문제 타입별 검증 로직 확장을 위한 기반 구조
- ValidationService: 검증 로직을 핸들러에 위임 - HandlerResolver: 문제 타입(ex. unit)에 맞는 핸들러 선택 - UnitValidationHandler: 유닛 문제 검증 구현 - MVP용 하드코딩 검증 로직이 포함되어 있음
- 검증 로직을 ValidationService로 위임 - ProblemsService에서 직접 검증하던 로직 제거 - ValidationService를 주입받아 검증 위임 - (test 진행을 위해) 문제 데이터를 problemData 목 객체로 처리함 - 핸들러 패턴 적용을 위한 리팩토링 작업
|
오... 좋습니다... 유닛 문제 검증만 작성하셨져 일단은?? |
네네 맞습니당 |
저도 오늘 검증 로직 초기 구현해놓으려고 했는데 배포 관련 개념 공부하고 스크립트, 설정 등을 하다보니 시간이 생각보다 조금 많이 걸려서 못했네요 ㅋㅋ 내일을 꼭 해야겠습니다..! |
zooyaam
left a comment
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.
수고하셨습니다 !!
apps/server/src/problems/validation/handlers/validation.handler.ts
Outdated
Show resolved
Hide resolved
caffesale
left a comment
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.
문제 타입별로 handler Mapping하는게 좋아보이네요. 모듈 흐름 그려주신 것도 좋아보입니다. 감사합니다.
작업 내용
문제 검증 로직을 핸들러 패턴으로 리팩토링하여 타입별 검증 로직 확장이 가능하도록 했습니다.
☑️ 변경 사항
validation/디렉토리 및handlers/서브 디렉토리 추가support,validate메서드)🔎 테스트 및 검증 내용 (선택)
#28 과 같은 방식으로 진행했습니다.
🎃 기타 참고 사항
나중에 시나리오 문제 타입 추가 시 ScenarioValidationHandler를 추가하면 되는 구조입니다.
problemData(문제 데이터)가 현재 하드코딩이지만, 추후 DB 생성 시 실제 문제 조회로 교체하면 됩니다.
트랜잭션 스크립트 + 핸들러 패턴으로 구현했습니다 (설계 문서의 3-2 방식)
디렉토리 구조