diff --git a/internal/brokers/producer.go b/internal/brokers/producer.go index 895c517..8737839 100644 --- a/internal/brokers/producer.go +++ b/internal/brokers/producer.go @@ -52,10 +52,11 @@ func (p *Producer) ToMailNotify(ctx context.Context, message Message) error { } type MessageGigaChat struct { - ID int64 `json:"id"` - QuizID int64 `json:"quiz_id"` - Sex int32 `json:"sex"` // 0 - female, 1 - male, 2 - not sex - Age string `json:"age"` + ID int64 `json:"id"` + QuizID int64 `json:"quiz_id"` + Sex int32 `json:"sex"` // 0 - female, 1 - male, 2 - not sex + Age string `json:"age"` + AccountID string `json:"account_id"` } // todo очень плохое решение что у нас два клиента к кафке и два продюсера у которых два метода самовырубащих эти клиенты, как только перестанет быть костылем надо будет переписать на нормальную логику diff --git a/internal/controllers/http_controllers/quiz/quiz.go b/internal/controllers/http_controllers/quiz/quiz.go index a2a7743..f2fa109 100644 --- a/internal/controllers/http_controllers/quiz/quiz.go +++ b/internal/controllers/http_controllers/quiz/quiz.go @@ -593,10 +593,11 @@ func (r *Quiz) CreateQuizAuditory(ctx *fiber.Ctx) error { } err = r.producerGigaChat.ToGigaChatNotify(ctx.Context(), brokers.MessageGigaChat{ - ID: result, - QuizID: quizID, - Age: req.Age, - Sex: req.Sex, + ID: result, + QuizID: quizID, + Age: req.Age, + Sex: req.Sex, + AccountID: accountID, }) if err != nil { return ctx.Status(fiber.StatusInternalServerError).SendString(err.Error())