123456789101112131415161718192021222324 |
- import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
- import { ApiProperty } from '@nestjs/swagger';
- import { classToPlain, Exclude } from 'class-transformer';
- @Entity('user')
- export class UserEntity extends BaseEntity {
- @ApiProperty()
- @PrimaryGeneratedColumn('uuid')
- id: number;
- @ApiProperty()
- @Column({ default: null })
- email: string;
- @ApiProperty()
- @Exclude({ toPlainOnly: true })
- @Column({ default: null })
- password: string;
- toJSON() {
- return classToPlain(this);
- }
- }
|