dad0136365
Build and Push Multi-Platform Images / build-and-push (push) Successful in 41s
Reformats code style (line breaks, indentation, type annotations) without changing logic. Also includes minor feature additions bundled in the same lint run (stats service, user-settings groups, agrarmonitor polling improvements). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
import { Controller, Post, Logger, HttpCode, HttpStatus } from '@nestjs/common';
|
|
import { RequirePermissions } from '../auth/permissions.decorator';
|
|
import { Permission } from '../auth/permissions.enum';
|
|
import { EmailDownloadService } from './email-download.service';
|
|
|
|
@Controller('api/emails')
|
|
export class EmailDownloadController {
|
|
private readonly logger = new Logger(EmailDownloadController.name);
|
|
|
|
constructor(private readonly emailDownloadService: EmailDownloadService) {}
|
|
|
|
@Post('fetch')
|
|
@HttpCode(HttpStatus.OK)
|
|
@RequirePermissions(Permission.VIEW_MAIL)
|
|
async triggerFetch() {
|
|
this.logger.log('Manueller E-Mail-Abruf wurde ausgelöst.');
|
|
await this.emailDownloadService.handleCron();
|
|
return { message: 'E-Mail-Abruf abgeschlossen.' };
|
|
}
|
|
|
|
@Post('backfill-thumbnails')
|
|
@RequirePermissions(Permission.MANAGE_ALL)
|
|
@HttpCode(HttpStatus.OK)
|
|
async backfillThumbnails() {
|
|
this.logger.log('Manueller Backfill für Thumbnails wurde ausgelöst.');
|
|
const result =
|
|
await this.emailDownloadService.backfillThumbnailsForNewEmails();
|
|
return { message: 'Backfill abgeschlossen.', result };
|
|
}
|
|
}
|