using IRaCIS.Core.Domain.Models; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration.Json; using System.Collections.Generic; namespace IRaCIS.Core.Domain.Share { /// /// 多环境 配置环境实体 /// public class ServiceVerifyConfigOption { public bool OpenUserComplexPassword { get; set; } public bool OpenSignDocumentBeforeWork { get; set; } public bool OpenTrialRelationDelete { get; set; } public bool OpenLoginLimit { get; set; } public int LoginMaxFailCount { get; set; } public int LoginFailLockMinutes { get; set; } public int AutoLoginOutMinutes { get; set; } public bool OpenLoginMFA { get; set; } /// /// 连续阅片时间 (min) /// public int ContinuousReadingTimeMin { get; set; } /// /// 休息时间 (min) /// public int ReadingRestTimeMin { get; set; } /// /// 是否需要修改密码 /// public bool IsNeedChangePassWord { get; set; } /// /// 修改密码的天数 /// public int ChangePassWordDays { get; set; } } public class SystemEmailSendConfig { public int Port { get; set; } public string Host { get; set; } = string.Empty; public string FromEmail { get; set; } = string.Empty; public string FromName { get; set; } = string.Empty; public string AuthorizationCode { get; set; } = string.Empty; public string SiteUrl { get; set; } = string.Empty; public string OrganizationName { get; set; } = string.Empty; public string OrganizationNameCN { get; set; } = string.Empty; public string CompanyName { get; set; } = string.Empty; public string CompanyNameCN { get; set; } = string.Empty; public string CompanyShortName { get; set; } = string.Empty; public string CompanyShortNameCN { get; set; } = string.Empty; } public class SystemEmailSendConfigView { public string CompanyName { get; set; } = string.Empty; public string CompanyNameCN { get; set; } = string.Empty; public string CompanyShortName { get; set; } = string.Empty; public string CompanyShortNameCN { get; set; } = string.Empty; } public class SystemPacsConfig { public int Port { get; set; } public string IP { get; set; }=string.Empty; } public class IRCEncreptOption { public string Base64RSAPublicKey { get; set;} public string Base64RSAPrivateKey { get; set; } public bool IsResponseEncreptEnable { get; set; } public List ApiPathList { get; set; } } public class IRaCISBasicConfigOption { public string DoctorCodePrefix { get; set; } public string UserCodePrefix { get; set; } public string QCChallengeCodePrefix { get; set; } public string DicomStudyCodePrefix { get; set; } public string TaskStudyCodePrefix { get; set; } public string NoneDicomStudyCodePrefix { get; set; } public int ImageShareExpireDays { get; set; } public string SystemSiteCodePrefix { get; set; } public string BlindTaskPrefix { get; set; } public string DefaultPassword { get; set; } } /// /// 项目基础配置规则 /// public static class AppSettings { public static IRaCISBasicConfigOption IRaCISBasicConfig { get; set; } static AppSettings() { var configuration = new ConfigurationBuilder() .Add(new JsonConfigurationSource { Path = "appsettings.json", ReloadOnChange = true }) .Build(); // 手动绑定配置 var appSettings = new IRaCISBasicConfigOption(); configuration.GetSection("IRaCISBasicConfig").Bind(appSettings); IRaCISBasicConfig = appSettings; } //获取实体编码字符串 public static string GetCodeStr(int codeInt, string typeStr) { switch (typeStr) { case nameof(Doctor): return IRaCISBasicConfig.DoctorCodePrefix + codeInt.ToString("D4"); case nameof(User): return IRaCISBasicConfig.UserCodePrefix + codeInt.ToString("D4"); case nameof(QCChallenge): return IRaCISBasicConfig.QCChallengeCodePrefix + codeInt.ToString("D5"); case nameof(NoneDicomStudy): return IRaCISBasicConfig.NoneDicomStudyCodePrefix + codeInt.ToString("D5"); case nameof(DicomStudy): return IRaCISBasicConfig.DicomStudyCodePrefix + codeInt.ToString("D5"); case nameof(TaskStudy): return IRaCISBasicConfig.TaskStudyCodePrefix + codeInt.ToString("D5"); case nameof(VisitTask): return "W" + codeInt.ToString("D5"); case nameof(Site): return IRaCISBasicConfig.SystemSiteCodePrefix + codeInt.ToString("D4"); default: return string.Empty; } } } }