2022-08-25 12:16:29 +00:00
|
|
|
import { SuccessResponse } from './base';
|
2022-08-25 11:39:58 +00:00
|
|
|
import { IsBoolean, IsInt, IsNotEmpty, Min } from 'class-validator';
|
2022-08-24 14:15:33 +00:00
|
|
|
|
|
|
|
export type UploadFileResponse = SuccessResponse;
|
|
|
|
export type DeleteResponse = SuccessResponse;
|
|
|
|
export type CreateFileResponse = CreateFolderResponse;
|
|
|
|
|
2022-08-25 12:16:29 +00:00
|
|
|
export class GetRootResponse extends SuccessResponse {
|
2022-08-25 11:39:58 +00:00
|
|
|
@IsInt()
|
|
|
|
@Min(1)
|
2022-08-24 14:15:33 +00:00
|
|
|
rootId: number;
|
|
|
|
}
|
|
|
|
|
2022-08-25 12:16:29 +00:00
|
|
|
export class GetNodeResponse extends SuccessResponse {
|
2022-08-25 11:39:58 +00:00
|
|
|
@IsInt()
|
|
|
|
@Min(1)
|
2022-08-24 14:15:33 +00:00
|
|
|
id: number;
|
2022-08-25 11:39:58 +00:00
|
|
|
|
|
|
|
@IsNotEmpty()
|
2022-08-24 14:15:33 +00:00
|
|
|
name: string;
|
2022-08-25 11:39:58 +00:00
|
|
|
|
|
|
|
@IsBoolean()
|
2022-08-24 14:15:33 +00:00
|
|
|
isFile: boolean;
|
2022-08-25 11:39:58 +00:00
|
|
|
|
2022-08-24 14:15:33 +00:00
|
|
|
parent: number | null;
|
2022-08-25 11:39:58 +00:00
|
|
|
|
2022-08-25 12:16:29 +00:00
|
|
|
@IsInt({ each: true })
|
|
|
|
@Min(1, { each: true })
|
2022-08-24 14:15:33 +00:00
|
|
|
children?: number[];
|
2022-08-25 11:39:58 +00:00
|
|
|
|
2022-08-24 14:15:33 +00:00
|
|
|
size?: number;
|
|
|
|
}
|
|
|
|
|
2022-08-25 12:16:29 +00:00
|
|
|
export class GetPathResponse extends SuccessResponse {
|
2022-08-25 11:39:58 +00:00
|
|
|
@IsNotEmpty()
|
2022-08-24 14:15:33 +00:00
|
|
|
path: string;
|
|
|
|
}
|
|
|
|
|
2022-08-25 12:16:29 +00:00
|
|
|
export class CreateFolderResponse extends SuccessResponse {
|
2022-08-25 11:39:58 +00:00
|
|
|
@IsInt()
|
|
|
|
@Min(1)
|
2022-08-24 14:15:33 +00:00
|
|
|
id: number;
|
|
|
|
}
|