{ "swagger": "2.0", "info": { "description": "Learnsteam Quiz 서비스 API", "title": "Learsteam Quiz API", "contact": { "name": "Jay Sheen", "email": "sheen@jongyeob.com" }, "version": "1.0" }, "paths": { "/auth/login": { "post": { "description": "username, password 를 입력하여 로그인", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "로그인" ], "summary": "로그인", "parameters": [ { "description": "username", "name": "username", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "비밀번호", "name": "password", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/learnsteam_learsteam-quiz-api_internal_models.LoginResponse" } } } } }, "/auth/register": { "post": { "description": "username, name, password 를 입력하여 회원가입", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "회원가입" ], "summary": "회원가입", "parameters": [ { "description": "username", "name": "username", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "이름", "name": "name", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "비밀번호", "name": "password", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/learnsteam_learsteam-quiz-api_internal_models.RegisterResponse" } } } } }, "/program": { "get": { "description": "퀴즈 프로그램 목록을 가져옵니다.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Program" ], "summary": "프로그램 목록 가져오기", "parameters": [ { "type": "string", "description": "태그", "name": "tag", "in": "query" }, { "type": "string", "description": "검색어", "name": "q", "in": "query" }, { "type": "integer", "description": "페이지", "name": "page", "in": "query" }, { "type": "integer", "description": "페이지 사이즈", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/learnsteam_learsteam-quiz-api_internal_models.ProgramListResponse" } } } }, "put": { "description": "퀴즈 프로그램을 수정합니다.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Program" ], "summary": "퀴즈 프로그램 수정", "parameters": [ { "description": "프로그램 제목", "name": "subject", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "프로그램 코스", "name": "course", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "프로그램 내용", "name": "content", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "프로그램 태그", "name": "tag", "in": "body", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "description": "프로그램 상태 on 또는 off", "name": "status", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "프로그램 발행 날짜", "name": "publish_at", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/learnsteam_learsteam-quiz-api_internal_models.ProgramResponse" } } } }, "post": { "description": "퀴즈 프로그램을 만듭니다.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Program" ], "summary": "퀴즈 프로그램 생성", "parameters": [ { "description": "프로그램 제목", "name": "subject", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "프로그램 코스", "name": "course", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "프로그램 내용", "name": "content", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "프로그램 태그", "name": "tag", "in": "body", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "description": "프로그램 상태 on 또는 off", "name": "status", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "프로그램 발행 날짜", "name": "publish_at", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/learnsteam_learsteam-quiz-api_internal_models.ProgramResponse" } } } } }, "/program/{id}": { "get": { "description": "ID로 퀴즈 프로그램을 가져옵니다.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Program" ], "summary": "퀴즈 프로그램 가져오기", "parameters": [ { "type": "string", "description": "퀴즈 프로그램 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/learnsteam_learsteam-quiz-api_internal_models.ProgramResponse" } } } } }, "/quiz": { "get": { "description": "퀴즈 목록을 가져옵니다.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Quiz" ], "summary": "퀴즈 목록 가져오기", "parameters": [ { "type": "string", "description": "프로그램 ID", "name": "program_id", "in": "query", "required": true }, { "type": "string", "description": "검색어", "name": "q", "in": "query" }, { "type": "integer", "description": "페이지", "name": "page", "in": "query" }, { "type": "integer", "description": "페이지 사이즈", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/learnsteam_learsteam-quiz-api_internal_models.QuizListResponse" } } } }, "put": { "description": "퀴즈를 수정합니다.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Quiz" ], "summary": "퀴즈 수정", "parameters": [ { "type": "string", "description": "퀴즈 ID", "name": "id", "in": "path", "required": true }, { "description": "프로그램 ID", "name": "program_id", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "퀴즈 순서", "name": "sequence", "in": "body", "required": true, "schema": { "type": "integer" } }, { "description": "퀴즈 타입 : choice, check, ox, input", "name": "quiz_type", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "퀴즈 문제", "name": "question", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "퀴즈 선택지 : ['선택1','선택2','선택3', '선택4']", "name": "choice", "in": "body", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "description": "퀴즈 정답 : [1,3]", "name": "answer", "in": "body", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "description": "퀴즈 힌트", "name": "hint", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "퀴즈 해설", "name": "comment", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/learnsteam_learsteam-quiz-api_internal_models.QuizResponse" } } } }, "post": { "description": "퀴즈를 만듭니다.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Quiz" ], "summary": "퀴즈 생성", "parameters": [ { "description": "프로그램 ID", "name": "program_id", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "퀴즈 순서", "name": "sequence", "in": "body", "required": true, "schema": { "type": "integer" } }, { "description": "퀴즈 타입 : choice, check, ox, input", "name": "quiz_type", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "퀴즈 문제", "name": "question", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "퀴즈 선택지 : ['선택1','선택2','선택3', '선택4']", "name": "choice", "in": "body", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "description": "퀴즈 정답 : [1,3]", "name": "answer", "in": "body", "required": true, "schema": { "type": "array", "items": { "type": "string" } } }, { "description": "퀴즈 힌트", "name": "hint", "in": "body", "required": true, "schema": { "type": "string" } }, { "description": "퀴즈 해설", "name": "comment", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/learnsteam_learsteam-quiz-api_internal_models.QuizResponse" } } } } }, "/quiz/{id}": { "get": { "description": "ID로 퀴즈를 가져옵니다.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Quiz" ], "summary": "퀴즈 가져오기", "parameters": [ { "type": "string", "description": "퀴즈 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/learnsteam_learsteam-quiz-api_internal_models.QuizResponse" } } } } }, "/token/refresh": { "post": { "description": "AccessToken을 RefreshToken으로 갱신합니다.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Token" ], "summary": "AccessToken Refresh", "parameters": [ { "description": "RefreshToken", "name": "refresh_token", "in": "body", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/learnsteam_learsteam-quiz-api_internal_models.ProgramResponse" } } } } }, "/user": { "get": { "description": "사용자 목록을 가져옵니다.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "사용자 목록 가져오기", "parameters": [ { "type": "string", "description": "검색어", "name": "q", "in": "query" }, { "type": "integer", "description": "페이지", "name": "page", "in": "query" }, { "type": "integer", "description": "페이지 사이즈", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/learnsteam_learsteam-quiz-api_internal_models.UserListResponse" } } } } }, "/user/{id}": { "get": { "description": "ID로 사용자 정보를 가져옵니다.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "User" ], "summary": "사용자 정보 가져오기", "parameters": [ { "type": "string", "description": "사용자 ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/learnsteam_learsteam-quiz-api_internal_models.User" } } } } } }, "definitions": { "learnsteam_learsteam-quiz-api_internal_models.LoginResponse": { "type": "object", "properties": { "refresh_token": { "type": "string", "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRob3JpemVkIjp0cnVlLCJleHAiOjE3MDc4OTcwMjcs" }, "token": { "type": "string", "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRob3JpemVkIjp0cnVlLCJleHAiOjE3MDI3MTMwMjcsInN1" }, "user": { "$ref": "#/definitions/learnsteam_learsteam-quiz-api_internal_models.User" } } }, "learnsteam_learsteam-quiz-api_internal_models.Program": { "type": "object", "properties": { "content": { "type": "string", "example": "코스 설명" }, "course": { "type": "string", "example": "코스 이름" }, "id": { "type": "string", "example": "ef74c59a-c707-4162-a52b-455906c81ec1" }, "publish_at": { "type": "string", "example": "2023-11-10T00:00:00+09:00" }, "status": { "type": "string", "example": "on" }, "subject": { "type": "string", "example": "프로그램 제목" }, "tag": { "type": "array", "items": { "type": "integer" } } } }, "learnsteam_learsteam-quiz-api_internal_models.ProgramListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/learnsteam_learsteam-quiz-api_internal_models.Program" } }, "page": { "type": "integer", "example": 1 }, "pageSize": { "type": "integer", "example": 10 }, "total": { "type": "integer", "example": 999 }, "totalPage": { "type": "integer", "example": 99 } } }, "learnsteam_learsteam-quiz-api_internal_models.ProgramResponse": { "type": "object", "properties": { "content": { "type": "string", "example": "코스 설명" }, "course": { "type": "string", "example": "코스 이름" }, "id": { "type": "string", "example": "ef74c59a-c707-4162-a52b-455906c81ec1" }, "publish_at": { "type": "string", "example": "2023-11-10T00:00:00+09:00" }, "status": { "type": "string", "example": "on" }, "subject": { "type": "string", "example": "프로그램 제목" }, "tag": { "type": "array", "items": { "type": "string" }, "example": [ "tag1", "tag2" ] } } }, "learnsteam_learsteam-quiz-api_internal_models.Quiz": { "type": "object", "properties": { "answer": { "type": "array", "items": { "type": "integer" } }, "choice": { "type": "array", "items": { "type": "integer" } }, "comment": { "type": "string", "example": "퀴즈 해설" }, "hint": { "type": "string", "example": "퀴즈 힌트" }, "id": { "type": "string", "example": "1b066168-68c4-4b50-bc9a-b6c4fceaf378" }, "program_id": { "type": "string", "example": "2036023a-fb56-4b6c-b3bb-c787c681ada6" }, "question": { "type": "string", "example": "퀴즈 질문입니다." }, "quiz_type": { "type": "string", "example": "choice" }, "sequence": { "type": "integer", "example": 5 } } }, "learnsteam_learsteam-quiz-api_internal_models.QuizListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/learnsteam_learsteam-quiz-api_internal_models.Quiz" } }, "page": { "type": "integer", "example": 1 }, "pageSize": { "type": "integer", "example": 10 }, "total": { "type": "integer", "example": 5 }, "totalPage": { "type": "integer", "example": 1 } } }, "learnsteam_learsteam-quiz-api_internal_models.QuizResponse": { "type": "object", "properties": { "answer": { "type": "array", "items": { "type": "integer" } }, "choice": { "type": "array", "items": { "type": "integer" } }, "comment": { "type": "string", "example": "퀴즈 해설" }, "hint": { "type": "string", "example": "퀴즈 힌트" }, "id": { "type": "string", "example": "1b066168-68c4-4b50-bc9a-b6c4fceaf378" }, "program_id": { "type": "string", "example": "2036023a-fb56-4b6c-b3bb-c787c681ada6" }, "question": { "type": "string", "example": "퀴즈 질문입니다." }, "quiz_type": { "type": "string", "example": "check" }, "sequence": { "type": "integer", "example": 5 } } }, "learnsteam_learsteam-quiz-api_internal_models.RegisterResponse": { "type": "object", "properties": { "refresh_token": { "type": "string", "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRob3JpemVkIjp0cnVlLCJleHAiOjE3MDc4OTcwMjcs" }, "token": { "type": "string", "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRob3JpemVkIjp0cnVlLCJleHAiOjE3MDI3MTMwMjcsInN1" }, "user": { "$ref": "#/definitions/learnsteam_learsteam-quiz-api_internal_models.User" } } }, "learnsteam_learsteam-quiz-api_internal_models.User": { "type": "object", "properties": { "id": { "type": "string", "example": "137c1683-2ad6-4201-b256-253828b61c49" }, "name": { "type": "string", "example": "홍길동" }, "score": { "type": "integer", "example": 9999 }, "username": { "type": "string", "example": "user0" } } }, "learnsteam_learsteam-quiz-api_internal_models.UserListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/learnsteam_learsteam-quiz-api_internal_models.User" } }, "page": { "type": "integer", "example": 1 }, "pageSize": { "type": "integer", "example": 10 }, "total": { "type": "integer", "example": 90 }, "totalPage": { "type": "integer", "example": 9 } } } } }