2018-03-31 03:30:30 +08:00
|
|
|
import {Column, Entity, ManyToOne, PrimaryGeneratedColumn} from 'typeorm';
|
|
|
|
import {SharingDTO} from '../../../../common/entities/SharingDTO';
|
|
|
|
import {UserEntity} from './UserEntity';
|
|
|
|
import {UserDTO} from '../../../../common/entities/UserDTO';
|
2017-07-04 01:17:49 +08:00
|
|
|
|
|
|
|
@Entity()
|
|
|
|
export class SharingEntity implements SharingDTO {
|
2019-01-28 03:36:42 +08:00
|
|
|
@PrimaryGeneratedColumn({unsigned: true})
|
2017-07-04 01:17:49 +08:00
|
|
|
id: number;
|
|
|
|
|
2017-10-20 00:08:07 +08:00
|
|
|
@Column()
|
2017-07-04 01:17:49 +08:00
|
|
|
sharingKey: string;
|
|
|
|
|
2017-10-20 00:08:07 +08:00
|
|
|
@Column()
|
2017-07-04 01:17:49 +08:00
|
|
|
path: string;
|
|
|
|
|
2018-03-31 03:30:30 +08:00
|
|
|
@Column({type: 'text', nullable: true})
|
2017-07-04 01:17:49 +08:00
|
|
|
password: string;
|
|
|
|
|
2019-01-28 03:36:42 +08:00
|
|
|
@Column('bigint', {
|
|
|
|
unsigned: true, transformer: {
|
|
|
|
from: v => parseInt(v, 10),
|
|
|
|
to: v => v
|
|
|
|
}
|
|
|
|
})
|
2017-07-04 01:17:49 +08:00
|
|
|
expires: number;
|
|
|
|
|
2019-01-28 03:36:42 +08:00
|
|
|
@Column('bigint', {
|
|
|
|
unsigned: true, transformer: {
|
|
|
|
from: v => parseInt(v, 10),
|
|
|
|
to: v => v
|
|
|
|
}
|
|
|
|
})
|
2017-07-04 01:17:49 +08:00
|
|
|
timeStamp: number;
|
|
|
|
|
2017-10-20 00:08:07 +08:00
|
|
|
@Column()
|
2017-07-04 01:17:49 +08:00
|
|
|
includeSubfolders: boolean;
|
|
|
|
|
|
|
|
@ManyToOne(type => UserEntity)
|
|
|
|
creator: UserDTO;
|
|
|
|
}
|