diff --git a/server/build.gradle b/server/build.gradle index 3f2a879..e231346 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -91,7 +91,7 @@ asciidoctor { bootJar { dependsOn asciidoctor - from("${asciidoctor.outputDir}/html5") { + from("${asciidoctor.outputDir}") { into 'static/docs' } } diff --git a/server/src/main/resources/static/docs/auth.html b/server/src/main/resources/static/docs/auth.html new file mode 100644 index 0000000..5419188 --- /dev/null +++ b/server/src/main/resources/static/docs/auth.html @@ -0,0 +1,632 @@ + + + + + + + +Auth API + + + + + +
+
+

Auth API

+
+
+

나의 정보 조회

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/auth/me' -i -X GET \
+    -H 'Content-Type: application/json' \
+    --cookie 'access_token={ACCESS_TOKEN}'
+
+
+
+
+

HTTP request

+
+
+
GET /api/v1/auth/me HTTP/1.1
+Content-Type: application/json
+Host: api.fluffy.run
+Cookie: access_token={ACCESS_TOKEN}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+Content-Type: application/json
+Content-Length: 104
+
+{
+  "id" : 1,
+  "email" : "mock@gmail.com",
+  "name" : "mock-name",
+  "avatarUrl" : "https://mock.com"
+}
+
+
+
+
+

HTTPie request

+
+
+
$ http GET 'https://api.fluffy.run/api/v1/auth/me' \
+    'Content-Type:application/json' \
+    'Cookie:access_token={ACCESS_TOKEN}'
+
+
+
+
+

Request body

+
+
+
+
+
+
+
+

Response body

+
+
+
{
+  "id" : 1,
+  "email" : "mock@gmail.com",
+  "name" : "mock-name",
+  "avatarUrl" : "https://mock.com"
+}
+
+
+
+
+

Response fields

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

id

Number

사용자 식별자

email

String

사용자 이메일

name

String

사용자 이름

avatarUrl

String

사용자 프로필 이미지 URL

+
+
+
+

로그아웃

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/auth/logout' -i -X POST \
+    -H 'Content-Type: application/json' \
+    --cookie 'access_token={ACCESS_TOKEN}'
+
+
+
+
+

HTTP request

+
+
+
POST /api/v1/auth/logout HTTP/1.1
+Content-Type: application/json
+Host: api.fluffy.run
+Cookie: access_token={ACCESS_TOKEN}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+Set-Cookie: access_token=; Path=/; Domain=.fluffy.run; Max-Age=0; Expires=Thu, 1 Jan 1970 00:00:00 GMT; Secure; HttpOnly
+
+
+
+
+

HTTPie request

+
+
+
$ http POST 'https://api.fluffy.run/api/v1/auth/logout' \
+    'Content-Type:application/json' \
+    'Cookie:access_token={ACCESS_TOKEN}'
+
+
+
+
+

Request body

+
+
+
+
+
+
+
+

Response body

+
+
+
+
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/server/src/main/resources/static/docs/exam.html b/server/src/main/resources/static/docs/exam.html new file mode 100644 index 0000000..1088a5b --- /dev/null +++ b/server/src/main/resources/static/docs/exam.html @@ -0,0 +1,2241 @@ + + + + + + + +Exam API + + + + + +
+
+

Exam API

+
+
+

출제된 시험 요약 목록 조회

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams?page=0&size=2' -i -X GET \
+    -H 'Accept: application/json' \
+    --cookie 'accessToken={ACCESS_TOKEN}'
+
+
+
+
+

HTTP request

+
+
+
GET /api/v1/exams?page=0&size=2 HTTP/1.1
+Accept: application/json
+Host: api.fluffy.run
+Cookie: accessToken={ACCESS_TOKEN}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+Content-Type: application/json
+Content-Length: 815
+
+{
+  "pageInfo" : {
+    "currentPage" : 0,
+    "totalPages" : 2,
+    "totalElements" : 4,
+    "hasNext" : true,
+    "hasPrevious" : false
+  },
+  "content" : [ {
+    "id" : 1,
+    "title" : "시험1",
+    "description" : "설명1",
+    "status" : "PUBLISHED",
+    "author" : {
+      "id" : 1,
+      "name" : "작성자1",
+      "avatarUrl" : "a@gmail.com"
+    },
+    "questionCount" : 3,
+    "createdAt" : "2024-12-27T18:30:34.80767",
+    "updatedAt" : "2024-12-27T18:30:34.807675"
+  }, {
+    "id" : 2,
+    "title" : "시험2",
+    "description" : "설명2",
+    "status" : "PUBLISHED",
+    "author" : {
+      "id" : 1,
+      "name" : "작성자1",
+      "avatarUrl" : "a@gmail.com"
+    },
+    "questionCount" : 2,
+    "createdAt" : "2024-12-27T18:30:34.807677",
+    "updatedAt" : "2024-12-27T18:30:34.807678"
+  } ]
+}
+
+
+
+
+

HTTPie request

+
+
+
$ http GET 'https://api.fluffy.run/api/v1/exams?page=0&size=2' \
+    'Accept:application/json' \
+    'Cookie:accessToken={ACCESS_TOKEN}'
+
+
+
+
+

Query parameters

+ ++++ + + + + + + + + + + + + + + + + +
ParameterDescription

page

페이지 번호

size

페이지당 항목 수

+
+
+

Request body

+
+
+
+
+
+
+
+

Response body

+
+
+
{
+  "pageInfo" : {
+    "currentPage" : 0,
+    "totalPages" : 2,
+    "totalElements" : 4,
+    "hasNext" : true,
+    "hasPrevious" : false
+  },
+  "content" : [ {
+    "id" : 1,
+    "title" : "시험1",
+    "description" : "설명1",
+    "status" : "PUBLISHED",
+    "author" : {
+      "id" : 1,
+      "name" : "작성자1",
+      "avatarUrl" : "a@gmail.com"
+    },
+    "questionCount" : 3,
+    "createdAt" : "2024-12-27T18:30:34.80767",
+    "updatedAt" : "2024-12-27T18:30:34.807675"
+  }, {
+    "id" : 2,
+    "title" : "시험2",
+    "description" : "설명2",
+    "status" : "PUBLISHED",
+    "author" : {
+      "id" : 1,
+      "name" : "작성자1",
+      "avatarUrl" : "a@gmail.com"
+    },
+    "questionCount" : 2,
+    "createdAt" : "2024-12-27T18:30:34.807677",
+    "updatedAt" : "2024-12-27T18:30:34.807678"
+  } ]
+}
+
+
+
+
+

Response fields

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

pageInfo

Object

페이지 정보

pageInfo.currentPage

Number

현재 페이지 번호

pageInfo.totalPages

Number

전체 페이지 수

pageInfo.totalElements

Number

전체 항목 수

pageInfo.hasNext

Boolean

다음 페이지 존재 여부

pageInfo.hasPrevious

Boolean

이전 페이지 존재 여부

content

Array

내용

content[].id

Number

시험 ID

content[].title

String

시험 제목

content[].description

String

시험 설명

content[].status

String

시험 상태

content[].author

Object

작성자 정보

content[].questionCount

Number

문제 수

content[].createdAt

String

생성일

content[].updatedAt

String

수정일

content[].author.id

Number

작성자 ID

content[].author.name

String

작성자 이름

content[].author.avatarUrl

String

작성자 아바타 URL

+
+
+
+

내가 출제한 시험 요약 목록 조회

+
+

No snippets found for operation::api/v1/exams/get-my-exam-summaries

+
+
+
+

시험 상세 조회

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams/1?page=0&size=2' -i -X GET \
+    -H 'Accept: application/json'
+
+
+
+
+

HTTP request

+
+
+
GET /api/v1/exams/1?page=0&size=2 HTTP/1.1
+Accept: application/json
+Host: api.fluffy.run
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+Content-Type: application/json
+Content-Length: 928
+
+{
+  "id" : 1,
+  "title" : "시험1",
+  "description" : "설명1",
+  "status" : "PUBLISHED",
+  "questions" : [ {
+    "id" : 1,
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER"
+  }, {
+    "id" : 2,
+    "text" : "질문2",
+    "type" : "LONG_ANSWER"
+  }, {
+    "id" : 3,
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "id" : 1,
+      "text" : "선택1"
+    }, {
+      "id" : 2,
+      "text" : "선택2"
+    } ]
+  }, {
+    "id" : 4,
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "id" : 3,
+      "text" : "선택3"
+    }, {
+      "id" : 4,
+      "text" : "선택4"
+    } ]
+  }, {
+    "id" : 5,
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "options" : [ {
+      "id" : 5,
+      "text" : "TRUE"
+    }, {
+      "id" : 6,
+      "text" : "FALSE"
+    } ]
+  } ],
+  "createdAt" : "2024-12-27T18:30:34.822354",
+  "updatedAt" : "2024-12-27T18:30:34.822362"
+}
+
+
+
+
+

HTTPie request

+
+
+
$ http GET 'https://api.fluffy.run/api/v1/exams/1?page=0&size=2' \
+    'Accept:application/json'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + +
Table 1. /api/v1/exams/{examId}
ParameterDescription

examId

시험 ID

+
+
+

Request body

+
+
+
+
+
+
+
+

Response body

+
+
+
{
+  "id" : 1,
+  "title" : "시험1",
+  "description" : "설명1",
+  "status" : "PUBLISHED",
+  "questions" : [ {
+    "id" : 1,
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER"
+  }, {
+    "id" : 2,
+    "text" : "질문2",
+    "type" : "LONG_ANSWER"
+  }, {
+    "id" : 3,
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "id" : 1,
+      "text" : "선택1"
+    }, {
+      "id" : 2,
+      "text" : "선택2"
+    } ]
+  }, {
+    "id" : 4,
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "id" : 3,
+      "text" : "선택3"
+    }, {
+      "id" : 4,
+      "text" : "선택4"
+    } ]
+  }, {
+    "id" : 5,
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "options" : [ {
+      "id" : 5,
+      "text" : "TRUE"
+    }, {
+      "id" : 6,
+      "text" : "FALSE"
+    } ]
+  } ],
+  "createdAt" : "2024-12-27T18:30:34.822354",
+  "updatedAt" : "2024-12-27T18:30:34.822362"
+}
+
+
+
+
+

Response fields

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

id

Number

시험 ID

title

String

시험 제목

description

String

시험 설명

status

String

시험 상태

questions

Array

문제 목록

questions[].id

Number

문제 ID

questions[].text

String

문제 내용

questions[].type

String

문제 유형

questions[].options

Array

선택지 목록

questions[].options[].id

Number

선택지 ID

questions[].options[].text

String

선택지 내용

createdAt

String

생성일

updatedAt

String

수정일

+
+
+
+

시험 상세 정보와 답안을 함께 조회

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams/1/with-answers?page=0&size=2' -i -X GET \
+    -H 'Accept: application/json' \
+    --cookie 'accessToken={ACCESS_TOKEN}'
+
+
+
+
+

HTTP request

+
+
+
GET /api/v1/exams/1/with-answers?page=0&size=2 HTTP/1.1
+Accept: application/json
+Host: api.fluffy.run
+Cookie: accessToken={ACCESS_TOKEN}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+Content-Type: application/json
+Content-Length: 1152
+
+{
+  "id" : 1,
+  "title" : "시험1",
+  "description" : "설명1",
+  "status" : "PUBLISHED",
+  "questions" : [ {
+    "id" : 1,
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER",
+    "correctAnswer" : "정답1"
+  }, {
+    "id" : 2,
+    "text" : "질문2",
+    "type" : "LONG_ANSWER",
+    "correctAnswer" : "정답2"
+  }, {
+    "id" : 3,
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "id" : 1,
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "id" : 2,
+      "text" : "선택2",
+      "isCorrect" : false
+    } ]
+  }, {
+    "id" : 4,
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "id" : 3,
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "id" : 4,
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "id" : 5,
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "options" : [ {
+      "id" : 5,
+      "text" : "TRUE",
+      "isCorrect" : true
+    }, {
+      "id" : 6,
+      "text" : "FALSE",
+      "isCorrect" : false
+    } ]
+  } ],
+  "createdAt" : "2024-12-27T18:30:34.862705",
+  "updatedAt" : "2024-12-27T18:30:34.862713"
+}
+
+
+
+
+

HTTPie request

+
+
+
$ http GET 'https://api.fluffy.run/api/v1/exams/1/with-answers?page=0&size=2' \
+    'Accept:application/json' \
+    'Cookie:accessToken={ACCESS_TOKEN}'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + +
Table 1. /api/v1/exams/{examId}/with-answers
ParameterDescription

examId

시험 ID

+
+
+

Request body

+
+
+
+
+
+
+
+

Response body

+
+
+
{
+  "id" : 1,
+  "title" : "시험1",
+  "description" : "설명1",
+  "status" : "PUBLISHED",
+  "questions" : [ {
+    "id" : 1,
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER",
+    "correctAnswer" : "정답1"
+  }, {
+    "id" : 2,
+    "text" : "질문2",
+    "type" : "LONG_ANSWER",
+    "correctAnswer" : "정답2"
+  }, {
+    "id" : 3,
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "id" : 1,
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "id" : 2,
+      "text" : "선택2",
+      "isCorrect" : false
+    } ]
+  }, {
+    "id" : 4,
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "id" : 3,
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "id" : 4,
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "id" : 5,
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "options" : [ {
+      "id" : 5,
+      "text" : "TRUE",
+      "isCorrect" : true
+    }, {
+      "id" : 6,
+      "text" : "FALSE",
+      "isCorrect" : false
+    } ]
+  } ],
+  "createdAt" : "2024-12-27T18:30:34.862705",
+  "updatedAt" : "2024-12-27T18:30:34.862713"
+}
+
+
+
+
+

Response fields

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

id

Number

시험 ID

title

String

시험 제목

description

String

시험 설명

status

String

시험 상태

questions

Array

문제 목록

questions[].id

Number

문제 ID

questions[].text

String

문제 내용

questions[].type

String

문제 유형

questions[].correctAnswer

String

정답

questions[].options

Array

선택지 목록

questions[].options[].id

Number

선택지 ID

questions[].options[].text

String

선택지 내용

questions[].options[].isCorrect

Boolean

정답 여부

createdAt

String

생성일

updatedAt

String

수정일

+
+
+
+

시험 생성

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams' -i -X POST \
+    -H 'Content-Type: application/json' \
+    --cookie 'accessToken={ACCESS_TOKEN}' \
+    -d '{
+  "title" : "시험 제목"
+}'
+
+
+
+
+

HTTP request

+
+
+
POST /api/v1/exams HTTP/1.1
+Content-Type: application/json
+Content-Length: 31
+Host: api.fluffy.run
+Cookie: accessToken={ACCESS_TOKEN}
+
+{
+  "title" : "시험 제목"
+}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 201 Created
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+Location: /api/v1/exams/1
+Content-Type: application/json
+Content-Length: 43
+
+{
+  "id" : 1,
+  "title" : "시험 제목"
+}
+
+
+
+
+

HTTPie request

+
+
+
$ echo '{
+  "title" : "시험 제목"
+}' | http POST 'https://api.fluffy.run/api/v1/exams' \
+    'Content-Type:application/json' \
+    'Cookie:accessToken={ACCESS_TOKEN}'
+
+
+
+
+

Request body

+
+
+
{
+  "title" : "시험 제목"
+}
+
+
+
+
+

Request fields

+ +++++ + + + + + + + + + + + + + + +
PathTypeDescription

title

String

시험 제목

+
+
+

Response body

+
+
+
{
+  "id" : 1,
+  "title" : "시험 제목"
+}
+
+
+
+
+

Response fields

+ +++++ + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

id

Number

시험 ID

title

String

시험 제목

+
+
+
+

시험 출제

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams/1/publish' -i -X POST \
+    -H 'Content-Type: application/json' \
+    --cookie 'accessToken={ACCESS_TOKEN}' \
+    -d '{
+  "questions" : [ {
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER",
+    "correctAnswer" : "답"
+  }, {
+    "text" : "질문2",
+    "type" : "LONG_ANSWER"
+  }, {
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : false
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "trueOrFalse" : true
+  } ],
+  "startAt" : "2024-12-27T18:30:34.787075",
+  "endAt" : "2024-12-28T18:30:34.787081"
+}'
+
+
+
+
+

HTTP request

+
+
+
POST /api/v1/exams/1/publish HTTP/1.1
+Content-Type: application/json
+Content-Length: 743
+Host: api.fluffy.run
+Cookie: accessToken={ACCESS_TOKEN}
+
+{
+  "questions" : [ {
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER",
+    "correctAnswer" : "답"
+  }, {
+    "text" : "질문2",
+    "type" : "LONG_ANSWER"
+  }, {
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : false
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "trueOrFalse" : true
+  } ],
+  "startAt" : "2024-12-27T18:30:34.787075",
+  "endAt" : "2024-12-28T18:30:34.787081"
+}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+
+
+
+
+

HTTPie request

+
+
+
$ echo '{
+  "questions" : [ {
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER",
+    "correctAnswer" : "답"
+  }, {
+    "text" : "질문2",
+    "type" : "LONG_ANSWER"
+  }, {
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : false
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "trueOrFalse" : true
+  } ],
+  "startAt" : "2024-12-27T18:30:34.787075",
+  "endAt" : "2024-12-28T18:30:34.787081"
+}' | http POST 'https://api.fluffy.run/api/v1/exams/1/publish' \
+    'Content-Type:application/json' \
+    'Cookie:accessToken={ACCESS_TOKEN}'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + +
Table 1. /api/v1/exams/{examId}/publish
ParameterDescription

examId

시험 ID

+
+
+

Request body

+
+
+
{
+  "questions" : [ {
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER",
+    "correctAnswer" : "답"
+  }, {
+    "text" : "질문2",
+    "type" : "LONG_ANSWER"
+  }, {
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : false
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "trueOrFalse" : true
+  } ],
+  "startAt" : "2024-12-27T18:30:34.787075",
+  "endAt" : "2024-12-28T18:30:34.787081"
+}
+
+
+
+
+

Request fields

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

questions

Array

문제 목록

questions[].text

String

문제 내용

questions[].type

String

문제 유형

questions[].correctAnswer

String

정답

questions[].trueOrFalse

Boolean

true or false 정답

questions[].options

Array

선택지 목록

questions[].options[].text

String

선택지 내용

questions[].options[].isCorrect

Boolean

정답 여부

startAt

String

시작 시간

endAt

String

종료 시간

+
+
+

Response body

+
+
+
+
+
+
+
+
+

시험 문제 수정

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams/1/questions' -i -X PUT \
+    -H 'Content-Type: application/json' \
+    --cookie 'accessToken={ACCESS_TOKEN}' \
+    -d '{
+  "questions" : [ {
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER",
+    "correctAnswer" : "답"
+  }, {
+    "text" : "질문2",
+    "type" : "LONG_ANSWER"
+  }, {
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : false
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "trueOrFalse" : true
+  } ]
+}'
+
+
+
+
+

HTTP request

+
+
+
PUT /api/v1/exams/1/questions HTTP/1.1
+Content-Type: application/json
+Content-Length: 657
+Host: api.fluffy.run
+Cookie: accessToken={ACCESS_TOKEN}
+
+{
+  "questions" : [ {
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER",
+    "correctAnswer" : "답"
+  }, {
+    "text" : "질문2",
+    "type" : "LONG_ANSWER"
+  }, {
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : false
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "trueOrFalse" : true
+  } ]
+}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 204 No Content
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+
+
+
+
+

HTTPie request

+
+
+
$ echo '{
+  "questions" : [ {
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER",
+    "correctAnswer" : "답"
+  }, {
+    "text" : "질문2",
+    "type" : "LONG_ANSWER"
+  }, {
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : false
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "trueOrFalse" : true
+  } ]
+}' | http PUT 'https://api.fluffy.run/api/v1/exams/1/questions' \
+    'Content-Type:application/json' \
+    'Cookie:accessToken={ACCESS_TOKEN}'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + +
Table 1. /api/v1/exams/{examId}/questions
ParameterDescription

examId

시험 ID

+
+
+

Request body

+
+
+
{
+  "questions" : [ {
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER",
+    "correctAnswer" : "답"
+  }, {
+    "text" : "질문2",
+    "type" : "LONG_ANSWER"
+  }, {
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : false
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "trueOrFalse" : true
+  } ]
+}
+
+
+
+
+

Request fields

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

questions

Array

문제 목록

questions[].text

String

문제 내용

questions[].type

String

문제 유형

questions[].correctAnswer

String

정답

questions[].trueOrFalse

Boolean

true or false 정답

questions[].options

Array

선택지 목록

questions[].options[].text

String

선택지 내용

questions[].options[].isCorrect

Boolean

정답 여부

+
+
+

Response body

+
+
+
+
+
+
+
+
+

시험 제목 수정

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams/1/title' -i -X PATCH \
+    -H 'Content-Type: application/json' \
+    --cookie 'accessToken={ACCESS_TOKEN}' \
+    -d '{
+  "title" : "시험 제목"
+}'
+
+
+
+
+

HTTP request

+
+
+
PATCH /api/v1/exams/1/title HTTP/1.1
+Content-Type: application/json
+Content-Length: 31
+Host: api.fluffy.run
+Cookie: accessToken={ACCESS_TOKEN}
+
+{
+  "title" : "시험 제목"
+}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+
+
+
+
+

HTTPie request

+
+
+
$ echo '{
+  "title" : "시험 제목"
+}' | http PATCH 'https://api.fluffy.run/api/v1/exams/1/title' \
+    'Content-Type:application/json' \
+    'Cookie:accessToken={ACCESS_TOKEN}'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + +
Table 1. /api/v1/exams/{examId}/title
ParameterDescription

examId

시험 ID

+
+
+

Request body

+
+
+
{
+  "title" : "시험 제목"
+}
+
+
+
+
+

Request fields

+ +++++ + + + + + + + + + + + + + + +
PathTypeDescription

title

String

시험 제목

+
+
+

Response body

+
+
+
+
+
+
+
+
+

시험 설명 수정

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams/1/description' -i -X PATCH \
+    -H 'Content-Type: application/json' \
+    --cookie 'accessToken={ACCESS_TOKEN}' \
+    -d '{
+  "description" : "시험 설명"
+}'
+
+
+
+
+

HTTP request

+
+
+
PATCH /api/v1/exams/1/description HTTP/1.1
+Content-Type: application/json
+Content-Length: 37
+Host: api.fluffy.run
+Cookie: accessToken={ACCESS_TOKEN}
+
+{
+  "description" : "시험 설명"
+}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+
+
+
+
+

HTTPie request

+
+
+
$ echo '{
+  "description" : "시험 설명"
+}' | http PATCH 'https://api.fluffy.run/api/v1/exams/1/description' \
+    'Content-Type:application/json' \
+    'Cookie:accessToken={ACCESS_TOKEN}'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + +
Table 1. /api/v1/exams/{examId}/description
ParameterDescription

examId

시험 ID

+
+
+

Request body

+
+
+
{
+  "description" : "시험 설명"
+}
+
+
+
+
+

Request fields

+ +++++ + + + + + + + + + + + + + + +
PathTypeDescription

description

String

시험 설명

+
+
+

Response body

+
+
+
+
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/server/src/main/resources/static/docs/index.html b/server/src/main/resources/static/docs/index.html new file mode 100644 index 0000000..663f244 --- /dev/null +++ b/server/src/main/resources/static/docs/index.html @@ -0,0 +1,3323 @@ + + + + + + + +Fluffy API 문서 + + + + + + +
+
+

Auth API

+
+
+

나의 정보 조회

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/auth/me' -i -X GET \
+    -H 'Content-Type: application/json' \
+    --cookie 'access_token={ACCESS_TOKEN}'
+
+
+
+
+

HTTP request

+
+
+
GET /api/v1/auth/me HTTP/1.1
+Content-Type: application/json
+Host: api.fluffy.run
+Cookie: access_token={ACCESS_TOKEN}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+Content-Type: application/json
+Content-Length: 104
+
+{
+  "id" : 1,
+  "email" : "mock@gmail.com",
+  "name" : "mock-name",
+  "avatarUrl" : "https://mock.com"
+}
+
+
+
+
+

HTTPie request

+
+
+
$ http GET 'https://api.fluffy.run/api/v1/auth/me' \
+    'Content-Type:application/json' \
+    'Cookie:access_token={ACCESS_TOKEN}'
+
+
+
+
+

Request body

+
+
+
+
+
+
+
+

Response body

+
+
+
{
+  "id" : 1,
+  "email" : "mock@gmail.com",
+  "name" : "mock-name",
+  "avatarUrl" : "https://mock.com"
+}
+
+
+
+
+

Response fields

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

id

Number

사용자 식별자

email

String

사용자 이메일

name

String

사용자 이름

avatarUrl

String

사용자 프로필 이미지 URL

+
+
+
+

로그아웃

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/auth/logout' -i -X POST \
+    -H 'Content-Type: application/json' \
+    --cookie 'access_token={ACCESS_TOKEN}'
+
+
+
+
+

HTTP request

+
+
+
POST /api/v1/auth/logout HTTP/1.1
+Content-Type: application/json
+Host: api.fluffy.run
+Cookie: access_token={ACCESS_TOKEN}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+Set-Cookie: access_token=; Path=/; Domain=.fluffy.run; Max-Age=0; Expires=Thu, 1 Jan 1970 00:00:00 GMT; Secure; HttpOnly
+
+
+
+
+

HTTPie request

+
+
+
$ http POST 'https://api.fluffy.run/api/v1/auth/logout' \
+    'Content-Type:application/json' \
+    'Cookie:access_token={ACCESS_TOKEN}'
+
+
+
+
+

Request body

+
+
+
+
+
+
+
+

Response body

+
+
+
+
+
+
+
+
+
+
+

OAuth2 API

+
+
+

OAuth2 로그인 페이지로 리다이렉트

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/auth/oauth2/redirect/github?next=%2F' -i -X GET
+
+
+
+
+

HTTP request

+
+
+
GET /api/v1/auth/oauth2/redirect/github?next=%2F HTTP/1.1
+Host: api.fluffy.run
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 302 Found
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+Location: https://github.com/login/oauth/authorize?client_id={CLIENT_ID}&redirect_uri={REDIRECT_URI}&next=/
+
+
+
+
+

HTTPie request

+
+
+
$ http GET 'https://api.fluffy.run/api/v1/auth/oauth2/redirect/github?next=%2F'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + +
Table 1. /api/v1/auth/oauth2/redirect/{provider}
ParameterDescription

provider

OAuth2 제공자

+
+
+

Query parameters

+ ++++ + + + + + + + + + + + + +
ParameterDescription

next

리다이렉트 후 이동할 URL

+
+
+

Request body

+
+
+
+
+
+
+
+

Response body

+
+
+
+
+
+
+
+
+

OAuth2 로그인 콜백 처리

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/auth/oauth2/callback/github?code=%7BCODE%7D&next=%7BNEXT%7D' -i -X GET
+
+
+
+
+

HTTP request

+
+
+
GET /api/v1/auth/oauth2/callback/github?code=%7BCODE%7D&next=%7BNEXT%7D HTTP/1.1
+Host: api.fluffy.run
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 302 Found
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+Set-Cookie: access_token=access_token_value; Path=/; Domain=.fluffy.run; Max-Age=2592000; Expires=Sun, 26 Jan 2025 09:30:38 GMT; Secure; HttpOnly
+Location: https://fluffy.run/{NEXT}
+
+
+
+
+

HTTPie request

+
+
+
$ http GET 'https://api.fluffy.run/api/v1/auth/oauth2/callback/github?code=%7BCODE%7D&next=%7BNEXT%7D'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + +
Table 1. /api/v1/auth/oauth2/callback/{provider}
ParameterDescription

provider

OAuth2 제공자

+
+
+

Query parameters

+ ++++ + + + + + + + + + + + + + + + + +
ParameterDescription

code

인증 코드

next

리다이렉트 후 이동할 URL

+
+
+

Request body

+
+
+
+
+
+
+
+

Response body

+
+
+
+
+
+
+
+
+
+
+

Exam API

+
+
+

출제된 시험 요약 목록 조회

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams?page=0&size=2' -i -X GET \
+    -H 'Accept: application/json' \
+    --cookie 'accessToken={ACCESS_TOKEN}'
+
+
+
+
+

HTTP request

+
+
+
GET /api/v1/exams?page=0&size=2 HTTP/1.1
+Accept: application/json
+Host: api.fluffy.run
+Cookie: accessToken={ACCESS_TOKEN}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+Content-Type: application/json
+Content-Length: 815
+
+{
+  "pageInfo" : {
+    "currentPage" : 0,
+    "totalPages" : 2,
+    "totalElements" : 4,
+    "hasNext" : true,
+    "hasPrevious" : false
+  },
+  "content" : [ {
+    "id" : 1,
+    "title" : "시험1",
+    "description" : "설명1",
+    "status" : "PUBLISHED",
+    "author" : {
+      "id" : 1,
+      "name" : "작성자1",
+      "avatarUrl" : "a@gmail.com"
+    },
+    "questionCount" : 3,
+    "createdAt" : "2024-12-27T18:30:34.80767",
+    "updatedAt" : "2024-12-27T18:30:34.807675"
+  }, {
+    "id" : 2,
+    "title" : "시험2",
+    "description" : "설명2",
+    "status" : "PUBLISHED",
+    "author" : {
+      "id" : 1,
+      "name" : "작성자1",
+      "avatarUrl" : "a@gmail.com"
+    },
+    "questionCount" : 2,
+    "createdAt" : "2024-12-27T18:30:34.807677",
+    "updatedAt" : "2024-12-27T18:30:34.807678"
+  } ]
+}
+
+
+
+
+

HTTPie request

+
+
+
$ http GET 'https://api.fluffy.run/api/v1/exams?page=0&size=2' \
+    'Accept:application/json' \
+    'Cookie:accessToken={ACCESS_TOKEN}'
+
+
+
+
+

Query parameters

+ ++++ + + + + + + + + + + + + + + + + +
ParameterDescription

page

페이지 번호

size

페이지당 항목 수

+
+
+

Request body

+
+
+
+
+
+
+
+

Response body

+
+
+
{
+  "pageInfo" : {
+    "currentPage" : 0,
+    "totalPages" : 2,
+    "totalElements" : 4,
+    "hasNext" : true,
+    "hasPrevious" : false
+  },
+  "content" : [ {
+    "id" : 1,
+    "title" : "시험1",
+    "description" : "설명1",
+    "status" : "PUBLISHED",
+    "author" : {
+      "id" : 1,
+      "name" : "작성자1",
+      "avatarUrl" : "a@gmail.com"
+    },
+    "questionCount" : 3,
+    "createdAt" : "2024-12-27T18:30:34.80767",
+    "updatedAt" : "2024-12-27T18:30:34.807675"
+  }, {
+    "id" : 2,
+    "title" : "시험2",
+    "description" : "설명2",
+    "status" : "PUBLISHED",
+    "author" : {
+      "id" : 1,
+      "name" : "작성자1",
+      "avatarUrl" : "a@gmail.com"
+    },
+    "questionCount" : 2,
+    "createdAt" : "2024-12-27T18:30:34.807677",
+    "updatedAt" : "2024-12-27T18:30:34.807678"
+  } ]
+}
+
+
+
+
+

Response fields

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

pageInfo

Object

페이지 정보

pageInfo.currentPage

Number

현재 페이지 번호

pageInfo.totalPages

Number

전체 페이지 수

pageInfo.totalElements

Number

전체 항목 수

pageInfo.hasNext

Boolean

다음 페이지 존재 여부

pageInfo.hasPrevious

Boolean

이전 페이지 존재 여부

content

Array

내용

content[].id

Number

시험 ID

content[].title

String

시험 제목

content[].description

String

시험 설명

content[].status

String

시험 상태

content[].author

Object

작성자 정보

content[].questionCount

Number

문제 수

content[].createdAt

String

생성일

content[].updatedAt

String

수정일

content[].author.id

Number

작성자 ID

content[].author.name

String

작성자 이름

content[].author.avatarUrl

String

작성자 아바타 URL

+
+
+
+

내가 출제한 시험 요약 목록 조회

+
+
+
+

No snippets found for operation::api/v1/exams/get-my-exam-summaries

+
+
+
+
+
+

시험 상세 조회

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams/1?page=0&size=2' -i -X GET \
+    -H 'Accept: application/json'
+
+
+
+
+

HTTP request

+
+
+
GET /api/v1/exams/1?page=0&size=2 HTTP/1.1
+Accept: application/json
+Host: api.fluffy.run
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+Content-Type: application/json
+Content-Length: 928
+
+{
+  "id" : 1,
+  "title" : "시험1",
+  "description" : "설명1",
+  "status" : "PUBLISHED",
+  "questions" : [ {
+    "id" : 1,
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER"
+  }, {
+    "id" : 2,
+    "text" : "질문2",
+    "type" : "LONG_ANSWER"
+  }, {
+    "id" : 3,
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "id" : 1,
+      "text" : "선택1"
+    }, {
+      "id" : 2,
+      "text" : "선택2"
+    } ]
+  }, {
+    "id" : 4,
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "id" : 3,
+      "text" : "선택3"
+    }, {
+      "id" : 4,
+      "text" : "선택4"
+    } ]
+  }, {
+    "id" : 5,
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "options" : [ {
+      "id" : 5,
+      "text" : "TRUE"
+    }, {
+      "id" : 6,
+      "text" : "FALSE"
+    } ]
+  } ],
+  "createdAt" : "2024-12-27T18:30:34.822354",
+  "updatedAt" : "2024-12-27T18:30:34.822362"
+}
+
+
+
+
+

HTTPie request

+
+
+
$ http GET 'https://api.fluffy.run/api/v1/exams/1?page=0&size=2' \
+    'Accept:application/json'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + +
Table 1. /api/v1/exams/{examId}
ParameterDescription

examId

시험 ID

+
+
+

Request body

+
+
+
+
+
+
+
+

Response body

+
+
+
{
+  "id" : 1,
+  "title" : "시험1",
+  "description" : "설명1",
+  "status" : "PUBLISHED",
+  "questions" : [ {
+    "id" : 1,
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER"
+  }, {
+    "id" : 2,
+    "text" : "질문2",
+    "type" : "LONG_ANSWER"
+  }, {
+    "id" : 3,
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "id" : 1,
+      "text" : "선택1"
+    }, {
+      "id" : 2,
+      "text" : "선택2"
+    } ]
+  }, {
+    "id" : 4,
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "id" : 3,
+      "text" : "선택3"
+    }, {
+      "id" : 4,
+      "text" : "선택4"
+    } ]
+  }, {
+    "id" : 5,
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "options" : [ {
+      "id" : 5,
+      "text" : "TRUE"
+    }, {
+      "id" : 6,
+      "text" : "FALSE"
+    } ]
+  } ],
+  "createdAt" : "2024-12-27T18:30:34.822354",
+  "updatedAt" : "2024-12-27T18:30:34.822362"
+}
+
+
+
+
+

Response fields

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

id

Number

시험 ID

title

String

시험 제목

description

String

시험 설명

status

String

시험 상태

questions

Array

문제 목록

questions[].id

Number

문제 ID

questions[].text

String

문제 내용

questions[].type

String

문제 유형

questions[].options

Array

선택지 목록

questions[].options[].id

Number

선택지 ID

questions[].options[].text

String

선택지 내용

createdAt

String

생성일

updatedAt

String

수정일

+
+
+
+

시험 상세 정보와 답안을 함께 조회

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams/1/with-answers?page=0&size=2' -i -X GET \
+    -H 'Accept: application/json' \
+    --cookie 'accessToken={ACCESS_TOKEN}'
+
+
+
+
+

HTTP request

+
+
+
GET /api/v1/exams/1/with-answers?page=0&size=2 HTTP/1.1
+Accept: application/json
+Host: api.fluffy.run
+Cookie: accessToken={ACCESS_TOKEN}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+Content-Type: application/json
+Content-Length: 1152
+
+{
+  "id" : 1,
+  "title" : "시험1",
+  "description" : "설명1",
+  "status" : "PUBLISHED",
+  "questions" : [ {
+    "id" : 1,
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER",
+    "correctAnswer" : "정답1"
+  }, {
+    "id" : 2,
+    "text" : "질문2",
+    "type" : "LONG_ANSWER",
+    "correctAnswer" : "정답2"
+  }, {
+    "id" : 3,
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "id" : 1,
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "id" : 2,
+      "text" : "선택2",
+      "isCorrect" : false
+    } ]
+  }, {
+    "id" : 4,
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "id" : 3,
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "id" : 4,
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "id" : 5,
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "options" : [ {
+      "id" : 5,
+      "text" : "TRUE",
+      "isCorrect" : true
+    }, {
+      "id" : 6,
+      "text" : "FALSE",
+      "isCorrect" : false
+    } ]
+  } ],
+  "createdAt" : "2024-12-27T18:30:34.862705",
+  "updatedAt" : "2024-12-27T18:30:34.862713"
+}
+
+
+
+
+

HTTPie request

+
+
+
$ http GET 'https://api.fluffy.run/api/v1/exams/1/with-answers?page=0&size=2' \
+    'Accept:application/json' \
+    'Cookie:accessToken={ACCESS_TOKEN}'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + +
Table 1. /api/v1/exams/{examId}/with-answers
ParameterDescription

examId

시험 ID

+
+
+

Request body

+
+
+
+
+
+
+
+

Response body

+
+
+
{
+  "id" : 1,
+  "title" : "시험1",
+  "description" : "설명1",
+  "status" : "PUBLISHED",
+  "questions" : [ {
+    "id" : 1,
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER",
+    "correctAnswer" : "정답1"
+  }, {
+    "id" : 2,
+    "text" : "질문2",
+    "type" : "LONG_ANSWER",
+    "correctAnswer" : "정답2"
+  }, {
+    "id" : 3,
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "id" : 1,
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "id" : 2,
+      "text" : "선택2",
+      "isCorrect" : false
+    } ]
+  }, {
+    "id" : 4,
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "id" : 3,
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "id" : 4,
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "id" : 5,
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "options" : [ {
+      "id" : 5,
+      "text" : "TRUE",
+      "isCorrect" : true
+    }, {
+      "id" : 6,
+      "text" : "FALSE",
+      "isCorrect" : false
+    } ]
+  } ],
+  "createdAt" : "2024-12-27T18:30:34.862705",
+  "updatedAt" : "2024-12-27T18:30:34.862713"
+}
+
+
+
+
+

Response fields

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

id

Number

시험 ID

title

String

시험 제목

description

String

시험 설명

status

String

시험 상태

questions

Array

문제 목록

questions[].id

Number

문제 ID

questions[].text

String

문제 내용

questions[].type

String

문제 유형

questions[].correctAnswer

String

정답

questions[].options

Array

선택지 목록

questions[].options[].id

Number

선택지 ID

questions[].options[].text

String

선택지 내용

questions[].options[].isCorrect

Boolean

정답 여부

createdAt

String

생성일

updatedAt

String

수정일

+
+
+
+

시험 생성

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams' -i -X POST \
+    -H 'Content-Type: application/json' \
+    --cookie 'accessToken={ACCESS_TOKEN}' \
+    -d '{
+  "title" : "시험 제목"
+}'
+
+
+
+
+

HTTP request

+
+
+
POST /api/v1/exams HTTP/1.1
+Content-Type: application/json
+Content-Length: 31
+Host: api.fluffy.run
+Cookie: accessToken={ACCESS_TOKEN}
+
+{
+  "title" : "시험 제목"
+}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 201 Created
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+Location: /api/v1/exams/1
+Content-Type: application/json
+Content-Length: 43
+
+{
+  "id" : 1,
+  "title" : "시험 제목"
+}
+
+
+
+
+

HTTPie request

+
+
+
$ echo '{
+  "title" : "시험 제목"
+}' | http POST 'https://api.fluffy.run/api/v1/exams' \
+    'Content-Type:application/json' \
+    'Cookie:accessToken={ACCESS_TOKEN}'
+
+
+
+
+

Request body

+
+
+
{
+  "title" : "시험 제목"
+}
+
+
+
+
+

Request fields

+ +++++ + + + + + + + + + + + + + + +
PathTypeDescription

title

String

시험 제목

+
+
+

Response body

+
+
+
{
+  "id" : 1,
+  "title" : "시험 제목"
+}
+
+
+
+
+

Response fields

+ +++++ + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

id

Number

시험 ID

title

String

시험 제목

+
+
+
+

시험 출제

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams/1/publish' -i -X POST \
+    -H 'Content-Type: application/json' \
+    --cookie 'accessToken={ACCESS_TOKEN}' \
+    -d '{
+  "questions" : [ {
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER",
+    "correctAnswer" : "답"
+  }, {
+    "text" : "질문2",
+    "type" : "LONG_ANSWER"
+  }, {
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : false
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "trueOrFalse" : true
+  } ],
+  "startAt" : "2024-12-27T18:30:34.787075",
+  "endAt" : "2024-12-28T18:30:34.787081"
+}'
+
+
+
+
+

HTTP request

+
+
+
POST /api/v1/exams/1/publish HTTP/1.1
+Content-Type: application/json
+Content-Length: 743
+Host: api.fluffy.run
+Cookie: accessToken={ACCESS_TOKEN}
+
+{
+  "questions" : [ {
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER",
+    "correctAnswer" : "답"
+  }, {
+    "text" : "질문2",
+    "type" : "LONG_ANSWER"
+  }, {
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : false
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "trueOrFalse" : true
+  } ],
+  "startAt" : "2024-12-27T18:30:34.787075",
+  "endAt" : "2024-12-28T18:30:34.787081"
+}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+
+
+
+
+

HTTPie request

+
+
+
$ echo '{
+  "questions" : [ {
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER",
+    "correctAnswer" : "답"
+  }, {
+    "text" : "질문2",
+    "type" : "LONG_ANSWER"
+  }, {
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : false
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "trueOrFalse" : true
+  } ],
+  "startAt" : "2024-12-27T18:30:34.787075",
+  "endAt" : "2024-12-28T18:30:34.787081"
+}' | http POST 'https://api.fluffy.run/api/v1/exams/1/publish' \
+    'Content-Type:application/json' \
+    'Cookie:accessToken={ACCESS_TOKEN}'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + +
Table 1. /api/v1/exams/{examId}/publish
ParameterDescription

examId

시험 ID

+
+
+

Request body

+
+
+
{
+  "questions" : [ {
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER",
+    "correctAnswer" : "답"
+  }, {
+    "text" : "질문2",
+    "type" : "LONG_ANSWER"
+  }, {
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : false
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "trueOrFalse" : true
+  } ],
+  "startAt" : "2024-12-27T18:30:34.787075",
+  "endAt" : "2024-12-28T18:30:34.787081"
+}
+
+
+
+
+

Request fields

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

questions

Array

문제 목록

questions[].text

String

문제 내용

questions[].type

String

문제 유형

questions[].correctAnswer

String

정답

questions[].trueOrFalse

Boolean

true or false 정답

questions[].options

Array

선택지 목록

questions[].options[].text

String

선택지 내용

questions[].options[].isCorrect

Boolean

정답 여부

startAt

String

시작 시간

endAt

String

종료 시간

+
+
+

Response body

+
+
+
+
+
+
+
+
+

시험 문제 수정

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams/1/questions' -i -X PUT \
+    -H 'Content-Type: application/json' \
+    --cookie 'accessToken={ACCESS_TOKEN}' \
+    -d '{
+  "questions" : [ {
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER",
+    "correctAnswer" : "답"
+  }, {
+    "text" : "질문2",
+    "type" : "LONG_ANSWER"
+  }, {
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : false
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "trueOrFalse" : true
+  } ]
+}'
+
+
+
+
+

HTTP request

+
+
+
PUT /api/v1/exams/1/questions HTTP/1.1
+Content-Type: application/json
+Content-Length: 657
+Host: api.fluffy.run
+Cookie: accessToken={ACCESS_TOKEN}
+
+{
+  "questions" : [ {
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER",
+    "correctAnswer" : "답"
+  }, {
+    "text" : "질문2",
+    "type" : "LONG_ANSWER"
+  }, {
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : false
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "trueOrFalse" : true
+  } ]
+}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 204 No Content
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+
+
+
+
+

HTTPie request

+
+
+
$ echo '{
+  "questions" : [ {
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER",
+    "correctAnswer" : "답"
+  }, {
+    "text" : "질문2",
+    "type" : "LONG_ANSWER"
+  }, {
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : false
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "trueOrFalse" : true
+  } ]
+}' | http PUT 'https://api.fluffy.run/api/v1/exams/1/questions' \
+    'Content-Type:application/json' \
+    'Cookie:accessToken={ACCESS_TOKEN}'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + +
Table 1. /api/v1/exams/{examId}/questions
ParameterDescription

examId

시험 ID

+
+
+

Request body

+
+
+
{
+  "questions" : [ {
+    "text" : "질문1",
+    "type" : "SHORT_ANSWER",
+    "correctAnswer" : "답"
+  }, {
+    "text" : "질문2",
+    "type" : "LONG_ANSWER"
+  }, {
+    "text" : "질문3",
+    "type" : "SINGLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : false
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "options" : [ {
+      "text" : "선택1",
+      "isCorrect" : true
+    }, {
+      "text" : "선택2",
+      "isCorrect" : true
+    } ]
+  }, {
+    "text" : "질문5",
+    "type" : "TRUE_OR_FALSE",
+    "trueOrFalse" : true
+  } ]
+}
+
+
+
+
+

Request fields

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

questions

Array

문제 목록

questions[].text

String

문제 내용

questions[].type

String

문제 유형

questions[].correctAnswer

String

정답

questions[].trueOrFalse

Boolean

true or false 정답

questions[].options

Array

선택지 목록

questions[].options[].text

String

선택지 내용

questions[].options[].isCorrect

Boolean

정답 여부

+
+
+

Response body

+
+
+
+
+
+
+
+
+

시험 제목 수정

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams/1/title' -i -X PATCH \
+    -H 'Content-Type: application/json' \
+    --cookie 'accessToken={ACCESS_TOKEN}' \
+    -d '{
+  "title" : "시험 제목"
+}'
+
+
+
+
+

HTTP request

+
+
+
PATCH /api/v1/exams/1/title HTTP/1.1
+Content-Type: application/json
+Content-Length: 31
+Host: api.fluffy.run
+Cookie: accessToken={ACCESS_TOKEN}
+
+{
+  "title" : "시험 제목"
+}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+
+
+
+
+

HTTPie request

+
+
+
$ echo '{
+  "title" : "시험 제목"
+}' | http PATCH 'https://api.fluffy.run/api/v1/exams/1/title' \
+    'Content-Type:application/json' \
+    'Cookie:accessToken={ACCESS_TOKEN}'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + +
Table 1. /api/v1/exams/{examId}/title
ParameterDescription

examId

시험 ID

+
+
+

Request body

+
+
+
{
+  "title" : "시험 제목"
+}
+
+
+
+
+

Request fields

+ +++++ + + + + + + + + + + + + + + +
PathTypeDescription

title

String

시험 제목

+
+
+

Response body

+
+
+
+
+
+
+
+
+

시험 설명 수정

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams/1/description' -i -X PATCH \
+    -H 'Content-Type: application/json' \
+    --cookie 'accessToken={ACCESS_TOKEN}' \
+    -d '{
+  "description" : "시험 설명"
+}'
+
+
+
+
+

HTTP request

+
+
+
PATCH /api/v1/exams/1/description HTTP/1.1
+Content-Type: application/json
+Content-Length: 37
+Host: api.fluffy.run
+Cookie: accessToken={ACCESS_TOKEN}
+
+{
+  "description" : "시험 설명"
+}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+
+
+
+
+

HTTPie request

+
+
+
$ echo '{
+  "description" : "시험 설명"
+}' | http PATCH 'https://api.fluffy.run/api/v1/exams/1/description' \
+    'Content-Type:application/json' \
+    'Cookie:accessToken={ACCESS_TOKEN}'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + +
Table 1. /api/v1/exams/{examId}/description
ParameterDescription

examId

시험 ID

+
+
+

Request body

+
+
+
{
+  "description" : "시험 설명"
+}
+
+
+
+
+

Request fields

+ +++++ + + + + + + + + + + + + + + +
PathTypeDescription

description

String

시험 설명

+
+
+

Response body

+
+
+
+
+
+
+
+
+
+
+

Submission API

+
+
+

시험 제출 요약 목록 조회

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams/1/submissions' -i -X GET \
+    --cookie 'accessToken={ACCESS_TOKEN}'
+
+
+
+
+

HTTP request

+
+
+
GET /api/v1/exams/1/submissions HTTP/1.1
+Host: api.fluffy.run
+Cookie: accessToken={ACCESS_TOKEN}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+Content-Type: application/json
+Content-Length: 388
+
+[ {
+  "id" : 1,
+  "participant" : {
+    "id" : 1,
+    "name" : "제출자1",
+    "email" : "a@gmail.com",
+    "avatarUrl" : "https://a.com"
+  },
+  "submittedAt" : "2024-12-27T18:30:38.388297"
+}, {
+  "id" : 2,
+  "participant" : {
+    "id" : 2,
+    "name" : "제출자2",
+    "email" : "b@gmail.com",
+    "avatarUrl" : "https://b.com"
+  },
+  "submittedAt" : "2024-12-27T18:30:38.388307"
+} ]
+
+
+
+
+

HTTPie request

+
+
+
$ http GET 'https://api.fluffy.run/api/v1/exams/1/submissions' \
+    'Cookie:accessToken={ACCESS_TOKEN}'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + +
Table 1. /api/v1/exams/{examId}/submissions
ParameterDescription

examId

시험 ID

+
+
+

Request body

+
+
+
+
+
+
+
+

Response body

+
+
+
[ {
+  "id" : 1,
+  "participant" : {
+    "id" : 1,
+    "name" : "제출자1",
+    "email" : "a@gmail.com",
+    "avatarUrl" : "https://a.com"
+  },
+  "submittedAt" : "2024-12-27T18:30:38.388297"
+}, {
+  "id" : 2,
+  "participant" : {
+    "id" : 2,
+    "name" : "제출자2",
+    "email" : "b@gmail.com",
+    "avatarUrl" : "https://b.com"
+  },
+  "submittedAt" : "2024-12-27T18:30:38.388307"
+} ]
+
+
+
+
+

Response fields

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

[].id

Number

제출 ID

[].participant.id

Number

제출자 ID

[].participant.name

String

제출자 이름

[].participant.email

String

제출자 이메일

[].participant.avatarUrl

String

제출자 프로필 URL

[].submittedAt

String

제출 시각

+
+
+
+

시험 제출 상세 조회

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams/1/submissions/1' -i -X GET \
+    --cookie 'accessToken={ACCESS_TOKEN}'
+
+
+
+
+

HTTP request

+
+
+
GET /api/v1/exams/1/submissions/1 HTTP/1.1
+Host: api.fluffy.run
+Cookie: accessToken={ACCESS_TOKEN}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+Content-Type: application/json
+Content-Length: 1584
+
+{
+  "id" : 1,
+  "answers" : [ {
+    "id" : 1,
+    "questionId" : 1,
+    "text" : "질문",
+    "type" : "SHORT_ANSWER",
+    "answer" : "답",
+    "correctAnswer" : "정답"
+  }, {
+    "id" : 2,
+    "questionId" : 2,
+    "text" : "질문2",
+    "type" : "SHORT_ANSWER",
+    "answer" : "답2",
+    "correctAnswer" : "정답2"
+  }, {
+    "id" : 3,
+    "questionId" : 3,
+    "text" : "질문3",
+    "type" : "MULTIPLE_CHOICE",
+    "choices" : [ {
+      "questionOptionId" : 1,
+      "text" : "선택지1",
+      "isCorrect" : true,
+      "isSelected" : true
+    }, {
+      "questionOptionId" : 2,
+      "text" : "선택지2",
+      "isCorrect" : false,
+      "isSelected" : false
+    } ]
+  }, {
+    "id" : 4,
+    "questionId" : 4,
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "choices" : [ {
+      "questionOptionId" : 3,
+      "text" : "선택지1",
+      "isCorrect" : true,
+      "isSelected" : true
+    }, {
+      "questionOptionId" : 4,
+      "text" : "선택지2",
+      "isCorrect" : true,
+      "isSelected" : false
+    } ]
+  }, {
+    "id" : 5,
+    "questionId" : 5,
+    "text" : "질문5",
+    "type" : "SINGLE_CHOICE",
+    "choices" : [ {
+      "questionOptionId" : 5,
+      "text" : "선택지1",
+      "isCorrect" : true,
+      "isSelected" : true
+    }, {
+      "questionOptionId" : 6,
+      "text" : "선택지2",
+      "isCorrect" : false,
+      "isSelected" : false
+    } ]
+  } ],
+  "participant" : {
+    "id" : 1,
+    "name" : "제출자",
+    "email" : "a@gmail.com",
+    "avatarUrl" : "https://a.com"
+  },
+  "submittedAt" : "2024-12-27T18:30:38.372014"
+}
+
+
+
+
+

HTTPie request

+
+
+
$ http GET 'https://api.fluffy.run/api/v1/exams/1/submissions/1' \
+    'Cookie:accessToken={ACCESS_TOKEN}'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + + + + + +
Table 1. /api/v1/exams/{examId}/submissions/{submissionId}
ParameterDescription

examId

시험 ID

submissionId

제출 ID

+
+
+

Request body

+
+
+
+
+
+
+
+

Response body

+
+
+
{
+  "id" : 1,
+  "answers" : [ {
+    "id" : 1,
+    "questionId" : 1,
+    "text" : "질문",
+    "type" : "SHORT_ANSWER",
+    "answer" : "답",
+    "correctAnswer" : "정답"
+  }, {
+    "id" : 2,
+    "questionId" : 2,
+    "text" : "질문2",
+    "type" : "SHORT_ANSWER",
+    "answer" : "답2",
+    "correctAnswer" : "정답2"
+  }, {
+    "id" : 3,
+    "questionId" : 3,
+    "text" : "질문3",
+    "type" : "MULTIPLE_CHOICE",
+    "choices" : [ {
+      "questionOptionId" : 1,
+      "text" : "선택지1",
+      "isCorrect" : true,
+      "isSelected" : true
+    }, {
+      "questionOptionId" : 2,
+      "text" : "선택지2",
+      "isCorrect" : false,
+      "isSelected" : false
+    } ]
+  }, {
+    "id" : 4,
+    "questionId" : 4,
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "choices" : [ {
+      "questionOptionId" : 3,
+      "text" : "선택지1",
+      "isCorrect" : true,
+      "isSelected" : true
+    }, {
+      "questionOptionId" : 4,
+      "text" : "선택지2",
+      "isCorrect" : true,
+      "isSelected" : false
+    } ]
+  }, {
+    "id" : 5,
+    "questionId" : 5,
+    "text" : "질문5",
+    "type" : "SINGLE_CHOICE",
+    "choices" : [ {
+      "questionOptionId" : 5,
+      "text" : "선택지1",
+      "isCorrect" : true,
+      "isSelected" : true
+    }, {
+      "questionOptionId" : 6,
+      "text" : "선택지2",
+      "isCorrect" : false,
+      "isSelected" : false
+    } ]
+  } ],
+  "participant" : {
+    "id" : 1,
+    "name" : "제출자",
+    "email" : "a@gmail.com",
+    "avatarUrl" : "https://a.com"
+  },
+  "submittedAt" : "2024-12-27T18:30:38.372014"
+}
+
+
+
+
+

Response fields

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

id

Number

제출 ID

answers[].id

Number

답안 ID

answers[].questionId

Number

질문 ID

answers[].text

String

질문

answers[].type

String

질문 유형

answers[].answer

String

제출한 답

answers[].correctAnswer

String

정답

answers[].choices[].questionOptionId

Number

선택지 ID

answers[].choices[].text

String

선택지

answers[].choices[].isCorrect

Boolean

정답 여부

answers[].choices[].isSelected

Boolean

선택 여부

participant.id

Number

제출자 ID

participant.name

String

제출자 이름

participant.email

String

제출자 이메일

participant.avatarUrl

String

제출자 프로필 URL

submittedAt

String

제출 시각

+
+
+
+

시험 제출

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams/1/submissions' -i -X POST \
+    -H 'Content-Type: application/json' \
+    --cookie 'accessToken={ACCESS_TOKEN}' \
+    -d '{
+  "questionResponses" : [ {
+    "answers" : [ "답" ]
+  }, {
+    "answers" : [ "닭은 동물입니다.", "닭은 곤충입니다." ]
+  } ]
+}'
+
+
+
+
+

HTTP request

+
+
+
POST /api/v1/exams/1/submissions HTTP/1.1
+Content-Type: application/json
+Content-Length: 143
+Host: api.fluffy.run
+Cookie: accessToken={ACCESS_TOKEN}
+
+{
+  "questionResponses" : [ {
+    "answers" : [ "답" ]
+  }, {
+    "answers" : [ "닭은 동물입니다.", "닭은 곤충입니다." ]
+  } ]
+}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+
+
+
+
+

HTTPie request

+
+
+
$ echo '{
+  "questionResponses" : [ {
+    "answers" : [ "답" ]
+  }, {
+    "answers" : [ "닭은 동물입니다.", "닭은 곤충입니다." ]
+  } ]
+}' | http POST 'https://api.fluffy.run/api/v1/exams/1/submissions' \
+    'Content-Type:application/json' \
+    'Cookie:accessToken={ACCESS_TOKEN}'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + +
Table 1. /api/v1/exams/{examId}/submissions
ParameterDescription

examId

시험 ID

+
+
+

Request body

+
+
+
{
+  "questionResponses" : [ {
+    "answers" : [ "답" ]
+  }, {
+    "answers" : [ "닭은 동물입니다.", "닭은 곤충입니다." ]
+  } ]
+}
+
+
+
+
+

Request fields

+ +++++ + + + + + + + + + + + + + + +
PathTypeDescription

questionResponses[].answers[]

Array

답 또는 선택 옵션

+
+
+

Response body

+
+
+
+
+
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/server/src/main/resources/static/docs/oauth2.html b/server/src/main/resources/static/docs/oauth2.html new file mode 100644 index 0000000..2f4bc50 --- /dev/null +++ b/server/src/main/resources/static/docs/oauth2.html @@ -0,0 +1,659 @@ + + + + + + + +OAuth2 API + + + + + +
+
+

OAuth2 API

+
+
+

OAuth2 로그인 페이지로 리다이렉트

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/auth/oauth2/redirect/github?next=%2F' -i -X GET
+
+
+
+
+

HTTP request

+
+
+
GET /api/v1/auth/oauth2/redirect/github?next=%2F HTTP/1.1
+Host: api.fluffy.run
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 302 Found
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+Location: https://github.com/login/oauth/authorize?client_id={CLIENT_ID}&redirect_uri={REDIRECT_URI}&next=/
+
+
+
+
+

HTTPie request

+
+
+
$ http GET 'https://api.fluffy.run/api/v1/auth/oauth2/redirect/github?next=%2F'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + +
Table 1. /api/v1/auth/oauth2/redirect/{provider}
ParameterDescription

provider

OAuth2 제공자

+
+
+

Query parameters

+ ++++ + + + + + + + + + + + + +
ParameterDescription

next

리다이렉트 후 이동할 URL

+
+
+

Request body

+
+
+
+
+
+
+
+

Response body

+
+
+
+
+
+
+
+
+

OAuth2 로그인 콜백 처리

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/auth/oauth2/callback/github?code=%7BCODE%7D&next=%7BNEXT%7D' -i -X GET
+
+
+
+
+

HTTP request

+
+
+
GET /api/v1/auth/oauth2/callback/github?code=%7BCODE%7D&next=%7BNEXT%7D HTTP/1.1
+Host: api.fluffy.run
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 302 Found
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+Set-Cookie: access_token=access_token_value; Path=/; Domain=.fluffy.run; Max-Age=2592000; Expires=Sun, 26 Jan 2025 09:30:38 GMT; Secure; HttpOnly
+Location: https://fluffy.run/{NEXT}
+
+
+
+
+

HTTPie request

+
+
+
$ http GET 'https://api.fluffy.run/api/v1/auth/oauth2/callback/github?code=%7BCODE%7D&next=%7BNEXT%7D'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + +
Table 1. /api/v1/auth/oauth2/callback/{provider}
ParameterDescription

provider

OAuth2 제공자

+
+
+

Query parameters

+ ++++ + + + + + + + + + + + + + + + + +
ParameterDescription

code

인증 코드

next

리다이렉트 후 이동할 URL

+
+
+

Request body

+
+
+
+
+
+
+
+

Response body

+
+
+
+
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/server/src/main/resources/static/docs/submission.html b/server/src/main/resources/static/docs/submission.html new file mode 100644 index 0000000..3ba6035 --- /dev/null +++ b/server/src/main/resources/static/docs/submission.html @@ -0,0 +1,1091 @@ + + + + + + + +Submission API + + + + + +
+
+

Submission API

+
+
+

시험 제출 요약 목록 조회

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams/1/submissions' -i -X GET \
+    --cookie 'accessToken={ACCESS_TOKEN}'
+
+
+
+
+

HTTP request

+
+
+
GET /api/v1/exams/1/submissions HTTP/1.1
+Host: api.fluffy.run
+Cookie: accessToken={ACCESS_TOKEN}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+Content-Type: application/json
+Content-Length: 388
+
+[ {
+  "id" : 1,
+  "participant" : {
+    "id" : 1,
+    "name" : "제출자1",
+    "email" : "a@gmail.com",
+    "avatarUrl" : "https://a.com"
+  },
+  "submittedAt" : "2024-12-27T18:30:38.388297"
+}, {
+  "id" : 2,
+  "participant" : {
+    "id" : 2,
+    "name" : "제출자2",
+    "email" : "b@gmail.com",
+    "avatarUrl" : "https://b.com"
+  },
+  "submittedAt" : "2024-12-27T18:30:38.388307"
+} ]
+
+
+
+
+

HTTPie request

+
+
+
$ http GET 'https://api.fluffy.run/api/v1/exams/1/submissions' \
+    'Cookie:accessToken={ACCESS_TOKEN}'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + +
Table 1. /api/v1/exams/{examId}/submissions
ParameterDescription

examId

시험 ID

+
+
+

Request body

+
+
+
+
+
+
+
+

Response body

+
+
+
[ {
+  "id" : 1,
+  "participant" : {
+    "id" : 1,
+    "name" : "제출자1",
+    "email" : "a@gmail.com",
+    "avatarUrl" : "https://a.com"
+  },
+  "submittedAt" : "2024-12-27T18:30:38.388297"
+}, {
+  "id" : 2,
+  "participant" : {
+    "id" : 2,
+    "name" : "제출자2",
+    "email" : "b@gmail.com",
+    "avatarUrl" : "https://b.com"
+  },
+  "submittedAt" : "2024-12-27T18:30:38.388307"
+} ]
+
+
+
+
+

Response fields

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

[].id

Number

제출 ID

[].participant.id

Number

제출자 ID

[].participant.name

String

제출자 이름

[].participant.email

String

제출자 이메일

[].participant.avatarUrl

String

제출자 프로필 URL

[].submittedAt

String

제출 시각

+
+
+
+

시험 제출 상세 조회

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams/1/submissions/1' -i -X GET \
+    --cookie 'accessToken={ACCESS_TOKEN}'
+
+
+
+
+

HTTP request

+
+
+
GET /api/v1/exams/1/submissions/1 HTTP/1.1
+Host: api.fluffy.run
+Cookie: accessToken={ACCESS_TOKEN}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+Content-Type: application/json
+Content-Length: 1584
+
+{
+  "id" : 1,
+  "answers" : [ {
+    "id" : 1,
+    "questionId" : 1,
+    "text" : "질문",
+    "type" : "SHORT_ANSWER",
+    "answer" : "답",
+    "correctAnswer" : "정답"
+  }, {
+    "id" : 2,
+    "questionId" : 2,
+    "text" : "질문2",
+    "type" : "SHORT_ANSWER",
+    "answer" : "답2",
+    "correctAnswer" : "정답2"
+  }, {
+    "id" : 3,
+    "questionId" : 3,
+    "text" : "질문3",
+    "type" : "MULTIPLE_CHOICE",
+    "choices" : [ {
+      "questionOptionId" : 1,
+      "text" : "선택지1",
+      "isCorrect" : true,
+      "isSelected" : true
+    }, {
+      "questionOptionId" : 2,
+      "text" : "선택지2",
+      "isCorrect" : false,
+      "isSelected" : false
+    } ]
+  }, {
+    "id" : 4,
+    "questionId" : 4,
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "choices" : [ {
+      "questionOptionId" : 3,
+      "text" : "선택지1",
+      "isCorrect" : true,
+      "isSelected" : true
+    }, {
+      "questionOptionId" : 4,
+      "text" : "선택지2",
+      "isCorrect" : true,
+      "isSelected" : false
+    } ]
+  }, {
+    "id" : 5,
+    "questionId" : 5,
+    "text" : "질문5",
+    "type" : "SINGLE_CHOICE",
+    "choices" : [ {
+      "questionOptionId" : 5,
+      "text" : "선택지1",
+      "isCorrect" : true,
+      "isSelected" : true
+    }, {
+      "questionOptionId" : 6,
+      "text" : "선택지2",
+      "isCorrect" : false,
+      "isSelected" : false
+    } ]
+  } ],
+  "participant" : {
+    "id" : 1,
+    "name" : "제출자",
+    "email" : "a@gmail.com",
+    "avatarUrl" : "https://a.com"
+  },
+  "submittedAt" : "2024-12-27T18:30:38.372014"
+}
+
+
+
+
+

HTTPie request

+
+
+
$ http GET 'https://api.fluffy.run/api/v1/exams/1/submissions/1' \
+    'Cookie:accessToken={ACCESS_TOKEN}'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + + + + + +
Table 1. /api/v1/exams/{examId}/submissions/{submissionId}
ParameterDescription

examId

시험 ID

submissionId

제출 ID

+
+
+

Request body

+
+
+
+
+
+
+
+

Response body

+
+
+
{
+  "id" : 1,
+  "answers" : [ {
+    "id" : 1,
+    "questionId" : 1,
+    "text" : "질문",
+    "type" : "SHORT_ANSWER",
+    "answer" : "답",
+    "correctAnswer" : "정답"
+  }, {
+    "id" : 2,
+    "questionId" : 2,
+    "text" : "질문2",
+    "type" : "SHORT_ANSWER",
+    "answer" : "답2",
+    "correctAnswer" : "정답2"
+  }, {
+    "id" : 3,
+    "questionId" : 3,
+    "text" : "질문3",
+    "type" : "MULTIPLE_CHOICE",
+    "choices" : [ {
+      "questionOptionId" : 1,
+      "text" : "선택지1",
+      "isCorrect" : true,
+      "isSelected" : true
+    }, {
+      "questionOptionId" : 2,
+      "text" : "선택지2",
+      "isCorrect" : false,
+      "isSelected" : false
+    } ]
+  }, {
+    "id" : 4,
+    "questionId" : 4,
+    "text" : "질문4",
+    "type" : "MULTIPLE_CHOICE",
+    "choices" : [ {
+      "questionOptionId" : 3,
+      "text" : "선택지1",
+      "isCorrect" : true,
+      "isSelected" : true
+    }, {
+      "questionOptionId" : 4,
+      "text" : "선택지2",
+      "isCorrect" : true,
+      "isSelected" : false
+    } ]
+  }, {
+    "id" : 5,
+    "questionId" : 5,
+    "text" : "질문5",
+    "type" : "SINGLE_CHOICE",
+    "choices" : [ {
+      "questionOptionId" : 5,
+      "text" : "선택지1",
+      "isCorrect" : true,
+      "isSelected" : true
+    }, {
+      "questionOptionId" : 6,
+      "text" : "선택지2",
+      "isCorrect" : false,
+      "isSelected" : false
+    } ]
+  } ],
+  "participant" : {
+    "id" : 1,
+    "name" : "제출자",
+    "email" : "a@gmail.com",
+    "avatarUrl" : "https://a.com"
+  },
+  "submittedAt" : "2024-12-27T18:30:38.372014"
+}
+
+
+
+
+

Response fields

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PathTypeDescription

id

Number

제출 ID

answers[].id

Number

답안 ID

answers[].questionId

Number

질문 ID

answers[].text

String

질문

answers[].type

String

질문 유형

answers[].answer

String

제출한 답

answers[].correctAnswer

String

정답

answers[].choices[].questionOptionId

Number

선택지 ID

answers[].choices[].text

String

선택지

answers[].choices[].isCorrect

Boolean

정답 여부

answers[].choices[].isSelected

Boolean

선택 여부

participant.id

Number

제출자 ID

participant.name

String

제출자 이름

participant.email

String

제출자 이메일

participant.avatarUrl

String

제출자 프로필 URL

submittedAt

String

제출 시각

+
+
+
+

시험 제출

+
+

Curl request

+
+
+
$ curl 'https://api.fluffy.run/api/v1/exams/1/submissions' -i -X POST \
+    -H 'Content-Type: application/json' \
+    --cookie 'accessToken={ACCESS_TOKEN}' \
+    -d '{
+  "questionResponses" : [ {
+    "answers" : [ "답" ]
+  }, {
+    "answers" : [ "닭은 동물입니다.", "닭은 곤충입니다." ]
+  } ]
+}'
+
+
+
+
+

HTTP request

+
+
+
POST /api/v1/exams/1/submissions HTTP/1.1
+Content-Type: application/json
+Content-Length: 143
+Host: api.fluffy.run
+Cookie: accessToken={ACCESS_TOKEN}
+
+{
+  "questionResponses" : [ {
+    "answers" : [ "답" ]
+  }, {
+    "answers" : [ "닭은 동물입니다.", "닭은 곤충입니다." ]
+  } ]
+}
+
+
+
+
+

HTTP response

+
+
+
HTTP/1.1 200 OK
+Vary: Origin
+Vary: Access-Control-Request-Method
+Vary: Access-Control-Request-Headers
+
+
+
+
+

HTTPie request

+
+
+
$ echo '{
+  "questionResponses" : [ {
+    "answers" : [ "답" ]
+  }, {
+    "answers" : [ "닭은 동물입니다.", "닭은 곤충입니다." ]
+  } ]
+}' | http POST 'https://api.fluffy.run/api/v1/exams/1/submissions' \
+    'Content-Type:application/json' \
+    'Cookie:accessToken={ACCESS_TOKEN}'
+
+
+
+
+

Path parameters

+ + ++++ + + + + + + + + + + + + +
Table 1. /api/v1/exams/{examId}/submissions
ParameterDescription

examId

시험 ID

+
+
+

Request body

+
+
+
{
+  "questionResponses" : [ {
+    "answers" : [ "답" ]
+  }, {
+    "answers" : [ "닭은 동물입니다.", "닭은 곤충입니다." ]
+  } ]
+}
+
+
+
+
+

Request fields

+ +++++ + + + + + + + + + + + + + + +
PathTypeDescription

questionResponses[].answers[]

Array

답 또는 선택 옵션

+
+
+

Response body

+
+
+
+
+
+
+
+
+
+
+ + + \ No newline at end of file