import { Controller, Post, Body, UseGuards } from '@nestjs/common';
import { AiService } from './ai.service';
import { JwtAuthGuard } from '../auth/jwt-auth.guard';

@Controller('ai')
@UseGuards(JwtAuthGuard)
export class AiController {
  constructor(private readonly aiService: AiService) {}

  @Post('/generate-code')
  generateCode(@Body() body: { prompt: string; workspaceId: number }) {
    return this.aiService.generateCode(body.prompt, body.workspaceId);
  }
}