forked from anjoy8/Blog.Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsysUserInfo.cs
More file actions
144 lines (118 loc) · 3.62 KB
/
sysUserInfo.cs
File metadata and controls
144 lines (118 loc) · 3.62 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
using SqlSugar;
using System;
using System.Collections.Generic;
namespace Blog.Core.Model.Models
{
/// <summary>
/// 用户信息表
/// </summary>
//[SugarTable("SysUserInfo")]
[SugarTable("SysUserInfo", "用户表")] //('数据库表名','数据库表备注')
public class SysUserInfo : SysUserInfoRoot<long>
{
public SysUserInfo()
{
}
public SysUserInfo(string loginName, string loginPWD)
{
LoginName = loginName;
LoginPWD = loginPWD;
RealName = LoginName;
Status = 0;
CreateTime = DateTime.Now;
UpdateTime = DateTime.Now;
LastErrorTime = DateTime.Now;
ErrorCount = 0;
Name = "";
}
/// <summary>
/// 登录账号
/// </summary>
[SugarColumn(Length = 200, IsNullable = true, ColumnDescription = "登录账号")]
//:eg model 根据sqlsugar的完整定义可以如下定义,ColumnDescription可定义表字段备注
//[SugarColumn(IsNullable = false, ColumnDescription = "登录账号", IsPrimaryKey = false, IsIdentity = false, Length = 50)]
//ColumnDescription 表字段备注, 已在MSSQL测试,配合 [SugarTable("SysUserInfo", "用户表")]//('数据库表名','数据库表备注')
//可以完整生成 表备注和各个字段的中文备注
//2022/10/11
//测试mssql 发现 不写ColumnDescription,写好注释在mssql下也能生成表字段备注
public string LoginName { get; set; }
/// <summary>
/// 登录密码
/// </summary>
[SugarColumn(Length = 200, IsNullable = true)]
public string LoginPWD { get; set; }
/// <summary>
/// 真实姓名
/// </summary>
[SugarColumn(Length = 200, IsNullable = true)]
public string RealName { get; set; }
/// <summary>
/// 状态
/// </summary>
public int Status { get; set; }
/// <summary>
/// 部门
/// </summary>
[SugarColumn(IsNullable = true)]
public long DepartmentId { get; set; } = -1;
/// <summary>
/// 备注
/// </summary>
[SugarColumn(Length = 2000, IsNullable = true)]
public string Remark { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; } = DateTime.Now;
/// <summary>
/// 更新时间
/// </summary>
public DateTime UpdateTime { get; set; } = DateTime.Now;
/// <summary>
/// 关键业务修改时间
/// </summary>
public DateTime CriticalModifyTime { get; set; } = DateTime.Now;
/// <summary>
///最后异常时间
/// </summary>
public DateTime LastErrorTime { get; set; } = DateTime.Now;
/// <summary>
///错误次数
/// </summary>
public int ErrorCount { get; set; }
/// <summary>
/// 登录账号
/// </summary>
[SugarColumn(Length = 200, IsNullable = true)]
public string Name { get; set; }
// 性别
[SugarColumn(IsNullable = true)]
public int Sex { get; set; } = 0;
// 年龄
[SugarColumn(IsNullable = true)]
public int Age { get; set; }
// 生日
[SugarColumn(IsNullable = true)]
public DateTime Birth { get; set; } = DateTime.Now;
// 地址
[SugarColumn(Length = 200, IsNullable = true)]
public string Address { get; set; }
[SugarColumn(DefaultValue = "1")]
public bool Enable { get; set; } = true;
[SugarColumn(IsNullable = true)]
public bool IsDeleted { get; set; }
/// <summary>
/// 租户Id
/// </summary>
[SugarColumn(IsNullable = false, DefaultValue = "0")]
public long TenantId { get; set; }
[Navigate(NavigateType.OneToOne, nameof(TenantId))]
public SysTenant Tenant { get; set; }
[SugarColumn(IsIgnore = true)]
public List<string> RoleNames { get; set; }
[SugarColumn(IsIgnore = true)]
public List<long> Dids { get; set; }
[SugarColumn(IsIgnore = true)]
public string DepartmentName { get; set; }
}
}