feat(quick-260921-pi9): Bilderrahmen-API - Bilder je Benutzer in der Datenbank, Magic-Byte-Pruefung, 5 MiB / 30 Stueck
- Prisma-Modell DashboardImage (bytea) mit Migration 20260921120000: Tabelle, Indizes, RLS ENABLE/FORCE und tenant_isolation_policy mit Benutzerdimension - dashboard-image-rules.ts: detectImageMime ueber Magic Bytes (PNG/JPEG/GIF/ WebP), Grenzen 5 MiB je Datei und 30 je Benutzer - DashboardImagesService: list/upload/getBytes/remove, je Methode forTenant(prisma, tenantId, userId); Besitz = Mandant UND Benutzer, sonst 404 - DashboardImagesController unter dashboard/images: GET, POST (FileInterceptor image, 5 MiB, eine Datei), GET :id mit Content-Type aus dem erkannten Typ, Cache-Control private, nosniff, Content-Disposition inline ohne Dateinamen, CSP sandbox; DELETE :id - CreateWidgetDto kennt 'picture-frame' - Klassifikationsdokument: neues Paar dashboard-images.service.ts/ dashboardImage; Bereichs- und Summenzeilen nachgemessen (dashboard 12->18, settings 3->4 und bug-reports waren in der Summe nie mitgezaehlt) - Befund: Prisma-Bytes verlangt Uint8Array<ArrayBuffer>, multers Buffer wird ohne Zusicherung abgelehnt - Kopie per new Uint8Array(buffer) statt Cast Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ModuleRegistryModule } from '../module-registry/module-registry.module';
|
||||
import { DashboardController } from './dashboard.controller';
|
||||
import { DashboardImagesController } from './dashboard-images.controller';
|
||||
import { DashboardImagesService } from './dashboard-images.service';
|
||||
import { DashboardService } from './dashboard.service';
|
||||
|
||||
/**
|
||||
@@ -9,6 +11,8 @@ import { DashboardService } from './dashboard.service';
|
||||
* Provides:
|
||||
* - DashboardService: CRUD for per-user dashboard layouts and widget instances
|
||||
* - DashboardController: REST API for layout and widget operations
|
||||
* - DashboardImagesService/-Controller: Bilder des Bilderrahmen-Widgets
|
||||
* (quick-260921-pi9), je Benutzer in der Datenbank
|
||||
*
|
||||
* Imports ModuleRegistryModule so DashboardService can inject
|
||||
* ModuleAccessService for the D-22 widget-module filter (Plan 15-05).
|
||||
@@ -17,8 +21,8 @@ import { DashboardService } from './dashboard.service';
|
||||
*/
|
||||
@Module({
|
||||
imports: [ModuleRegistryModule],
|
||||
controllers: [DashboardController],
|
||||
providers: [DashboardService],
|
||||
controllers: [DashboardController, DashboardImagesController],
|
||||
providers: [DashboardService, DashboardImagesService],
|
||||
exports: [DashboardService],
|
||||
})
|
||||
export class DashboardModule {}
|
||||
|
||||
Reference in New Issue
Block a user