feat: add modular services and repositories for improved code organization
Introduce repository pattern across multiple services, including `favorites`, `tags`, `sessions`, `reports`, `auth`, and more. Decouple crypto functionalities into modular services like `HashingService`, `JwtService`, and `EncryptionService`. Improve testability and maintainability by simplifying dependencies and consolidating utility logic.
This commit is contained in:
25
backend/src/common/interfaces/media.interface.ts
Normal file
25
backend/src/common/interfaces/media.interface.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
export interface MediaProcessingResult {
|
||||
buffer: Buffer;
|
||||
mimeType: string;
|
||||
extension: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
size: number;
|
||||
}
|
||||
|
||||
export interface ScanResult {
|
||||
isInfected: boolean;
|
||||
virusName?: string;
|
||||
}
|
||||
|
||||
export interface IMediaService {
|
||||
scanFile(buffer: Buffer, filename: string): Promise<ScanResult>;
|
||||
processImage(
|
||||
buffer: Buffer,
|
||||
format?: "webp" | "avif",
|
||||
): Promise<MediaProcessingResult>;
|
||||
processVideo(
|
||||
buffer: Buffer,
|
||||
format?: "webm" | "av1",
|
||||
): Promise<MediaProcessingResult>;
|
||||
}
|
||||
Reference in New Issue
Block a user