import { BaseResponse, 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 BaseResponse { statusCode: 200; @IsInt() @Min(1) rootId: number; } export class GetNodeResponse extends BaseResponse { statusCode: 200; @IsInt() @Min(1) id: number; @IsNotEmpty() name: string; @IsBoolean() isFile: boolean; parent: number | null; children?: number[]; size?: number; } export class GetPathResponse extends BaseResponse { statusCode: 200; @IsNotEmpty() path: string; } export class CreateFolderResponse extends BaseResponse { statusCode: 200; @IsInt() @Min(1) id: number; }