import { IncrementIdEntity } from 'src/common/entities/increment-id.entity';
import { Column, Entity } from 'typeorm';

/**
 * 资源
 */
@Entity()
export class Resource extends IncrementIdEntity {
  @Column({ comment: '文件名' })
  name: string;

  @Column({ nullable: true, comment: '文件扩展' })
  ext: string;

  @Column({ comment: '文件类型，folder:文件夹' })
  type: string;

  @Column({ nullable: true, comment: '媒体类型' })
  mimetype: string;

  @Column({ nullable: true, comment: '文件大小' })
  size: number;

  @Column({ default: '/', comment: '路径' })
  path: string;

  @Column({ nullable: true, comment: '存储在磁盘上的名称' })
  diskname: string;

  @Column({ nullable: true, comment: '预览文件' })
  preview: string;

  @Column({ nullable: true, name: 'classify_id', comment: '分类ID' })
  classifyId: number;

  @Column({ nullable: true, name: 'classify_ids', comment: '分类ID集合' })
  classifyIds: string;
  @Column({ name: 'share', comment: '是否共享', default: 0 })
  share: string;
}
