Inital commit
This commit is contained in:
commit
a6af7dbfcb
114 files changed
+27520
No files matched your search
@@ -0,0 +1,51 @@
|
||||
import {
|
||||
Entity,
|
||||
PrimaryGeneratedColumn,
|
||||
Column,
|
||||
ManyToOne,
|
||||
OneToMany,
|
||||
} from "typeorm";
|
||||
|
||||
@Entity()
|
||||
export class IP {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column()
|
||||
ip!: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
data?: string;
|
||||
|
||||
@Column()
|
||||
lastUsed!: Date;
|
||||
|
||||
@Column()
|
||||
firstSeen!: Date;
|
||||
@Column({ nullable: true })
|
||||
lat!: number;
|
||||
|
||||
@Column({ nullable: true })
|
||||
lon?: number;
|
||||
|
||||
@OneToMany(() => IpLog, (log) => log.ipRef)
|
||||
logs!: IpLog[];
|
||||
}
|
||||
|
||||
@Entity()
|
||||
export class IpLog {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column({ nullable: true })
|
||||
url?: string;
|
||||
|
||||
@Column({ nullable: true })
|
||||
userAgent?: string;
|
||||
|
||||
@Column()
|
||||
accessed!: Date;
|
||||
|
||||
@ManyToOne(() => IP, (ip) => ip.logs, { eager: true })
|
||||
ipRef!: IP;
|
||||
}
|
||||
Reference in new issue
Block a user