/* * @author gs * @date 2020/08/25 13:41 */ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Document } from 'mongoose'; import { MongoDBCollection } from '../../../constant'; @Schema({ collection: MongoDBCollection.File }) export class File extends Document { @Prop() type!: number; @Prop() creatorId!: string; @Prop() key!: string; @Prop({ index: true }) name?: string; @Prop() mimeType?: string; @Prop() size!: number; @Prop() groupId!: string; @Prop() projectId!: string; @Prop() resourceType!: string; @Prop() createAt!: Date; @Prop({ index: true }) updateAt!: Date; @Prop() deleted!: boolean; @Prop() width?: number; @Prop() height?: number; @Prop() checkedVersion?: number; } export const fileSchema = SchemaFactory.createForClass(File);