import { BaseEntity } from 'src/common/entities/base.entity';
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';

@Entity()
export class User extends BaseEntity {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @Column({ comment: '用户名', unique: true })
  username: string;

  @Column({ default: '123456', select: false, comment: '密码' })
  password: string;

  @Column({ comment: '姓名' })
  name: string;

  @Column({ nullable: true, comment: '照片，对应resource表的ID' })
  photo: number;

  @Column({ nullable: true, comment: '性别：0/女，1/男' })
  sex: number;

  @Column({ nullable: true, comment: '出生年月' })
  birthday: Date;

  @Column({ nullable: true, comment: '身份证号' })
  idcard: string;

  @Column({ nullable: true, comment: '职位' })
  identity: string;

  @Column({ nullable: true, comment: '电话' })
  phone: string;

  @Column({ nullable: true, comment: '邮箱' })
  email: string;

  @Column({ name: 'role_id', comment: '角色 ID' })
  roleId: number;

  @Column({ nullable: true, name: 'org_id', comment: '组织机构 ID' })
  orgId: number;

  @Column({ nullable: true, name: 'org_ids', comment: '多级组织机构 ID ' })
  orgIds: string;
}
