mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-22 07:26:42 +02:00
- Move finance, mail, moodlit to apps-archived for later development - Rename games/voxel-lava to games/voxelava 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
30 lines
1,010 B
TypeScript
30 lines
1,010 B
TypeScript
import { Controller, Post, Param, UseGuards, ParseUUIDPipe } from '@nestjs/common';
|
|
import { JwtAuthGuard, CurrentUser, CurrentUserData } from '@manacore/shared-nestjs-auth';
|
|
import { AIService } from './ai.service';
|
|
|
|
@Controller('emails')
|
|
@UseGuards(JwtAuthGuard)
|
|
export class AIController {
|
|
constructor(private readonly aiService: AIService) {}
|
|
|
|
@Post(':id/summarize')
|
|
async summarize(@CurrentUser() user: CurrentUserData, @Param('id', ParseUUIDPipe) id: string) {
|
|
const result = await this.aiService.summarizeEmail(id, user.userId);
|
|
return result;
|
|
}
|
|
|
|
@Post(':id/suggest-replies')
|
|
async suggestReplies(
|
|
@CurrentUser() user: CurrentUserData,
|
|
@Param('id', ParseUUIDPipe) id: string
|
|
) {
|
|
const result = await this.aiService.suggestReplies(id, user.userId);
|
|
return result;
|
|
}
|
|
|
|
@Post(':id/categorize')
|
|
async categorize(@CurrentUser() user: CurrentUserData, @Param('id', ParseUUIDPipe) id: string) {
|
|
const result = await this.aiService.categorizeEmail(id, user.userId);
|
|
return result;
|
|
}
|
|
}
|