diff --git a/docs/docs.go b/docs/docs.go index b2dcf40..073e6cd 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -438,7 +438,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/learnsteam_cslms-api_internal_models.UserQuizListResponse" + "$ref": "#/definitions/learnsteam_cslms-api_internal_models.PaperQuizListResponse" } } } @@ -482,7 +482,7 @@ const docTemplate = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/learnsteam_cslms-api_internal_models.UserQuizResponse" + "$ref": "#/definitions/learnsteam_cslms-api_internal_models.PaperQuizResponse" } } } @@ -1749,6 +1749,89 @@ const docTemplate = `{ } } }, + "learnsteam_cslms-api_internal_models.PaperQuizListResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/learnsteam_cslms-api_internal_models.UserQuizResponse" + } + }, + "page": { + "type": "integer", + "example": 1 + }, + "pageSize": { + "type": "integer", + "example": 10 + }, + "total": { + "type": "integer", + "example": 5 + }, + "totalPage": { + "type": "integer", + "example": 1 + } + } + }, + "learnsteam_cslms-api_internal_models.PaperQuizResponse": { + "type": "object", + "properties": { + "center_id": { + "type": "string", + "example": "2036023a-fb56-4b6c-b3bb-c787c681ada6" + }, + "content": { + "$ref": "#/definitions/learnsteam_cslms-api_internal_models.QuizContent" + }, + "guid_id": { + "type": "string", + "example": "2036023a-fb56-4b6c-b3bb-c787c681ada6" + }, + "id": { + "type": "integer", + "example": 1000001 + }, + "question": { + "type": "string", + "example": "퀴즈 질문입니다." + }, + "question_type": { + "type": "string", + "example": "check" + }, + "quiz_id": { + "type": "integer", + "example": 1000001 + }, + "result": { + "type": "string", + "example": "success" + }, + "score": { + "type": "number", + "example": 10 + }, + "status": { + "type": "string", + "example": "waiting" + }, + "user_id": { + "type": "integer", + "example": 1000001 + }, + "user_quiz_paper_id": { + "type": "integer", + "example": 1000001 + }, + "vol_no": { + "type": "integer", + "example": 5 + } + } + }, "learnsteam_cslms-api_internal_models.PaperResponse": { "type": "object", "properties": { diff --git a/docs/swagger.json b/docs/swagger.json index a03fa05..f61af10 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -430,7 +430,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/learnsteam_cslms-api_internal_models.UserQuizListResponse" + "$ref": "#/definitions/learnsteam_cslms-api_internal_models.PaperQuizListResponse" } } } @@ -474,7 +474,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/learnsteam_cslms-api_internal_models.UserQuizResponse" + "$ref": "#/definitions/learnsteam_cslms-api_internal_models.PaperQuizResponse" } } } @@ -1741,6 +1741,89 @@ } } }, + "learnsteam_cslms-api_internal_models.PaperQuizListResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/learnsteam_cslms-api_internal_models.UserQuizResponse" + } + }, + "page": { + "type": "integer", + "example": 1 + }, + "pageSize": { + "type": "integer", + "example": 10 + }, + "total": { + "type": "integer", + "example": 5 + }, + "totalPage": { + "type": "integer", + "example": 1 + } + } + }, + "learnsteam_cslms-api_internal_models.PaperQuizResponse": { + "type": "object", + "properties": { + "center_id": { + "type": "string", + "example": "2036023a-fb56-4b6c-b3bb-c787c681ada6" + }, + "content": { + "$ref": "#/definitions/learnsteam_cslms-api_internal_models.QuizContent" + }, + "guid_id": { + "type": "string", + "example": "2036023a-fb56-4b6c-b3bb-c787c681ada6" + }, + "id": { + "type": "integer", + "example": 1000001 + }, + "question": { + "type": "string", + "example": "퀴즈 질문입니다." + }, + "question_type": { + "type": "string", + "example": "check" + }, + "quiz_id": { + "type": "integer", + "example": 1000001 + }, + "result": { + "type": "string", + "example": "success" + }, + "score": { + "type": "number", + "example": 10 + }, + "status": { + "type": "string", + "example": "waiting" + }, + "user_id": { + "type": "integer", + "example": 1000001 + }, + "user_quiz_paper_id": { + "type": "integer", + "example": 1000001 + }, + "vol_no": { + "type": "integer", + "example": 5 + } + } + }, "learnsteam_cslms-api_internal_models.PaperResponse": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 028cb45..78bc757 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -152,6 +152,66 @@ definitions: example: 99 type: integer type: object + learnsteam_cslms-api_internal_models.PaperQuizListResponse: + properties: + data: + items: + $ref: '#/definitions/learnsteam_cslms-api_internal_models.UserQuizResponse' + type: array + page: + example: 1 + type: integer + pageSize: + example: 10 + type: integer + total: + example: 5 + type: integer + totalPage: + example: 1 + type: integer + type: object + learnsteam_cslms-api_internal_models.PaperQuizResponse: + properties: + center_id: + example: 2036023a-fb56-4b6c-b3bb-c787c681ada6 + type: string + content: + $ref: '#/definitions/learnsteam_cslms-api_internal_models.QuizContent' + guid_id: + example: 2036023a-fb56-4b6c-b3bb-c787c681ada6 + type: string + id: + example: 1000001 + type: integer + question: + example: 퀴즈 질문입니다. + type: string + question_type: + example: check + type: string + quiz_id: + example: 1000001 + type: integer + result: + example: success + type: string + score: + example: 10 + type: number + status: + example: waiting + type: string + user_id: + example: 1000001 + type: integer + user_quiz_paper_id: + example: 1000001 + type: integer + vol_no: + example: 5 + type: integer + type: object learnsteam_cslms-api_internal_models.PaperResponse: properties: category: @@ -1092,7 +1152,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/learnsteam_cslms-api_internal_models.UserQuizListResponse' + $ref: '#/definitions/learnsteam_cslms-api_internal_models.PaperQuizListResponse' security: - Bearer: [] summary: 퀴즈페이퍼 퀴즈 목록 가져오기 @@ -1120,7 +1180,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/learnsteam_cslms-api_internal_models.UserQuizResponse' + $ref: '#/definitions/learnsteam_cslms-api_internal_models.PaperQuizResponse' security: - Bearer: [] summary: 퀴즈페이퍼 퀴즈 가져오기 diff --git a/go.mod b/go.mod index 733851a..7aad714 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module learnsteam/cslms-api -go 1.22 +go 1.21 require ( github.com/apex/gateway v1.1.2 diff --git a/internal/controllers/paper.go b/internal/controllers/paper.go index d7eb8c6..200f3ed 100644 --- a/internal/controllers/paper.go +++ b/internal/controllers/paper.go @@ -246,7 +246,7 @@ func (controller *paperController) Finish(c *gin.Context) { // @Param page query int false "페이지" // @Param limit query int false "페이지 사이즈" // -// @Success 200 {object} models.UserQuizListResponse +// @Success 200 {object} models.PaperQuizListResponse // @Router /paper/{paper_id}/quiz [get] func (controller *paperController) QuizList(c *gin.Context) { paper_id, err := strconv.ParseInt(c.Param("paper_id"), 10, 64) @@ -299,7 +299,7 @@ func (controller *paperController) QuizList(c *gin.Context) { // @Param paper_id path string true "Paper ID" // @Param quiz_id path string true "사용자퀴즈 ID" // -// @Success 200 {object} models.UserQuizResponse +// @Success 200 {object} models.PaperQuizResponse // @Router /paper/{paper_id}/quiz/{quiz_id} [get] func (controller *paperController) QuizFind(c *gin.Context) { paper_id, err := strconv.ParseInt(c.Param("paper_id"), 10, 64)