83 lines
1.6 KiB
TypeScript
83 lines
1.6 KiB
TypeScript
// // import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
|
|
// import {Entity, PrimaryGeneratedColumn, Column} from 'typeorm';
|
|
|
|
// @Entity()
|
|
// export class User {
|
|
// @PrimaryGeneratedColumn()
|
|
// id: number;
|
|
|
|
// @Column()
|
|
// nickName: string;
|
|
|
|
// @Column()
|
|
// Password: string;
|
|
|
|
// @Column()
|
|
// email: string;
|
|
|
|
// @Column()
|
|
// password: string;
|
|
|
|
// @Column()
|
|
// win: number;
|
|
|
|
// @Column()
|
|
// loose: number;
|
|
|
|
// // friend
|
|
// // joined chat
|
|
// // jsp
|
|
// // prout
|
|
// }
|
|
|
|
// base.entity.ts
|
|
// @PrimaryGeneratedColumn('uuid')
|
|
// id: string;
|
|
|
|
// @Column({ type: 'boolean', default: true })
|
|
// isActive: boolean;
|
|
|
|
// @Column({ type: 'boolean', default: false })
|
|
// isArchived: boolean;
|
|
|
|
// @CreateDateColumn({ type: 'timestamptz', default: () => 'CURRENT_TIMESTAMP' })
|
|
// createDateTime: Date;
|
|
|
|
// @Column({ type: 'varchar', length: 300 })
|
|
// createdBy: string;
|
|
|
|
// @UpdateDateColumn({ type: 'timestamptz', default: () => 'CURRENT_TIMESTAMP' })
|
|
// lastChangedDateTime: Date;
|
|
|
|
// @Column({ type: 'varchar', length: 300 })
|
|
// lastChangedBy: string;
|
|
|
|
// @Column({ type: 'varchar', length: 300, nullable: true })
|
|
// internalComment: string | null;
|
|
import { PrimaryGeneratedColumn, Column, UpdateDateColumn, CreateDateColumn } from 'typeorm';
|
|
|
|
export abstract class BaseEntity {
|
|
@PrimaryGeneratedColumn()
|
|
id: number;
|
|
|
|
@Column({ nullable: true })
|
|
nickname: string;
|
|
|
|
@Column({ nullable: true })
|
|
password: string;
|
|
|
|
@Column({ nullable: true })
|
|
email: string;
|
|
|
|
// @Column({ nullable: true })
|
|
// password: string;
|
|
|
|
@Column({ default: 0 })
|
|
win: number;
|
|
|
|
@Column({ default: 0 })
|
|
loose: number;
|
|
|
|
@Column({ default: 0 })
|
|
rank: number;
|
|
} |