localhost_oa_based/src/modules/netdisk/manager/manage.class.ts

68 lines
1.6 KiB
TypeScript
Raw Normal View History

2024-02-28 08:32:35 +08:00
import { ApiProperty } from '@nestjs/swagger';
export type FileType = 'file' | 'dir';
export class SFileInfo {
@ApiProperty({ description: '文件id' })
id: string;
@ApiProperty({ description: '文件类型', enum: ['file', 'dir'] })
type: FileType;
@ApiProperty({ description: '文件名称' })
name: string;
@ApiProperty({ description: '存入时间', type: Date })
putTime?: Date;
@ApiProperty({ description: '文件大小, byte单位' })
fsize?: string;
@ApiProperty({ description: '文件的mime-type' })
mimeType?: string;
@ApiProperty({ description: '所属目录' })
belongTo?: string;
}
export class SFileList {
@ApiProperty({ description: '文件列表', type: [SFileInfo] })
list: SFileInfo[];
@ApiProperty({ description: '分页标志,空则代表加载完毕' })
marker?: string;
}
export class UploadToken {
@ApiProperty({ description: '上传token' })
token: string;
}
export class SFileInfoDetail {
@ApiProperty({ description: '文件大小int64类型单位为字节Byte' })
fsize: number;
@ApiProperty({ description: '文件HASH值' })
hash: string;
@ApiProperty({ description: '文件MIME类型string类型' })
mimeType: string;
@ApiProperty({
2024-02-28 17:02:46 +08:00
description: '文件存储类型2 表示归档存储1 表示低频存储0表示普通存储。',
2024-02-28 08:32:35 +08:00
})
type: number;
@ApiProperty({ description: '文件上传时间', type: Date })
putTime: Date;
@ApiProperty({ description: '文件md5值' })
md5: string;
@ApiProperty({ description: '上传人' })
uploader: string;
@ApiProperty({ description: '文件备注' })
mark?: string;
}