1. 회원
1.1. 회원가입
1.1.1. 성공
HTTP request
POST /api/v1/member HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 63
Host: localhost:8080
{
"username" : "Hong-Gildong",
"password" : "password"
}
HTTP response
HTTP/1.1 201 Created
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Location: http://localhost:8080/api/v1/member/1
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 362
{
"msg" : "회원 가입이 완료되었습니다.",
"id" : 1,
"username" : "Hong-Gildong",
"password" : "password",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/member",
"type" : "POST"
},
"login" : {
"href" : "http://localhost:8080/api/v1/member/login",
"type" : "POST"
}
}
}
Request fields
Request Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
회원가입을 위한 회원 ID |
|
|
회원가입을 위한 회원 Password |
Response fields
Response Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
응답 메시지 |
|
|
회원가입이 완료된 회원 ID |
|
|
회원가입이 완료된 회원 username |
|
|
회원가입이 완료된 회원 Encoding Password |
|
|
Hyper Links |
|
|
Hyper Link 이름 |
|
|
Self Hyper Link |
|
|
Self Hyper Link Type |
|
|
Hyper Link 이름 |
|
|
Login Hyper Link |
|
|
Login Hyper Link Type |
1.1.2. 실패
중복된 회원의 username일 경우
HTTP request
POST /api/v1/member HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 63
Host: localhost:8080
{
"username" : "Hong-Gildong",
"password" : "password"
}
HTTP response
HTTP/1.1 409 Conflict
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 165
{
"timeStamp" : "2023-10-16T07:23:09.776+00:00",
"httpStatus" : "CONFLICT",
"errorCode" : 409,
"msg" : "Hong-Gildong회원님은 이미 있습니다."
}
Response fields
Response Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
API 요청 시간 |
|
|
HTTP 상태 메시지 |
|
|
HTTP 에러 코드 |
|
|
응답 메시지 |
1.2. 로그인
1.2.1. 성공
HTTP request
POST /api/v1/member/login HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 63
Host: localhost:8080
{
"username" : "Hong-Gildong",
"password" : "password"
}
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 136
{
"msg" : "로그인이 완료되었습니다.",
"accessToken" : "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VybmNhQ5uHZELuMKK_1O_Wcd9lx0aggkg"
}
Request fields
Request Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
로그인을 위한 회원 ID |
|
|
로그인을 위한 회원 Password |
Response fields
Response Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
응답 메시지 |
|
|
회원의 AccessToken |
1.2.2. 실패
password가 회원가입 정보와 맞지 않을경우
HTTP request
POST /api/v1/member/login HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 63
Host: localhost:8080
{
"username" : "Hong-Gildong",
"password" : "password"
}
HTTP response
HTTP/1.1 401 Unauthorized
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 166
{
"timeStamp" : "2023-10-16T07:23:09.698+00:00",
"httpStatus" : "UNAUTHORIZED",
"errorCode" : 401,
"msg" : "패스워드를 잘못 입력했습니다."
}
Response fields
Response Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
API 요청 시간 |
|
|
HTTP 상태 메시지 |
|
|
HTTP 에러 코드 |
|
|
응답 메시지 |
회원가입을한 username이 아닐 경우
HTTP request
POST /api/v1/member/login HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 63
Host: localhost:8080
{
"username" : "Hong-Gildong",
"password" : "password"
}
HTTP response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 163
{
"timeStamp" : "2023-10-16T07:23:09.674+00:00",
"httpStatus" : "BAD_REQUEST",
"errorCode" : 400,
"msg" : "Hong-Gildong회원이(가) 없습니다."
}
Response fields
Response Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
API 요청 시간 |
|
|
HTTP 상태 메시지 |
|
|
HTTP 에러 코드 |
|
|
응답 메시지 |
1.3. 회원조회(ID)
1.3.1. 성공
HTTP request
GET /api/v1/member/1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 63
Host: localhost:8080
{
"username" : "Hong-Gildong",
"password" : "password"
}
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 269
{
"msg" : "검색한 회원의 정보는 다음과 같습니다.",
"id" : 1,
"username" : "Hong-Gildong",
"memberMyWordList" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/member/1",
"type" : "GET"
}
}
}
Request fields
Request Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
회원가입을 위한 회원 ID |
|
|
회원가입을 위한 회원 Password |
Response fields
Response Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
응답 메시지 |
|
|
검색한 회원의 ID |
|
|
검색한 회원의 username |
|
|
회원이 저장한 단어의 정보 |
|
|
Hyper Links |
|
|
Hyper Link 이름 |
|
|
Self Hyper Link |
|
|
Self Hyper Link Type |
2. 단어사전
2.1. 한국어대사전 기반 검색
2.1.1. 성공
HTTP request
GET /api/v1/dictionary/word?q=%EC%82%AC%EB%9E%91 HTTP/1.1
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 734
{
"msg" : "표준 한국어 대사전 Open API를 통해 단어 하늘의 검색결과는 다음과 같습니다.",
"datum" : [ {
"targetCode" : 20311,
"word" : "하늘",
"pronunciation" : "하늘",
"pos" : "명사",
"wordSenceList" : [ {
"senseOrder" : 1,
"definition" : "땅 위로 펼쳐진 무한히 넓은 공간."
}, {
"senseOrder" : 2,
"definition" : "절대적인 존재, 하느님."
} ]
} ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/dictionary/word?q=%EC%82%AC%EB%9E%91",
"type" : "GET"
},
"add-myWord" : {
"href" : "http://localhost:8080/api/v1/myWord",
"type" : "POST"
}
}
}
Request parameters
| Parameter | Description |
|---|---|
|
찾고자 하는 단어 |
Response fields
Response Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
응답 메시지 |
|
|
한국어 대사전으로 찾은 동음 이의어들의 집합 |
|
|
찾고자 하는 단어의 한국어 대사전 TargetCode |
|
|
찾고자 하는 단어 |
|
|
찾고자 하는 단어의 발음 |
|
|
찾고자 하는 단어의 품사 |
|
|
해당 단어의 뜻 |
|
|
해당 단어의 뜻 순서 |
|
|
해당 단어의 뜻 |
|
|
Hyper Links |
|
|
Hyper Link 이름 |
|
|
Self Hyper Link |
|
|
Self Hyper Link Type |
|
|
Hyper Link 이름 |
|
|
Add-MyWord Hyper Link |
|
|
Add-MyWord Hyper Link Type |
2.1.2. 실패
파라미터가 누락 되었을 경우
operation::Dictionary-word-5xxsnippets='http-request,http-response,response-fields']
3. 나만의 단어장
3.1. 나만의 단어장에 추가
3.1.1. 성공
HTTP request
POST /api/v1/myWord HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VybmNhQ5uHZELuMKK_1O_Wcd9lx0aggkg
Content-Length: 73
Host: localhost:8080
{
"name" : "단어",
"morpheme" : "품사",
"mean" : "의미"
}
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 548
{
"msg" : "단어이름 단어 추가가 성공하였습니다.",
"data" : {
"wordId" : 1,
"name" : "단어",
"morpheme" : "품사",
"mean" : "의미"
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/myWord",
"type" : "POST"
},
"delete-myWord" : {
"href" : "http://localhost:8080/api/v1/myWord/1",
"type" : "DELETE"
},
"search-myWord" : {
"href" : "http://localhost:8080/api/v1/myWord?page=0&count=10",
"type" : "GET"
}
}
}
Request headers
| Name | Description |
|---|---|
|
JWT Access 토큰 |
Request fields
Request Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
저장을 요청한 단어 |
|
|
저장을 요청한 단어의 품사 |
|
|
저장을 요청한 단어의 의미 |
Response fields
Response Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
응답 메시지 |
|
|
저장을 요청한 단어의 정보 |
|
|
저장을 요청한 단어의 ID |
|
|
저장을 요청한 단어 |
|
|
저장을 요청한 단어의 품사 |
|
|
저장을 요청한 단어의 의미 |
|
|
Hyper Links |
|
|
Hyper Link 이름 |
|
|
Self Hyper Link |
|
|
Self Hyper Link Type |
|
|
Hyper Link 이름 |
|
|
Delete-MyWord Hyper Link |
|
|
Delete-MyWord Hyper Link Type |
|
|
Hyper Link 이름 |
|
|
Search-MyWord Hyper Link |
|
|
Search-MyWord Hyper Link Type |
3.1.2. 실패
한 회원이 중복된 단어를 저장했을 경우
HTTP request
POST /api/v1/myWord HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VybmNhQ5uHZELuMKK_1O_Wcd9lx0aggkg
Content-Length: 73
Host: localhost:8080
{
"name" : "단어",
"morpheme" : "품사",
"mean" : "의미"
}
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 564
{
"msg" : " 단어 추가가 실패하였습니다.(이미 단어장에 존재)",
"data" : {
"wordId" : 1,
"name" : "단어",
"morpheme" : "품사",
"mean" : "의미"
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/myWord",
"type" : "POST"
},
"delete-myWord" : {
"href" : "http://localhost:8080/api/v1/myWord/1",
"type" : "DELETE"
},
"search-myWord" : {
"href" : "http://localhost:8080/api/v1/myWord?page=0&count=10",
"type" : "GET"
}
}
}
Response fields
Response Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
응답 메시지 |
|
|
저장을 요청한 단어의 정보 |
|
|
저장을 요청한 단어의 ID |
|
|
저장을 요청한 단어 |
|
|
저장을 요청한 단어의 품사 |
|
|
저장을 요청한 단어의 의미 |
|
|
Hyper Links |
|
|
Hyper Link 이름 |
|
|
Self Hyper Link |
|
|
Self Hyper Link Type |
|
|
Hyper Link 이름 |
|
|
Delete-MyWord Hyper Link |
|
|
Delete-MyWord Hyper Link Type |
|
|
Hyper Link 이름 |
|
|
Search-MyWord Hyper Link |
|
|
Search-MyWord Hyper Link Type |
Header에 AccessToken을 넣지 않았을 경우
HTTP request
POST /api/v1/myWord HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 73
Host: localhost:8080
{
"name" : "단어",
"morpheme" : "품사",
"mean" : "의미"
}
HTTP response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 170
{
"timeStamp" : "2023-10-16T07:23:09.919+00:00",
"httpStatus" : "BAD_REQUEST",
"errorCode" : 400,
"msg" : "올바른 요청 Header 형식이 아닙니다."
}
Response fields
Response Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
API 요청 시간 |
|
|
HTTP 상태 메시지 |
|
|
HTTP 에러 코드 |
|
|
응답 메시지 |
3.2. 나만의 단어장에서 삭제
3.2.1. 성공
HTTP request
DELETE /api/v1/myWord/1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VybmNhQ5uHZELuMKK_1O_Wcd9lx0aggkg
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 432
{
"msg" : "1번의 단어 삭제를 성공하였습니다.",
"data" : {
"wordId" : 1,
"name" : "단어",
"morpheme" : "품사",
"mean" : "의미"
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/myWord/1",
"type" : "DELETE"
},
"search-myWord" : {
"href" : "http://localhost:8080/api/v1/myWord?page=0&count=10",
"type" : "GET"
}
}
}
Request headers
| Name | Description |
|---|---|
|
JWT Access 토큰 |
Response fields
Response Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
응답 메시지 |
|
|
삭제를 요청한 단어의 정보 |
|
|
삭제를 요청한 단어의 ID |
|
|
삭제를 요청한 단어 |
|
|
삭제를 요청한 단어의 품사 |
|
|
Hyper Links |
|
|
Hyper Link 이름 |
|
|
Self Hyper Link |
|
|
Self Hyper Link Type |
|
|
Hyper Link 이름 |
|
|
Search-MyWord Hyper Link |
|
|
Search-MyWord Hyper Link Type |
3.2.2. 실패
삭제를 요청하는 단어의 ID가 단어장에 없을 경우
HTTP request
Snippet http-request not found for operation::MyWord-delete-fail
HTTP response
Snippet http-response not found for operation::MyWord-delete-fail
Response fields
Snippet response-fields not found for operation::MyWord-delete-fail
3.3. 나만의 단어장에서 검색
3.3.1. 성공
HTTP request
GET /api/v1/myWord?page=0&count=10 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VybmNhQ5uHZELuMKK_1O_Wcd9lx0aggkg
Content-Length: 41
Host: localhost:8080
{
"name" : "2",
"morpheme" : "2"
}
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 670
{
"msg" : "나만의 단어 검색 결과는 다음과 같습니다.",
"datum" : {
"content" : [ {
"wordId" : 1,
"name" : "단어",
"morpheme" : "품사",
"mean" : "의미"
} ],
"pageable" : "INSTANCE",
"totalElements" : 1,
"last" : true,
"totalPages" : 1,
"size" : 1,
"number" : 0,
"sort" : {
"empty" : true,
"sorted" : false,
"unsorted" : true
},
"first" : true,
"numberOfElements" : 1,
"empty" : false
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/myWord?page=0&count=10",
"type" : "GET"
}
}
}
Request headers
| Name | Description |
|---|---|
|
JWT Access 토큰 |
Request parameters
| Parameter | Description |
|---|---|
|
0부터 시작하는 페이지 index |
|
페이지당 데이터의 수 |
Request fields
Request Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
검색을 요청한 단어 |
|
|
검색 요청한 단어의 품사 |
Response fields
Response Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
응답 메시지 |
|
|
조회 결과 데이터 |
|
|
조회된 단어 리스트 |
|
|
검색된 단어의 ID |
|
|
검색된 단어의 이름 |
|
|
검색된 단어의 형태소 |
|
|
검색된 단어의 의미 |
|
|
Hyper Links |
|
|
Hyper Link 이름 |
|
|
Self Hyper Link |
|
|
Self Hyper Link Type |
4. 퀴즈
4.1. 퀴즈 목록 생성
4.1.1. 성공
HTTP request
GET /api/v1/quiz HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 1623
{
"msg" : "나만의 단어장을 기반으로 생성된 퀴즈입니다.",
"datum" : [ {
"question" : "의미4",
"answerIndex" : 1,
"choices" : [ "단어4", "단어5", "단어6", "단어7" ]
}, {
"question" : "의미8",
"answerIndex" : 1,
"choices" : [ "단어8", "단어9", "단어10", "단어11" ]
}, {
"question" : "의미12",
"answerIndex" : 1,
"choices" : [ "단어12", "단어13", "단어14", "단어15" ]
}, {
"question" : "의미16",
"answerIndex" : 1,
"choices" : [ "단어16", "단어17", "단어18", "단어19" ]
}, {
"question" : "의미20",
"answerIndex" : 1,
"choices" : [ "단어20", "단어21", "단어22", "단어23" ]
}, {
"question" : "의미24",
"answerIndex" : 1,
"choices" : [ "단어24", "단어25", "단어26", "단어27" ]
}, {
"question" : "의미28",
"answerIndex" : 1,
"choices" : [ "단어28", "단어29", "단어30", "단어31" ]
}, {
"question" : "의미32",
"answerIndex" : 1,
"choices" : [ "단어32", "단어33", "단어34", "단어35" ]
}, {
"question" : "의미36",
"answerIndex" : 1,
"choices" : [ "단어36", "단어37", "단어38", "단어39" ]
}, {
"question" : "의미40",
"answerIndex" : 1,
"choices" : [ "단어40", "단어41", "단어42", "단어43" ]
} ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/quiz",
"type" : "GET"
},
"apply-quiz-result" : {
"href" : "http://localhost:8080/api/v1/quiz",
"type" : "PATCH"
}
}
}
Response fields
Response Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
응답 메시지 |
|
|
10개의 4지선다 단어 퀴즈 |
|
|
퀴즈 문제 |
|
|
퀴즈의 정답 Index (1~4) |
|
|
퀴즈의 선택지 |
|
|
Hyper Links |
|
|
Hyper Link 이름 |
|
|
Self Hyper Link |
|
|
Self Hyper Link Type |
|
|
Hyper Link 이름 |
|
|
Apply-Quiz-Result Hyper Link |
|
|
Apply-Quiz-Result Hyper Link Type |
4.1.2. 실패
퀴즈를 만들기에 충분한 나만의 단어가 DB에 없을경우 (최소 40개)
HTTP request
GET /api/v1/quiz HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: localhost:8080
HTTP response
HTTP/1.1 500 Internal Server Error
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 189
{
"timeStamp" : "2023-10-16T07:23:10.008+00:00",
"httpStatus" : "INTERNAL_SERVER_ERROR",
"errorCode" : 500,
"msg" : "퀴즈를 만들기에 충분한 단어가 없습니다."
}
Response fields
Response Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
API 요청 시간 |
|
|
HTTP 상태 메시지 |
|
|
HTTP 에러 코드 |
|
|
응답 메시지 |
4.2. 퀴즈 결과 반영
4.2.1. 성공
HTTP request
PATCH /api/v1/quiz HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VybmNhQ5uHZELuMKK_1O_Wcd9lx0aggkg
Content-Length: 19
Host: localhost:8080
{
"score" : 5
}
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 332
{
"msg" : "퀴즈 결과가 반영되었습니다.",
"ranking" : 1,
"score" : 5,
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/quiz",
"type" : "PATCH"
},
"get-quiz-ranking" : {
"href" : "http://localhost:8080/api/v1/quiz/ranking",
"type" : "GET"
}
}
}
Request headers
| Name | Description |
|---|---|
|
JWT Access 토큰 |
Request fields
Request Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
퀴즈 결과 점수 |
Response fields
Response Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
응답 메시지 |
|
|
점수가 적용된 회원의 랭킹 |
|
|
회원의 최종 점수 |
|
|
Hyper Links |
|
|
Hyper Link 이름 |
|
|
Self Hyper Link |
|
|
Self Hyper Link Type |
|
|
Hyper Link 이름 |
|
|
Get-Quiz-Ranking Hyper Link |
|
|
Get-Quiz-Ranking Hyper Link Type |
4.2.2. 실패
body의 형식이 문자형일 경우
HTTP request
PATCH /api/v1/quiz HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VybmNhQ5uHZELuMKK_1O_Wcd9lx0aggkg
Content-Length: 23
Host: localhost:8080
{
"score" : "asd"
}
HTTP response
HTTP/1.1 500 Internal Server Error
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 175
{
"timeStamp" : "2023-10-16T07:23:10.075+00:00",
"httpStatus" : "INTERNAL_SERVER_ERROR",
"errorCode" : 500,
"msg" : "서버에서 에러가 발생했습니다."
}
Response fields
Response Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
API 요청 시간 |
|
|
HTTP 상태 메시지 |
|
|
HTTP 에러 코드 |
|
|
응답 메시지 |
5. 랭킹
5.1. 퀴즈 랭킹 출력 (비회원)
5.1.1. 성공
HTTP request
GET /api/v1/quiz/ranking/nonMember HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 526
{
"msg" : "퀴즈 랭킹 결과입니다.",
"topMemberRanking" : [ {
"ranking" : 1,
"username" : "1번 사람",
"score" : 9
}, {
"ranking" : 2,
"username" : "2번 사람",
"score" : 8
}, {
"ranking" : 3,
"username" : "3번 사람",
"score" : 7
}, {
"ranking" : 4,
"username" : "4번 사람",
"score" : 6
} ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/quiz/ranking/nonMember",
"type" : "GET"
}
}
}
Response fields
Response Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
응답 메시지 |
|
|
퀴즈 점수 상위 랭커 10명의 정보 (같은 점수라면 가입 순으로 정렬) |
|
|
랭커의 순위 |
|
|
랭커의 이름 |
|
|
랭커의 점수 |
|
|
Hyper Links |
|
|
Hyper Link 이름 |
|
|
Self Hyper Link |
|
|
Self Hyper Link Type |
5.2. 퀴즈 랭킹 출력 (회원)
5.2.1. 성공
HTTP request
GET /api/v1/quiz/ranking HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VybmNhQ5uHZELuMKK_1O_Wcd9lx0aggkg
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 589
{
"msg" : "퀴즈 랭킹 결과입니다.",
"userRanking" : 1,
"username" : "1번 사람",
"userScore" : 9,
"topMemberRanking" : [ {
"ranking" : 1,
"username" : "1번 사람",
"score" : 9
}, {
"ranking" : 2,
"username" : "2번 사람",
"score" : 8
}, {
"ranking" : 3,
"username" : "3번 사람",
"score" : 7
}, {
"ranking" : 4,
"username" : "4번 사람",
"score" : 6
} ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/quiz/ranking",
"type" : "GET"
}
}
}
Request headers
| Name | Description |
|---|---|
|
JWT Access 토큰 |
Response fields
Response Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
응답 메시지 |
|
|
로그인한 회원의 랭킹 |
|
|
로그인한 회원의 이름 |
|
|
로그인한 회원의 점수 |
|
|
퀴즈 점수 상위 랭커 10명의 정보 (같은 점수라면 가입 순으로 정렬) |
|
|
랭커의 순위 |
|
|
랭커의 이름 |
|
|
랭커의 점수 |
|
|
Hyper Links |
|
|
Hyper Link 이름 |
|
|
Self Hyper Link |
|
|
Self Hyper Link Type |
6. 오늘의 단어
6.1. 오늘의 단어 출력
6.1.1. 성공
HTTP request
GET /api/v1/todayWord HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 497
{
"msg" : "오늘의 단어 목록입니다.",
"datum" : [ {
"name" : "1번 단어",
"morpheme" : "1번 품사",
"mean" : "1번 의미"
}, {
"name" : "2번 단어",
"morpheme" : "2번 품사",
"mean" : "2번 의미"
} ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/v1/todayWord",
"type" : "GET"
},
"add-myWord" : {
"href" : "http://localhost:8080/api/v1/myWord",
"type" : "POST"
}
}
}
Response fields
Response Fields
| 필드명 | 타입 | 설명 |
|---|---|---|
|
|
응답 메시지 |
|
|
나만의 단어장을 기반으로 생성된 오늘의 단어 (24시, 자정 초기화) |
|
|
오늘의 단어 |
|
|
오늘의 단어 품사 |
|
|
오늘의 단어 의미 |
|
|
Hyper Links |
|
|
Hyper Link 이름 |
|
|
Self Hyper Link |
|
|
Self Hyper Link Type |
|
|
Hyper Link 이름 |
|
|
Add-MyWord Hyper Link |
|
|
Add-MyWord Hyper Link Type |