Merge branch 'hlog' into 'staging'

fix hlog structs

See merge request backend/quiz/core!20
This commit is contained in:
Mikhail 2024-06-12 13:51:32 +00:00 committed by skeris
commit 9b27a9634f
3 changed files with 22 additions and 22 deletions

@ -7,9 +7,9 @@ type AllFields struct {
KeyPath string
CtxUserID string
CtxAccountID string
CtxID uint64
CtxQuizID uint64
CtxQuestionID uint64
CtxIDInt int64
CtxQuizID int64
CtxQuestionID int64
}
type InfoAccountCreated struct {
@ -18,32 +18,32 @@ type InfoAccountCreated struct {
}
type InfoQuizCreated struct {
CtxUserID string //айдишник юзера из токена
CtxID uint64 //айдишник создаваемого квиза
CtxIDInt int64 //айдишник создаваемого квиза
}
type InfoQuizPublish struct { // если статус меняется на start
CtxUserID string //айдишник юзера из токена
CtxID uint64 //айдишник публикуемого квиза
CtxIDInt int64 //айдишник публикуемого квиза
}
type InfoQuizDelete struct { // если квиз удаляется
CtxUserID string //айдишник юзера из токена
CtxID uint64 //айдишник удаляемого квиза
CtxIDInt int64 //айдишник удаляемого квиза
}
type InfoQuizStop struct { // если статус меняется на stop
CtxUserID string //айдишник юзера из токена
CtxID uint64 //айдишник останавливаемого квиза
CtxIDInt int64 //айдишник останавливаемого квиза
}
type InfoQuizTemplateCopy struct {
CtxUserID string //айдишник юзера из токена
CtxID uint64 //айдишник копируемого квиза
CtxQuizID uint64 // айдишник опроса после копирования
CtxIDInt int64 //айдишник копируемого квиза
CtxQuizID int64 // айдишник опроса после копирования
}
type InfoQuestionCreate struct {
CtxUserID string //айдишник юзера из токена
CtxID uint64 //айдишник останавливаемого квиза
CtxQuestionID uint64 // айдишник вопроса
CtxIDInt int64 //айдишник останавливаемого квиза
CtxQuestionID int64 // айдишник вопроса
}
type InfoQuestionDelete struct {
CtxUserID string //айдишник юзера из токена
CtxID uint64 //айдишник останавливаемого квиза
CtxQuestionID uint64 // айдишник вопроса
CtxIDInt int64 //айдишник останавливаемого квиза
CtxQuestionID int64 // айдишник вопроса
}

@ -75,8 +75,8 @@ func (s *Service) CreateQuestion(ctx *fiber.Ctx) error {
hlogger.Emit(models.InfoQuestionCreate{
CtxUserID: accountID,
CtxID: req.QuizId,
CtxQuestionID: questionID,
CtxIDInt: int64(req.QuizId),
CtxQuestionID: int64(questionID),
})
return ctx.Status(fiber.StatusOK).JSON(result)
@ -312,8 +312,8 @@ func (s *Service) DeleteQuestion(ctx *fiber.Ctx) error {
hlogger.Emit(models.InfoQuestionDelete{
CtxUserID: accountID,
CtxID: deleted.QuizId,
CtxQuestionID: deleted.Id,
CtxIDInt: int64(deleted.QuizId),
CtxQuestionID: int64(deleted.Id),
})
return ctx.JSON(DeactivateResp{

@ -101,7 +101,7 @@ func (s *Service) CreateQuiz(ctx *fiber.Ctx) error {
hlogger.Emit(models.InfoQuizCreated{
CtxUserID: accountId,
CtxID: quizID,
CtxIDInt: int64(quizID),
})
return ctx.Status(fiber.StatusCreated).JSON(record)
@ -314,13 +314,13 @@ func (s *Service) UpdateQuiz(ctx *fiber.Ctx) error {
if req.Status == model.StatusStart {
hlogger.Emit(models.InfoQuizPublish{
CtxUserID: accountId,
CtxID: quiz.Id,
CtxIDInt: int64(quiz.Id),
})
}
if req.Status == model.StatusStop {
hlogger.Emit(models.InfoQuizStop{
CtxUserID: accountId,
CtxID: quiz.Id,
CtxIDInt: int64(quiz.Id),
})
}
@ -428,7 +428,7 @@ func (s *Service) DeleteQuiz(ctx *fiber.Ctx) error {
hlogger.Emit(models.InfoQuizDelete{
CtxUserID: accountId,
CtxID: req.Id,
CtxIDInt: int64(req.Id),
})
return ctx.JSON(DeactivateResp{
@ -513,7 +513,7 @@ func (s *Service) TemplateCopy(ctx *fiber.Ctx) error {
// todo либо возвращать id копируемого квиза либо поле с qid
// для него потому что id получаем уже в запросе sql
//CtxID: req.Qid,
CtxQuizID: uint64(qizID),
CtxQuizID: qizID,
})
return ctx.Status(fiber.StatusOK).JSON(fiber.Map{"id": qizID})