doc: add openapi doc for auditory endpoints
All checks were successful
Deploy / CreateImage (push) Successful in 3m36s
Deploy / ValidateConfig (push) Successful in 25s
Deploy / MigrateDatabase (push) Successful in 46s
Deploy / DeployService (push) Successful in 26s

This commit is contained in:
skeris 2025-05-29 00:27:43 +03:00
parent 241ac217fd
commit 33f75f851c
3 changed files with 143 additions and 5 deletions

@ -1940,4 +1940,143 @@ paths:
'403': '403':
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

1
go.mod

@ -2,7 +2,6 @@ module gitea.pena/SQuiz/core
go 1.23.8 go 1.23.8
toolchain go1.24.0
require ( require (
gitea.pena/PenaSide/common v0.0.0-20250421103113-7e4b3ae9e1e0 gitea.pena/PenaSide/common v0.0.0-20250421103113-7e4b3ae9e1e0

@ -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 {