--
This commit is contained in:
parent
0f837f997b
commit
79f587db91
@ -154,7 +154,7 @@ func New(ctx context.Context, opts interface{}, ver appInit.Version) (appInit.Co
|
|||||||
WorkerRespondentCh: workerRespondentCh,
|
WorkerRespondentCh: workerRespondentCh,
|
||||||
Encrypt: encrypt,
|
Encrypt: encrypt,
|
||||||
RedirectURl: options.RedirectURL,
|
RedirectURl: options.RedirectURL,
|
||||||
AiClient: clients.NewAiClient("https://alvatar.com/api/engine/send_answer/"),
|
AiClient: clients.NewAiClient("https://alvatar.com/api/engine/send_answer"),
|
||||||
})
|
})
|
||||||
|
|
||||||
saveRespWcData := savewc.DepsForResp{
|
saveRespWcData := savewc.DepsForResp{
|
||||||
|
@ -15,7 +15,7 @@ type AIClient struct {
|
|||||||
type SendAnswerRequest struct {
|
type SendAnswerRequest struct {
|
||||||
Tipe string `json:"type"`
|
Tipe string `json:"type"`
|
||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
Final bool `json:"final"`
|
Final bool `json:"is_final"`
|
||||||
Session string `json:"session"`
|
Session string `json:"session"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,13 +34,10 @@ func (client *AIClient) SendAnswerer(final bool, tipe, message, session string)
|
|||||||
// Session: session,
|
// Session: session,
|
||||||
//}
|
//}
|
||||||
|
|
||||||
clownRequest := struct {
|
clownRequest := SendAnswerRequest{
|
||||||
Title string `json:"title"`
|
Message: message,
|
||||||
Text string `json:"text"`
|
Tipe: "text",
|
||||||
Final bool `json:"is_final"`
|
Final: false,
|
||||||
Session string `json:"string"`
|
|
||||||
}{
|
|
||||||
Text: message,
|
|
||||||
Session: session,
|
Session: session,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,7 +54,7 @@ func (client *AIClient) SendAnswerer(final bool, tipe, message, session string)
|
|||||||
return "", errors.Join(errs...)
|
return "", errors.Join(errs...)
|
||||||
}
|
}
|
||||||
|
|
||||||
if statusCode != fiber.StatusCreated {
|
if statusCode != fiber.StatusOK {
|
||||||
return "", fmt.Errorf("invalid response status code: %d", statusCode)
|
return "", fmt.Errorf("invalid response status code: %d", statusCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,6 +178,9 @@ func (s *Service) GetQuizData(c *fiber.Ctx) error {
|
|||||||
var cnt uint64
|
var cnt uint64
|
||||||
|
|
||||||
if quiz.Status == model.StatusAI {
|
if quiz.Status == model.StatusAI {
|
||||||
|
if req.Page >= 1 {
|
||||||
|
req.Page+=1
|
||||||
|
}
|
||||||
questions, cnt, err = s.dal.QuestionRepo.GetQuestionsAI(c.Context(), int64(quiz.Id), cs, int32(req.Limit), int32(req.Page*req.Limit), req.Auditory)
|
questions, cnt, err = s.dal.QuestionRepo.GetQuestionsAI(c.Context(), int64(quiz.Id), cs, int32(req.Limit), int32(req.Page*req.Limit), req.Auditory)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return c.Status(fiber.StatusInternalServerError).SendString(err.Error())
|
return c.Status(fiber.StatusInternalServerError).SendString(err.Error())
|
||||||
|
Loading…
Reference in New Issue
Block a user