mirror of
https://github.com/MrSedan/neuro-reply-website.git
synced 2026-01-14 20:49:42 +03:00
Merge branch 'entitysEndpoints' into dev
This commit is contained in:
22
backend/libs/database/payment.entity.ts
Normal file
22
backend/libs/database/payment.entity.ts
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm';
|
||||||
|
import { ProxyUser } from './proxy_user.entity';
|
||||||
|
|
||||||
|
@Entity()
|
||||||
|
export class Payment {
|
||||||
|
constructor(props?: Partial<Payment>) {
|
||||||
|
Object.assign(this, props);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PrimaryGeneratedColumn('increment')
|
||||||
|
public id!: number;
|
||||||
|
|
||||||
|
@Column()
|
||||||
|
public user_uuid!: string;
|
||||||
|
|
||||||
|
@Column({ type: 'timestamptz' })
|
||||||
|
public payTime!: Date;
|
||||||
|
|
||||||
|
@ManyToOne(() => ProxyUser, { onDelete: 'CASCADE' })
|
||||||
|
@JoinColumn({ name: 'user_uuid' })
|
||||||
|
user: ProxyUser;
|
||||||
|
}
|
||||||
31
backend/libs/database/proxy_user.entity.ts
Normal file
31
backend/libs/database/proxy_user.entity.ts
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
import { Column, Entity, JoinColumn, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
|
||||||
|
import { User } from './user.entity';
|
||||||
|
|
||||||
|
@Entity()
|
||||||
|
export class ProxyUser {
|
||||||
|
constructor(props?: Partial<ProxyUser>) {
|
||||||
|
Object.assign(this, props);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PrimaryGeneratedColumn('uuid')
|
||||||
|
public uuid!: string;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
public userName: string;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
public description: string;
|
||||||
|
|
||||||
|
@Column({ nullable: false })
|
||||||
|
public link!: string;
|
||||||
|
|
||||||
|
@Column({ nullable: false, type: 'timestamptz' })
|
||||||
|
public connectDate!: Date;
|
||||||
|
|
||||||
|
@Column({ nullable: true })
|
||||||
|
public user_id!: string;
|
||||||
|
|
||||||
|
@OneToOne(() => User, (user) => user.id, { onDelete: 'CASCADE', onUpdate: 'CASCADE', nullable: true })
|
||||||
|
@JoinColumn({ name: 'user_id' })
|
||||||
|
public user: User;
|
||||||
|
}
|
||||||
@@ -4,8 +4,10 @@ import { User } from './database/user.entity';
|
|||||||
import { Admin } from './database/admin.entity';
|
import { Admin } from './database/admin.entity';
|
||||||
import { Post } from './database/post.entity';
|
import { Post } from './database/post.entity';
|
||||||
import { Image } from './database/image.entity';
|
import { Image } from './database/image.entity';
|
||||||
|
import { Payment } from './database/payment.entity';
|
||||||
|
import { ProxyUser } from './database/proxy_user.entity';
|
||||||
@Module({
|
@Module({
|
||||||
imports: [TypeOrmModule.forFeature([User, Admin, Post, Image])],
|
imports: [TypeOrmModule.forFeature([User, Admin, Post, Image, Payment, ProxyUser])],
|
||||||
exports: [TypeOrmModule],
|
exports: [TypeOrmModule],
|
||||||
})
|
})
|
||||||
export class LibsModule {}
|
export class LibsModule {}
|
||||||
|
|||||||
Reference in New Issue
Block a user