This commit is contained in:
Pasha 2025-05-14 15:57:10 +03:00
parent c9cf3b07b1
commit 63c99e5a62
3 changed files with 8 additions and 5 deletions

2
go.mod

@ -8,7 +8,7 @@ require (
gitea.pena/PenaSide/common v0.0.0-20250421103113-7e4b3ae9e1e0 gitea.pena/PenaSide/common v0.0.0-20250421103113-7e4b3ae9e1e0
gitea.pena/PenaSide/hlog v0.0.0-20241125221102-a54c29c002a9 gitea.pena/PenaSide/hlog v0.0.0-20241125221102-a54c29c002a9
gitea.pena/PenaSide/trashlog v0.0.0-20250224122049-ddb4d72e9d07 gitea.pena/PenaSide/trashlog v0.0.0-20250224122049-ddb4d72e9d07
gitea.pena/SQuiz/common v0.0.0-20250514101340-d27fa4798a14 gitea.pena/SQuiz/common v0.0.0-20250514124515-870e52266ca5
gitea.pena/SQuiz/worker v0.0.0-20250410234138-cad6445b4e4f gitea.pena/SQuiz/worker v0.0.0-20250410234138-cad6445b4e4f
github.com/gofiber/fiber/v2 v2.52.6 github.com/gofiber/fiber/v2 v2.52.6
github.com/golang-jwt/jwt/v5 v5.2.2 github.com/golang-jwt/jwt/v5 v5.2.2

2
go.sum

@ -13,6 +13,8 @@ gitea.pena/SQuiz/common v0.0.0-20250510091827-dd71e1b6712d h1:8gx2IY1/OOx8jIAEYn
gitea.pena/SQuiz/common v0.0.0-20250510091827-dd71e1b6712d/go.mod h1:/YR+uo4RouZshuHPkguk7nAJVKuFt3Z0mTFxUPdlzxQ= gitea.pena/SQuiz/common v0.0.0-20250510091827-dd71e1b6712d/go.mod h1:/YR+uo4RouZshuHPkguk7nAJVKuFt3Z0mTFxUPdlzxQ=
gitea.pena/SQuiz/common v0.0.0-20250514101340-d27fa4798a14 h1:2yOBm9dS7PQ458GBPbVdnbKovAP8SWFqa5rWfzzCj5w= gitea.pena/SQuiz/common v0.0.0-20250514101340-d27fa4798a14 h1:2yOBm9dS7PQ458GBPbVdnbKovAP8SWFqa5rWfzzCj5w=
gitea.pena/SQuiz/common v0.0.0-20250514101340-d27fa4798a14/go.mod h1:zCrUwDh0APpztKk6NUqTZv+zhjVbWpGBJiJ5z9dAH0U= gitea.pena/SQuiz/common v0.0.0-20250514101340-d27fa4798a14/go.mod h1:zCrUwDh0APpztKk6NUqTZv+zhjVbWpGBJiJ5z9dAH0U=
gitea.pena/SQuiz/common v0.0.0-20250514124515-870e52266ca5 h1:C+iCsGMSUJonOTNNk8wWYOfzZ0Jjw+2IQ5FaEGwRVT0=
gitea.pena/SQuiz/common v0.0.0-20250514124515-870e52266ca5/go.mod h1:zCrUwDh0APpztKk6NUqTZv+zhjVbWpGBJiJ5z9dAH0U=
gitea.pena/SQuiz/worker v0.0.0-20250227130447-f32f55d7752e h1:+NbE0scdaXIy58XsK+8WKUNQeZiM3PPsQwBG92Tyncs= gitea.pena/SQuiz/worker v0.0.0-20250227130447-f32f55d7752e h1:+NbE0scdaXIy58XsK+8WKUNQeZiM3PPsQwBG92Tyncs=
gitea.pena/SQuiz/worker v0.0.0-20250227130447-f32f55d7752e/go.mod h1:MDEYDHXF65HiWU/C43MKtX4sct9ktrczV4pzggVNsUc= gitea.pena/SQuiz/worker v0.0.0-20250227130447-f32f55d7752e/go.mod h1:MDEYDHXF65HiWU/C43MKtX4sct9ktrczV4pzggVNsUc=
gitea.pena/SQuiz/worker v0.0.0-20250410234138-cad6445b4e4f h1:MLftlXTvJEWdHew7H5MVjssK6u08xLedeOWApnUGoh8= gitea.pena/SQuiz/worker v0.0.0-20250410234138-cad6445b4e4f h1:MLftlXTvJEWdHew7H5MVjssK6u08xLedeOWApnUGoh8=

@ -1,12 +1,12 @@
package service package service
import ( import (
"github.com/gofiber/fiber/v2"
"github.com/lib/pq"
"gitea.pena/PenaSide/common/log_mw" "gitea.pena/PenaSide/common/log_mw"
"gitea.pena/SQuiz/common/middleware" "gitea.pena/SQuiz/common/middleware"
"gitea.pena/SQuiz/common/model" "gitea.pena/SQuiz/common/model"
"gitea.pena/SQuiz/core/models" "gitea.pena/SQuiz/core/models"
"github.com/gofiber/fiber/v2"
"github.com/lib/pq"
"unicode/utf8" "unicode/utf8"
) )
@ -75,7 +75,7 @@ func (s *Service) CreateQuestion(ctx *fiber.Ctx) error {
hlogger.Emit(models.InfoQuestionCreate{ hlogger.Emit(models.InfoQuestionCreate{
CtxUserID: accountID, CtxUserID: accountID,
CtxIDInt: int64(req.QuizId), CtxIDInt: int64(req.QuizId),
CtxQuestionID: int64(questionID), CtxQuestionID: int64(questionID),
}) })
@ -136,6 +136,7 @@ func (s *Service) GetQuestionList(ctx *fiber.Ctx) error {
req.Required, req.Required,
req.Search, req.Search,
req.Type, req.Type,
0,
) )
if err != nil { if err != nil {
return ctx.Status(fiber.StatusInternalServerError).SendString(err.Error()) return ctx.Status(fiber.StatusInternalServerError).SendString(err.Error())
@ -312,7 +313,7 @@ func (s *Service) DeleteQuestion(ctx *fiber.Ctx) error {
hlogger.Emit(models.InfoQuestionDelete{ hlogger.Emit(models.InfoQuestionDelete{
CtxUserID: accountID, CtxUserID: accountID,
CtxIDInt: int64(deleted.QuizId), CtxIDInt: int64(deleted.QuizId),
CtxQuestionID: int64(deleted.Id), CtxQuestionID: int64(deleted.Id),
}) })