wangzhibo
7 天以前 665ba0f9ae078c2859209451a163d10515171d11
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index,BeforeInsert } from 'typeorm';
 
/**
 * 用户信息
 */
@Entity('t_school_user_info')
export class UserInfoEntity extends BaseEntity {
  @Index({ unique: true })
  @Column({ comment: '登录唯一ID', nullable: true })
  unionid: string;
 
  @Column({ comment: '头像', nullable: true })
  avatarUrl: string;
 
  @Column({ comment: '昵称', nullable: true })
  nickName: string;
 
  @Index({ unique: true })
  @Column({ comment: '手机号', nullable: true })
  phone: string;
 
  @Column({ comment: '生日', type: 'date', nullable: true })
  birthday: Date;
 
  @Column({ comment: '性别', dict: ['未知', '男', '女'], default: 0 })
  gender: number;
 
  @Index()
  @Column({ comment: '角色', dict: ['老师', '学生', '其他'], default: '学生' })
  role: string;
 
  @Index()
  @Column({ comment: '学校ID' })   // 使用归属部门,这里建议选顶层学校
  departmentId: number;
 
  departmentName: string;
 
  @Index()
  @Column({ comment: '碳积分', default: 0 })
  carbonBalance: number;
 
  @Index()
  @Column({ comment: '学院ID', nullable: true })
  collegeId: number;
 
  @Column({ comment: '学院名称', nullable: true })
  collegeName: string;
 
  @Index()
  @Column({ comment: '专业ID', nullable: true })
  majorId: number;
 
  @Column({ comment: '专业名称', nullable: true })
  majorName: string;
 
  @Index()
  @Column({ comment: '班级ID', nullable: true })
  classId: number;
 
  @Column({ comment: '班级名称', nullable: true })
  className: string;
 
  @Column({ comment: '状态', dict: ['禁用', '正常', '已注销'], default: 1 })
  status: number;
 
  @Column({ comment: '登录方式', dict: ['小程序', '公众号', 'H5'], default: 0 })
  loginType: number;
 
  @Column({ comment: '密码', nullable: true })
  password: string;
 
  @Column({ comment: '介绍', type: 'text', nullable: true })
  description: string;
 
}