doc: add openapi doc for auditory endpoints
This commit is contained in:
parent
241ac217fd
commit
0cf166f801
139
api/openapi.yaml
139
api/openapi.yaml
@ -1941,3 +1941,142 @@ paths:
|
|||||||
description: что то пошло не так связано с тг
|
description: что то пошло не так связано с тг
|
||||||
'500':
|
'500':
|
||||||
description: внутренняя ошибка сервера
|
description: внутренняя ошибка сервера
|
||||||
|
|
||||||
|
/quiz/{quizID}/auditory:
|
||||||
|
post:
|
||||||
|
description: Create quiz auditory
|
||||||
|
parameters:
|
||||||
|
- name: quizID
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
description: ID of the quiz
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: Quiz auditory created successfully
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
description: ID of created auditory
|
||||||
|
'400':
|
||||||
|
description: Invalid quiz ID
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
default: invalid quiz id
|
||||||
|
'500':
|
||||||
|
description: Internal server error
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
default: if you get any content string send it to developer
|
||||||
|
get:
|
||||||
|
description: Get quiz auditory
|
||||||
|
parameters:
|
||||||
|
- name: quizID
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
description: ID of the quiz
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: Quiz auditory retrieved successfully
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
description: ID of auditory
|
||||||
|
quiz_id:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
description: ID of the quiz
|
||||||
|
sex:
|
||||||
|
type: boolean
|
||||||
|
description: Gender of the person (false - female, true - male)
|
||||||
|
age:
|
||||||
|
type: string
|
||||||
|
description: Age of the person
|
||||||
|
deleted:
|
||||||
|
type: boolean
|
||||||
|
description: Whether the auditory record is deleted
|
||||||
|
created_at:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
description: Creation timestamp
|
||||||
|
'400':
|
||||||
|
description: Invalid quiz ID
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
default: invalid quiz id
|
||||||
|
'404':
|
||||||
|
description: Quiz auditory not found
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
default: quiz auditory not found
|
||||||
|
'500':
|
||||||
|
description: Internal server error
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
default: if you get any content string send it to developer
|
||||||
|
delete:
|
||||||
|
description: Delete quiz auditory
|
||||||
|
parameters:
|
||||||
|
- name: quizID
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
description: ID of the quiz
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: Quiz auditory deleted successfully
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
deleted:
|
||||||
|
type: boolean
|
||||||
|
description: True if auditory was deleted
|
||||||
|
'400':
|
||||||
|
description: Invalid quiz ID
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
default: invalid quiz id
|
||||||
|
'404':
|
||||||
|
description: Quiz auditory not found
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
default: quiz auditory not found
|
||||||
|
'500':
|
||||||
|
description: Internal server error
|
||||||
|
content:
|
||||||
|
'application/json':
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
default: if you get any content string send it to developer
|
@ -12,9 +12,9 @@ func (r *Quiz) Register(router fiber.Router) {
|
|||||||
router.Patch("/archive", r.ArchiveQuiz)
|
router.Patch("/archive", r.ArchiveQuiz)
|
||||||
router.Post("/move", r.QuizMove)
|
router.Post("/move", r.QuizMove)
|
||||||
router.Post("/template", r.TemplateCopy)
|
router.Post("/template", r.TemplateCopy)
|
||||||
router.Post("/:quizID/audience", r.CreateQuizAuditory)
|
router.Post("/:quizID/auditory", r.CreateQuizAuditory)
|
||||||
router.Get("/:quizID/audience", r.GetQuizAuditory)
|
router.Get("/:quizID/auditory", r.GetQuizAuditory)
|
||||||
router.Delete("/:quizID/audience", r.DeleteQuizAuditory)
|
router.Delete("/:quizID/auditory", r.DeleteQuizAuditory)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Quiz) Name() string {
|
func (r *Quiz) Name() string {
|
||||||
|
Loading…
Reference in New Issue
Block a user