Skip to content

[Task] 시험 API 서비스 구현 #68

Description

@DDINGJOO

상위 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 } }),
}

완료 조건

  • testService 객체 구현
  • 3개 API 함수 구현

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions