52 lines
1.1 KiB
C#
52 lines
1.1 KiB
C#
using Common.Models.UnqTables;
|
|
using ProtoBuf;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Server.MyClass.Class
|
|
{
|
|
[ProtoContract]
|
|
public class UserSession
|
|
{
|
|
public UserSession(Staff User)
|
|
{
|
|
this.Uid = User.Id;
|
|
this.Token = Guid.NewGuid().ToString();
|
|
this.LoginTime = DateTime.Now;
|
|
this.RoleId = User.RoleId;
|
|
this.UserName = User.Username;
|
|
}
|
|
|
|
public UserSession()
|
|
{
|
|
|
|
}
|
|
|
|
public int RoleId { get; set; }
|
|
|
|
/// <summary>
|
|
/// 是否是超级管理员
|
|
/// </summary>
|
|
public bool IsCreator { get; set; }
|
|
|
|
public int Uid { get; set; }
|
|
|
|
public string UserName { get; set; }
|
|
|
|
/// <summary>
|
|
/// 登录时间
|
|
/// </summary>
|
|
public DateTime LoginTime { get; set; }
|
|
/// <summary>
|
|
/// 请求时间
|
|
/// </summary>
|
|
public DateTime RequestTime { get; set; }
|
|
|
|
public string Token { get; set; }
|
|
|
|
}
|
|
}
|