using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; namespace WingServerCommon.Interfaces.Cache { public interface IUserInfoManager : IBaseCacheManager { } /// /// 账号信息缓存管理类 /// public class UserInfoManager : CacheManager, IUserInfoManager { public UserInfoManager() : base() { } } /// /// 缓存账号信息 /// public class CacheUserDTO : ICacheObject { /// /// 用户编码 /// /// public string Code { get; set; } /// /// 用户名 /// public string UserName { get; set; } /// /// 密码 /// public string SecretPassword { get; set; } /// /// 联系电话 /// public string Phone { get; set; } /// /// 邮箱 /// public string Email { get; set; } /// /// 用户昵称 /// public string NickName { get; set; } /// /// 用户姓名 /// public string FullName { get; set; } /// /// 头像 /// public string HeadImageUrl { get; set; } /// /// 所属组织 /// public string OrganizationCode { get; set; } /// /// 所属权限组 /// public List AuthorityGroups { get; set; } = new(); /// /// 绑定设备列表 /// public List BindDevices { get; set; } = new(); /// /// 登录次数 /// /// public int Logintimes { get; set; } /// /// 积分,计算等级 /// public int Score { get; set; } /// /// 最后使用IP地址 /// public string LastIP { get; set; } /// /// 用户状态 /// /// public int UserState { get; set; } /// /// 岗位身份列表 /// /// public List PositionCodes { get; set; } = new(); /// /// 用户认证角色列表 /// /// public List RoleCodes { get; set; } = new(); /// /// 用户职称列表 /// /// public List RankCodes { get; set; } = new(); /// /// 词条库 /// /// public List ThesaurusCodes { get; set; } = new(); /// /// 擅长领域 /// /// "test1","test2" public List FieldList { get; set; } = new List(); /// /// 删除的病人 /// public List DeletePatientCodes { get; set; } = new(); /// /// 是否开启批量导出分时诊断数据 /// public bool IsBatchExportDiagnoseData { get; set; } /// /// 绑定的助理用户编码 /// /// public string BindAssistantUserCode { get; set; } /// /// 助理医师用户编码 /// /// public string BindAssistantDoctorUserCode { get; set; } /// /// 登录失败信息 /// /// public LoginLockInfo LoginLockInfo { get; set; } /// /// 统一名字展示字段 /// /// public string DisplayName { get { var name = string.IsNullOrWhiteSpace(FullName) ? UserName : FullName; if(Regex.IsMatch(name,"[0-9A-Z]{32}") && !string.IsNullOrWhiteSpace(Phone)) { name = Phone; } if(Regex.IsMatch(name,"[0-9A-Z]{32}") && !string.IsNullOrWhiteSpace(Email)) { name = Email; } return name; } } } /// ///登录失败信息 /// public class LoginLockInfo { /// /// 登录时间 /// /// public DateTime LoginDate { get; set; } /// /// 同一天的登录错误次数 /// /// public int Times { get; set; } } }