feat: add ChatbotController for handling AI chat queries and history retrieval
All checks were successful
Build and Release / release (push) Successful in 1m36s

This commit is contained in:
2026-05-09 11:12:26 +07:00
parent 27c78db66d
commit 12a04f0670

View File

@@ -46,9 +46,9 @@ func (cx *ChatbotController) Chat(c fiber.Ctx) error {
}) })
} }
claims := c.Locals("user").(*response.JWTClaims) uid := c.Locals("uid").(string)
answer, err := cx.chatbotService.Chat(ctx, claims.UId, dto.ProjectID, dto.Question) answer, err := cx.chatbotService.Chat(ctx, uid, dto.ProjectID, dto.Question)
if err != nil { if err != nil {
if err.Error() == "you have reached your daily limit of 10 questions. Please come back tomorrow" { if err.Error() == "you have reached your daily limit of 10 questions. Please come back tomorrow" {
return c.Status(fiber.StatusTooManyRequests).JSON(response.CommonResponse{ return c.Status(fiber.StatusTooManyRequests).JSON(response.CommonResponse{