123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 |
- 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<CacheUserDTO>
- {
- }
- /// <summary>
- /// 账号信息缓存管理类
- /// </summary>
- public class UserInfoManager : CacheManager<CacheUserDTO>, IUserInfoManager
- {
- public UserInfoManager() : base()
- {
- }
- }
- /// <summary>
- /// 缓存账号信息
- /// </summary>
- public class CacheUserDTO : ICacheObject
- {
- /// <summary>
- /// 用户编码
- /// </summary>
- /// <value></value>
- public string Code { get; set; }
- /// <summary>
- /// 用户名
- /// </summary>
- public string UserName { get; set; }
- /// <summary>
- /// 密码
- /// </summary>
- public string SecretPassword { get; set; }
- /// <summary>
- /// 联系电话
- /// </summary>
- public string Phone { get; set; }
- /// <summary>
- /// 邮箱
- /// </summary>
- public string Email { get; set; }
- /// <summary>
- /// 用户昵称
- /// </summary>
- public string NickName { get; set; }
- /// <summary>
- /// 用户姓名
- /// </summary>
- public string FullName { get; set; }
- /// <summary>
- /// 头像
- /// </summary>
- public string HeadImageUrl { get; set; }
- /// <summary>
- /// 所属组织
- /// </summary>
- public string OrganizationCode { get; set; }
- /// <summary>
- /// 所属权限组
- /// </summary>
- public List<string> AuthorityGroups { get; set; } = new();
- /// <summary>
- /// 绑定设备列表
- /// </summary>
- public List<string> BindDevices { get; set; } = new();
- /// <summary>
- /// 登录次数
- /// </summary>
- /// <value></value>
- public int Logintimes { get; set; }
- /// <summary>
- /// 积分,计算等级
- /// </summary>
- public int Score { get; set; }
- /// <summary>
- /// 最后使用IP地址
- /// </summary>
- public string LastIP { get; set; }
- /// <summary>
- /// 用户状态
- /// </summary>
- /// <value></value>
- public int UserState { get; set; }
- /// <summary>
- /// 岗位身份列表
- /// </summary>
- /// <value></value>
- public List<string> PositionCodes { get; set; } = new();
- /// <summary>
- /// 用户认证角色列表
- /// </summary>
- /// <value></value>
- public List<string> RoleCodes { get; set; } = new();
- /// <summary>
- /// 用户职称列表
- /// </summary>
- /// <value></value>
- public List<string> RankCodes { get; set; } = new();
- /// <summary>
- /// 词条库
- /// </summary>
- /// <value></value>
- public List<string> ThesaurusCodes { get; set; } = new();
- /// <summary>
- /// 擅长领域
- /// </summary>
- /// <value>"test1","test2"</value>
- public List<string> FieldList { get; set; } = new List<string>();
- /// <summary>
- /// 删除的病人
- /// </summary>
- public List<string> DeletePatientCodes { get; set; } = new();
- /// <summary>
- /// 是否开启批量导出分时诊断数据
- /// </summary>
- public bool IsBatchExportDiagnoseData { get; set; }
- /// <summary>
- /// 绑定的助理用户编码
- /// </summary>
- /// <value></value>
- public string BindAssistantUserCode { get; set; }
- /// <summary>
- /// 助理医师用户编码
- /// </summary>
- /// <value></value>
- public string BindAssistantDoctorUserCode { get; set; }
- /// <summary>
- /// 登录失败信息
- /// </summary>
- /// <value></value>
- public LoginLockInfo LoginLockInfo { get; set; }
- /// <summary>
- /// 统一名字展示字段
- /// </summary>
- /// <value></value>
- 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;
- }
- }
- }
- /// <summary>
- ///登录失败信息
- /// </summary>
- public class LoginLockInfo
- {
- /// <summary>
- /// 登录时间
- /// </summary>
- /// <value></value>
- public DateTime LoginDate { get; set; }
- /// <summary>
- /// 同一天的登录错误次数
- /// </summary>
- /// <value></value>
- public int Times { get; set; }
- }
- }
|