paperquiz response 수정

This commit is contained in:
JongYeob Sheen 2024-02-19 22:58:00 +09:00
parent 05292be591
commit 0bac2bc670
5 changed files with 235 additions and 9 deletions

View File

@ -438,7 +438,7 @@ const docTemplate = `{
"200": { "200": {
"description": "OK", "description": "OK",
"schema": { "schema": {
"$ref": "#/definitions/learnsteam_cslms-api_internal_models.UserQuizListResponse" "$ref": "#/definitions/learnsteam_cslms-api_internal_models.PaperQuizListResponse"
} }
} }
} }
@ -482,7 +482,7 @@ const docTemplate = `{
"200": { "200": {
"description": "OK", "description": "OK",
"schema": { "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": { "learnsteam_cslms-api_internal_models.PaperResponse": {
"type": "object", "type": "object",
"properties": { "properties": {

View File

@ -430,7 +430,7 @@
"200": { "200": {
"description": "OK", "description": "OK",
"schema": { "schema": {
"$ref": "#/definitions/learnsteam_cslms-api_internal_models.UserQuizListResponse" "$ref": "#/definitions/learnsteam_cslms-api_internal_models.PaperQuizListResponse"
} }
} }
} }
@ -474,7 +474,7 @@
"200": { "200": {
"description": "OK", "description": "OK",
"schema": { "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": { "learnsteam_cslms-api_internal_models.PaperResponse": {
"type": "object", "type": "object",
"properties": { "properties": {

View File

@ -152,6 +152,66 @@ definitions:
example: 99 example: 99
type: integer type: integer
type: object 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: learnsteam_cslms-api_internal_models.PaperResponse:
properties: properties:
category: category:
@ -1092,7 +1152,7 @@ paths:
"200": "200":
description: OK description: OK
schema: schema:
$ref: '#/definitions/learnsteam_cslms-api_internal_models.UserQuizListResponse' $ref: '#/definitions/learnsteam_cslms-api_internal_models.PaperQuizListResponse'
security: security:
- Bearer: [] - Bearer: []
summary: 퀴즈페이퍼 퀴즈 목록 가져오기 summary: 퀴즈페이퍼 퀴즈 목록 가져오기
@ -1120,7 +1180,7 @@ paths:
"200": "200":
description: OK description: OK
schema: schema:
$ref: '#/definitions/learnsteam_cslms-api_internal_models.UserQuizResponse' $ref: '#/definitions/learnsteam_cslms-api_internal_models.PaperQuizResponse'
security: security:
- Bearer: [] - Bearer: []
summary: 퀴즈페이퍼 퀴즈 가져오기 summary: 퀴즈페이퍼 퀴즈 가져오기

2
go.mod
View File

@ -1,6 +1,6 @@
module learnsteam/cslms-api module learnsteam/cslms-api
go 1.22 go 1.21
require ( require (
github.com/apex/gateway v1.1.2 github.com/apex/gateway v1.1.2

View File

@ -246,7 +246,7 @@ func (controller *paperController) Finish(c *gin.Context) {
// @Param page query int false "페이지" // @Param page query int false "페이지"
// @Param limit query int false "페이지 사이즈" // @Param limit query int false "페이지 사이즈"
// //
// @Success 200 {object} models.UserQuizListResponse // @Success 200 {object} models.PaperQuizListResponse
// @Router /paper/{paper_id}/quiz [get] // @Router /paper/{paper_id}/quiz [get]
func (controller *paperController) QuizList(c *gin.Context) { func (controller *paperController) QuizList(c *gin.Context) {
paper_id, err := strconv.ParseInt(c.Param("paper_id"), 10, 64) 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 paper_id path string true "Paper ID"
// @Param quiz_id path string true "사용자퀴즈 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] // @Router /paper/{paper_id}/quiz/{quiz_id} [get]
func (controller *paperController) QuizFind(c *gin.Context) { func (controller *paperController) QuizFind(c *gin.Context) {
paper_id, err := strconv.ParseInt(c.Param("paper_id"), 10, 64) paper_id, err := strconv.ParseInt(c.Param("paper_id"), 10, 64)