상위 Story
목표
시험 시작, 답안 제출, 결과 조회 API 서비스 함수 구현
구현 내용
API 엔드포인트
| 함수 |
메서드 |
엔드포인트 |
testService.start |
POST |
/vocab/test/{userId}/start |
testService.submit |
POST |
/vocab/test/{userId}/submit |
testService.getResults |
GET |
/vocab/test/{userId}/results |
구현 예시
export const testService = {
start: (userId, { wordCount = 20, level, type = 'ENGLISH_TO_KOREAN' } = {}) =>
vocabApi.post(`/vocab/test/${userId}/start`, { wordCount, level, type }),
submit: (userId, testId, answers) =>
vocabApi.post(`/vocab/test/${userId}/submit`, { testId, answers }),
getResults: (userId, { limit = 20, cursor } = {}) =>
vocabApi.get(`/vocab/test/${userId}/results`, { params: { limit, cursor } }),
}
완료 조건
상위 Story
목표
시험 시작, 답안 제출, 결과 조회 API 서비스 함수 구현
구현 내용
API 엔드포인트
testService.starttestService.submittestService.getResults구현 예시
완료 조건