diff --git a/api/openapi.yaml b/api/openapi.yaml index 13460cc..949257d 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -1940,4 +1940,143 @@ paths: '403': description: что то пошло не так связано с тг '500': - description: внутренняя ошибка сервера \ No newline at end of file + 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 \ No newline at end of file diff --git a/go.mod b/go.mod index c9818c8..ad28f38 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,6 @@ module gitea.pena/SQuiz/core go 1.23.8 -toolchain go1.24.0 require ( gitea.pena/PenaSide/common v0.0.0-20250421103113-7e4b3ae9e1e0 diff --git a/internal/controllers/http_controllers/quiz/route.go b/internal/controllers/http_controllers/quiz/route.go index 9724e03..7187c5d 100644 --- a/internal/controllers/http_controllers/quiz/route.go +++ b/internal/controllers/http_controllers/quiz/route.go @@ -12,9 +12,9 @@ func (r *Quiz) Register(router fiber.Router) { router.Patch("/archive", r.ArchiveQuiz) router.Post("/move", r.QuizMove) router.Post("/template", r.TemplateCopy) - router.Post("/:quizID/audience", r.CreateQuizAuditory) - router.Get("/:quizID/audience", r.GetQuizAuditory) - router.Delete("/:quizID/audience", r.DeleteQuizAuditory) + router.Post("/:quizID/auditory", r.CreateQuizAuditory) + router.Get("/:quizID/auditory", r.GetQuizAuditory) + router.Delete("/:quizID/auditory", r.DeleteQuizAuditory) } func (r *Quiz) Name() string {