import { SuccessResponse } from './base'; import { IsBoolean, IsInt, IsNotEmpty, Min } from 'class-validator'; export type UploadFileResponse = SuccessResponse; export type DeleteResponse = SuccessResponse; export type CreateFileResponse = CreateFolderResponse; export class GetRootResponse extends SuccessResponse { @IsInt() @Min(1) rootId: number; } export class GetNodeResponse extends SuccessResponse { @IsInt() @Min(1) id: number; @IsNotEmpty() name: string; @IsBoolean() isFile: boolean; parent: number | null; @IsInt({ each: true }) @Min(1, { each: true }) children?: number[]; size?: number; } export class GetPathResponse extends SuccessResponse { @IsNotEmpty() path: string; } export class CreateFolderResponse extends SuccessResponse { @IsInt() @Min(1) id: number; }