schangxiang@126.com
2024-09-10 429923d78ca4a016ab86adf30d189eb0e7774925
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
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
 
namespace iWare.Wms.Core
{
    /// <summary>
    /// 在线用户表
    /// </summary>
    [Table("sys_online_user")]
    [Comment("在线用户表")]
    public class OnlineUser //: IEntity, IEntityTypeBuilder<OnlineUser>
    {
        /// <summary>
        /// 连接Id
        /// </summary>
        [Comment("连接Id")]
        public string ConnectionId { get; set; }
 
        /// <summary>
        /// 用户Id
        /// </summary>
        [Comment("用户Id")]
        public long UserId { get; set; }
 
        /// <summary>
        /// 账号
        /// </summary>
        [Comment("账号")]
        [Required, MaxLength(20)]
        public string Account { get; set; }
 
        /// <summary>
        /// 姓名
        /// </summary>
        [Comment("姓名")]
        [MaxLength(20)]
        public string Name { get; set; }
 
        /// <summary>
        /// 最后连接时间
        /// </summary>
        [Comment("最近时间")]
        public DateTimeOffset LastTime { get; set; }
 
        /// <summary>
        /// 最后登录IP
        /// </summary>
        [Comment("最后登录IP")]
        [MaxLength(50)]
        public string LastLoginIp { get; set; }
 
        /// <summary>
        /// 最后登录所用浏览器
        /// </summary>
        [Comment("最后登录所用浏览器")]
        [MaxLength(20)]
        public string LastLoginBrowser { get; set; }
 
        /// <summary>
        /// 最后登录所用系统
        /// </summary>
        [Comment("最后登录所用系统")]
        [MaxLength(20)]
        public string LastLoginOs { get; set; }
 
        /// <summary>
        /// 租户id
        /// </summary>
        //[Comment("租户id")]
        //public long TenantId { get; set; }
 
        public void Configure(EntityTypeBuilder<OnlineUser> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {
            entityBuilder.HasKey(c => new { c.UserId });
        }
    }
}