2022-08-24 14:15:33 +00:00
|
|
|
import { BaseResponse, 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 11:39:58 +00:00
|
|
|
export class GetRootResponse extends BaseResponse {
|
2022-08-24 14:15:33 +00:00
|
|
|
statusCode: 200;
|
2022-08-25 11:39:58 +00:00
|
|
|
|
|
|
|
@IsInt()
|
|
|
|
@Min(1)
|
2022-08-24 14:15:33 +00:00
|
|
|
rootId: number;
|
|
|
|
}
|
|
|
|
|
2022-08-25 11:39:58 +00:00
|
|
|
export class GetNodeResponse extends BaseResponse {
|
2022-08-24 14:15:33 +00:00
|
|
|
statusCode: 200;
|
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-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 11:39:58 +00:00
|
|
|
export class GetPathResponse extends BaseResponse {
|
2022-08-24 14:15:33 +00:00
|
|
|
statusCode: 200;
|
2022-08-25 11:39:58 +00:00
|
|
|
|
|
|
|
@IsNotEmpty()
|
2022-08-24 14:15:33 +00:00
|
|
|
path: string;
|
|
|
|
}
|
|
|
|
|
2022-08-25 11:39:58 +00:00
|
|
|
export class CreateFolderResponse extends BaseResponse {
|
2022-08-24 14:15:33 +00:00
|
|
|
statusCode: 200;
|
2022-08-25 11:39:58 +00:00
|
|
|
|
|
|
|
@IsInt()
|
|
|
|
@Min(1)
|
2022-08-24 14:15:33 +00:00
|
|
|
id: number;
|
|
|
|
}
|