feat: add chatbot conversations endpoint

This commit is contained in:
2026-11-14 23:24:10 +03:30
parent 8d6834f44c
commit d572f6b7a2
6 changed files with 89 additions and 0 deletions
+14
View File
@@ -1,6 +1,7 @@
import {
Body,
Controller,
Get,
HttpCode,
HttpStatus,
Post,
@@ -13,6 +14,7 @@ import { ActiveUser } from '@/common/decorators/active-user.decorator';
import { User } from '../users/entities/user.entity';
import { ApiAppResponse } from '@/common/decorators/api-app-response.decorator';
import { Throttle } from '@nestjs/throttler';
import { GetConversationDTO } from './dtos/get-conversation.dto';
@Controller('chatbot')
@Throttle({ default: { limit: 30, ttl: 60_000 } })
@@ -24,6 +26,18 @@ export class ChatbotController {
private readonly chatbotService: ChatbotService,
) {}
@Get('conversations')
@ApiAppResponse([
{
status: HttpStatus.OK,
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
variants: [{ model: GetConversationDTO, isArray: true }],
},
])
public async getConversations(@ActiveUser() user: User) {
return this.chatbotService.getConversations(user);
}
@Post('chat')
@HttpCode(HttpStatus.OK)
@ApiAppResponse([