feat: add get chatbot conversation by id endpoint

This commit is contained in:
2026-11-14 23:58:34 +03:30
parent d572f6b7a2
commit 88b4a99908
6 changed files with 117 additions and 0 deletions
+18
View File
@@ -4,6 +4,8 @@ import {
Get,
HttpCode,
HttpStatus,
Param,
ParseIntPipe,
Post,
Res,
} from '@nestjs/common';
@@ -15,6 +17,7 @@ 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';
import { GetConversationDetailsDTO } from './dtos/get-conversation-details.dto';
@Controller('chatbot')
@Throttle({ default: { limit: 30, ttl: 60_000 } })
@@ -38,6 +41,21 @@ export class ChatbotController {
return this.chatbotService.getConversations(user);
}
@Get('conversations/:conversationId')
@ApiAppResponse([
{
status: HttpStatus.OK,
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
variants: [{ model: GetConversationDetailsDTO }],
},
])
public async getConversation(
@Param('conversationId', ParseIntPipe) conversationId: number,
@ActiveUser() user: User,
) {
return this.chatbotService.getConversation(user, conversationId);
}
@Post('chat')
@HttpCode(HttpStatus.OK)
@ApiAppResponse([