master
2022-03-16 f5e5d411b38f5819551f9acedef62dcf0832bc2c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { EntityModel } from '@midwayjs/orm';
import { BaseEntity } from '@cool-midway/core';
import { Column, Index } from 'typeorm';
 
/**
 * 系统用户
 */
@EntityModel('t_sys_user')
export class BaseSysUserEntity extends BaseEntity {
  @Index()
  @Column({ comment: '部门ID', type: 'bigint', nullable: true })
  departmentId: number;
 
  @Column({ comment: '姓名', nullable: true })
  name: string;
 
  @Index({ unique: true })
  @Column({ comment: '用户名', length: 100 })
  username: string;
 
  @Column({ comment: '密码' })
  password: string;
 
  @Column({
    comment: '密码版本, 作用是改完密码,让原来的token失效',
    default: 1,
  })
  passwordV: number;
 
  @Column({ comment: '昵称', nullable: true })
  nickName: string;
 
  @Column({ comment: '头像', nullable: true })
  headImg: string;
 
  @Index()
  @Column({ comment: '手机', nullable: true, length: 20 })
  phone: string;
 
  @Column({ comment: '邮箱', nullable: true })
  email: string;
  
  // 部门名称
  departmentName: string;
  // 角色ID列表
  roleIdList: number[];
  
  @Column({ comment: 'socketId', nullable: true })
  socketId: string;
  
  @Column({ comment: '备注', nullable: true })
  remark: string;
 
  @Column({ comment: '状态 0:禁用 1:启用', default: 1, type: 'tinyint' })
  status: number;
}