修改配置文件数据库默认配置,邮件配置,默认存储路径配置

master
hang 2025-09-25 11:31:27 +08:00
parent a72f446cfd
commit b5e05e9ec6
7 changed files with 86 additions and 45 deletions

View File

@ -18,7 +18,7 @@
</member>
<member name="M:IRaCIS.Api.Controllers.ExtraController.GetDoctorDetail(IRaCIS.Application.Interfaces.IAttachmentService,IRaCIS.Application.Interfaces.IDoctorService,IRaCIS.Application.Interfaces.IEducationService,IRaCIS.Application.Interfaces.ITrialExperienceService,IRaCIS.Application.Interfaces.IResearchPublicationService,IRaCIS.Application.Interfaces.IVacationService,System.Guid)">
<summary>
获取医生详情
</summary>
<param name="attachmentService"></param>
<param name="_doctorService"></param>
@ -30,7 +30,15 @@
<returns></returns>
</member>
<member name="M:IRaCIS.Api.Controllers.ExtraController.Login(IRaCIS.Application.Contracts.UserLoginDTO,EasyCaching.Core.IEasyCachingProvider,IRaCIS.Application.Services.IUserService,IRaCIS.Core.Application.Auth.ITokenService,Microsoft.Extensions.Configuration.IConfiguration)">
<summary> 系统用户登录接口[New] </summary>
<summary>
</summary>
<param name="loginUser"></param>
<param name="provider"></param>
<param name="_userService"></param>
<param name="_tokenService"></param>
<param name="configuration"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.API.Controllers.Special.FinancialChangeController.AddOrUpdateTrial(IRaCIS.Application.Contracts.TrialCommand,IRaCIS.Application.Interfaces.ITrialConfigService)">
<summary> 添加实验项目-返回新增Id[AUTH]</summary>

View File

@ -19,6 +19,7 @@ using System.Text.Json.Nodes;
using Microsoft.EntityFrameworkCore;
using IRaCIS.Core.Infra.EFCore;
using Microsoft.Data.SqlClient;
using IRaCIS.Core.Domain.Share;
namespace IRaCIS.Core.API
{
@ -51,6 +52,8 @@ namespace IRaCIS.Core.API
//Dicom ä¯ÀÀ
//ImageManager.SetImplementation(WinFormsImageManager.Instance);
StaticData.CurrentEnvName = enviromentName;
var host = CreateHostBuilder(args)
.UseEnvironment(enviromentName) //ÃüÁîÐд«Èë»·¾³
.ConfigureAppConfiguration((hostContext, config) =>
@ -64,6 +67,7 @@ namespace IRaCIS.Core.API
NewId.SetProcessIdProvider(new CurrentProcessIdProvider());

View File

@ -96,8 +96,14 @@ namespace IRaCIS.Core.API
services.AddOptions().Configure<SystemEmailSendConfig>( _configuration.GetSection("SystemEmailSendConfig"));
services.AddOptions().Configure<ServiceVerifyConfigOption>(_configuration.GetSection("BasicSystemConfig"));
StaticData.SystemBasicConfig = new ServiceVerifyConfigOption();
// 同时绑定到静态对象,方便全局访问
_configuration.GetSection("BasicSystemConfig")
.Bind(StaticData.SystemBasicConfig);
Console.WriteLine(StaticData.SystemBasicConfig);
//动态WebApi + UnifiedApiResultFilter 省掉控制器代码
services.AddDynamicWebApiSetup();
//AutoMapper

View File

@ -7,25 +7,25 @@
}
},
"ConnectionStrings": {
"RemoteNew": "Server=192.168.3.68,1434;Database=Test_510K;User ID=sa;Password=xc@123456;TrustServerCertificate=true"
"RemoteNew": "Server=192.168.3.68,1434;Database=LiLi_DB;User ID=Lili_User;Password=Eleveta@2025;TrustServerCertificate=true"
},
"BasicSystemConfig": {
"OpenUserComplexPassword": true,
"OpenSignDocumentBeforeWork": false,
"OpenLoginLimit": true,
"OpenTrialRelationDelete": true,
"OpenCustomStoragePathConfig": false,
"OpenLoginLimit": true
"FileStoragePath": ""
},
"SystemEmailSendConfig": {
"Port": 465,
"Host": "smtp.qiye.aliyun.com",
"FromEmail": "test@extimaging.com",
"Port": 587,
"Host": "smtp-mail.outlook.com",
"FromEmail": "donotreply@elevateimaging.ai",
"FromName": "LiLi DICOM Viewer",
"AuthorizationCode": "SHzyyl2021"
"AuthorizationCode": "Q#669869497420ul"
}
}

View File

@ -52,9 +52,24 @@ public static class FileStoreHelper
//API vue 部署目录
public static string GetIRaCISRootPath(IWebHostEnvironment _hostEnvironment)
{
if (StaticData.SystemBasicConfig.OpenCustomStoragePathConfig)
{
var rootPath = StaticData.SystemBasicConfig.FileStoragePath;
if (!Directory.Exists(rootPath))
{
throw new BusinessValidationFailedException($"{rootPath} not exist");
}
return rootPath;
}
else
{
var rootPath = (Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\'))).IfNullThrowException().FullName;
return rootPath;
}
}

View File

@ -32,6 +32,10 @@ namespace IRaCIS.Core.Domain.Share
public bool OpenTrialRelationDelete { get; set; }
public bool OpenLoginLimit { get; set; }
public bool OpenCustomStoragePathConfig { get; set; }
public string FileStoragePath { get; set; } = "";
}
public class SystemEmailSendConfig
@ -80,6 +84,8 @@ namespace IRaCIS.Core.Domain.Share
public static readonly string DefaultPassword = "123456";
static AppSettings()
{
var configuration = new ConfigurationBuilder()

View File

@ -3,7 +3,9 @@
public static class StaticData
{
public static string CurrentEnvName { get; set; }
public static ServiceVerifyConfigOption SystemBasicConfig { get; set; }
#region 字典表项固定值
public static readonly string Title = "Title";