diff --git a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs index f8a017c5b..7b48775da 100644 --- a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs +++ b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs @@ -228,7 +228,6 @@ namespace IRaCIS.Core.API.Controllers } - [HttpPost, Route("Study/PreArchiveStudy")] [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] public async Task PreArchiveStudy(PreArchiveStudyCommand preArchiveStudyCommand, @@ -264,12 +263,6 @@ namespace IRaCIS.Core.API.Controllers } - //public string UploadOOSTest(string filePath, string route) - //{ - - //} - - /// Dicom 归档 [HttpPost, Route("Study/ArchiveStudy")] [DisableFormValueModelBinding] @@ -443,260 +436,43 @@ namespace IRaCIS.Core.API.Controllers } - - - - - /// - /// 上传临床数据 多文件 - /// - /// - /// - [HttpPost("ClinicalData/UploadVisitClinicalData/{trialId:guid}/{subjectVisitId:guid}")] - [DisableRequestSizeLimit] - //[Authorize(Policy = IRaCISPolicy.CRC)] - [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] - - public async Task UploadVisitClinicalData(Guid subjectVisitId) + public class UploadNoneDicomFileCommand { - await _qCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId); - var sv = _repository.Where(t => t.Id == subjectVisitId).Select(t => new { t.TrialId, t.SiteId, t.SubjectId }).FirstOrDefault().IfNullThrowException(); + public Guid TrialId { get; set; } + public Guid SubjectVisitId { get; set; } + public Guid NoneDicomStudyId { get; set; } + public Guid StudyMonitorId { get; set; } - await FileUploadAsync(async (fileName) => + + public List UploadedFileList { get; set; } = new List(); + + + public class OSSFileDTO { - var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetClinicalDataPath(_hostEnvironment, fileName, sv.TrialId, sv.SiteId, sv.SubjectId, subjectVisitId); - //插入临床pdf 路径 - await _repository.AddAsync(new PreviousPDF() - { - SubjectVisitId = subjectVisitId, - - IsVisist = true, - DataType = ClinicalDataType.MedicalHistory, - UploadType = ClinicalUploadType.PDF, - SubjectId = sv.SubjectId, - TrialId = sv.TrialId, - ClinicalLevel = ClinicalLevel.Subject, - Path = relativePath, - FileName = fileRealName - }); - return serverFilePath; - }); - await _repository.SaveChangesAsync(); - return ResponseOutput.Ok(); - + public string FilePath { get; set; } + public string FileName { get; set; } + public int FileFize { get; set; } + } } - /// - /// 上传临床数据模板 - /// - /// - /// - [HttpPost("ClinicalData/UploadClinicalTemplate")] - [DisableRequestSizeLimit] - [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "BeforeOngoingCantOpt", "AfterStopCannNotOpt" })] - - - public async Task>> UploadClinicalTemplate(Guid? trialId) - { - if (trialId == null) - trialId = default(Guid); - - var filerelativePath = string.Empty; - List fileDtos = new List(); - await FileUploadAsync(async (fileName) => - { - var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetClinicalTemplatePath(_hostEnvironment, fileName, trialId.Value); - //插入临床pdf 路径 - filerelativePath = relativePath; - - fileDtos.Add(new FileDto() - { - FileName = fileName, - Path = relativePath - - }); - await Task.CompletedTask; - return serverFilePath; - }); - - return ResponseOutput.Ok(fileDtos); - } - - - - /// - /// 上传阅片临床数据 - /// - /// - /// - /// - /// - [HttpPost("ClinicalData/UploadClinicalData/{trialId:guid}/{subjectId:guid}/{readingId:guid}")] - [DisableRequestSizeLimit] - [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] - - public async Task>> UploadReadClinicalData(Guid trialId, Guid subjectId, Guid readingId) - { - var filerelativePath = string.Empty; - List fileDtos = new List(); - - var siteid = await _repository.Where(x => x.Id == subjectId).Select(x => x.SiteId).FirstOrDefaultAsync(); - - await FileUploadAsync(async (fileName) => - { - var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetReadClinicalDataPath(_hostEnvironment, fileName, trialId, siteid, subjectId, readingId); - //插入临床pdf 路径 - filerelativePath = relativePath; - - fileDtos.Add(new FileDto() - { - FileName = fileName, - Path = relativePath - - }); - await Task.CompletedTask; - return serverFilePath; - }); - - return ResponseOutput.Ok(fileDtos); - - } - - - /// - /// 上传截图 - /// - /// - /// - [HttpPost("Printscreen/UploadPrintscreen/{subjectId:guid}")] - [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] - public async Task> UploadPrintscreen(Guid subjectId) - { - - var subjectInfo = await this._repository.Where(x => x.Id == subjectId).FirstNotNullAsync(); - - FileDto fileDto = new FileDto(); - await FileUploadAsync(async (fileName) => - { - var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetUploadPrintscreenFilePath(_hostEnvironment, fileName, subjectInfo.TrialId, subjectInfo.SiteId, subjectInfo.Id); - fileDto.Path = relativePath; - fileDto.FileName = fileName; - await Task.CompletedTask; - return serverFilePath; - }); - - - return ResponseOutput.Ok(fileDto); - } - - - /// - /// 上传Reading问题的图像 - /// - /// - /// - /// - [HttpPost("VisitTask/UploadReadingAnswerImage/{trialId:guid}/{visitTaskId:guid}")] - [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] - public async Task> UploadReadingAnswerImage(Guid trialId, Guid visitTaskId) - { - - FileDto fileDto = new FileDto(); - await FileUploadAsync(async (fileName) => - { - var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetFilePath(_hostEnvironment, fileName, trialId, visitTaskId, StaticData.Folder.JudgeTask); - fileDto.Path = relativePath; - fileDto.FileName = fileName; - await Task.CompletedTask; - return serverFilePath; - }); - - - return ResponseOutput.Ok(fileDto); - } - - /// - /// 上传裁判任务的图像 - /// - /// - /// - /// - [HttpPost("VisitTask/UploadJudgeTaskImage/{trialId:guid}/{visitTaskId:guid}")] - [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] - public async Task> UploadJudgeTaskImage(Guid trialId, Guid visitTaskId) - { - - FileDto fileDto = new FileDto(); - await FileUploadAsync(async (fileName) => - { - var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetFilePath(_hostEnvironment, fileName, trialId, visitTaskId, StaticData.Folder.JudgeTask); - fileDto.Path = relativePath; - fileDto.FileName = fileName; - - await Task.CompletedTask; - - return serverFilePath; - }); - - return ResponseOutput.Ok(fileDto); - } - - - - /// - /// 上传医学审核图片 - /// - /// - /// - /// - [HttpPost("TaskMedicalReview/UploadMedicalReviewImage/{trialId:guid}/{taskMedicalReviewId:guid}")] - [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] - public async Task> UploadMedicalReviewImage(Guid trialId, Guid taskMedicalReviewId) - { - string path = string.Empty; - FileDto fileDto = new FileDto(); - await FileUploadAsync(async (fileName) => - { - - var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetMedicalReviewImage(_hostEnvironment, fileName, trialId, taskMedicalReviewId); - - - //await _repository.UpdatePartialFromQueryAsync(x => x.Id == taskMedicalReviewId, x => new TaskMedicalReview() - //{ - // ImagePath = relativePath, - // FileName = fileName, - //}); - - path = relativePath; - fileDto.Path = relativePath; - fileDto.FileName = fileName; - return serverFilePath; - }); - - await _repository.SaveChangesAsync(); - return ResponseOutput.Ok(fileDto); - } - - - /// /// 上传非Dicom 文件 支持压缩包 多文件上传 /// - /// - /// - /// - /// /// /// //[DisableRequestSizeLimit] - [RequestSizeLimit(1_073_741_824)] - [HttpPost("NoneDicomStudy/UploadNoneDicomFile/{trialId:guid}/{subjectVisitId:guid}/{noneDicomStudyId:guid}/{studyMonitorId:guid}")] + [HttpPost("NoneDicomStudy/UploadNoneDicomFile")] [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] //[Authorize(Policy = IRaCISPolicy.CRC)] - public async Task UploadNoneDicomFile(IFormCollection formCollection, Guid subjectVisitId, Guid noneDicomStudyId, Guid studyMonitorId, + public async Task UploadNoneDicomFile(UploadNoneDicomFileCommand incommand, [FromServices] IRepository _noneDicomStudyRepository, [FromServices] IRepository _studyMonitorRepository) { + var subjectVisitId = incommand.SubjectVisitId; + var studyMonitorId = incommand.StudyMonitorId; + var noneDicomStudyId = incommand.NoneDicomStudyId; + + await _qCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId); var sv = (await _repository.Where(t => t.Id == subjectVisitId).Select(t => new { t.TrialId, t.SiteId, t.SubjectId }).FirstOrDefaultAsync()).IfNullThrowConvertException(); @@ -705,33 +481,24 @@ namespace IRaCIS.Core.API.Controllers studyMonitor.UploadFinishedTime = DateTime.Now; - await FileUploadAsync(async (fileName) => + foreach (var item in incommand.UploadedFileList) { + await _repository.AddAsync(new NoneDicomStudyFile() { FileName = item.FileName, Path = item.FilePath, NoneDicomStudyId = noneDicomStudyId }); - var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetNoneDicomFilePath(_hostEnvironment, fileName, sv.TrialId, sv.SiteId, sv.SubjectId, subjectVisitId); - - await _repository.AddAsync(new NoneDicomStudyFile() { FileName = fileRealName, Path = relativePath, NoneDicomStudyId = noneDicomStudyId }); - - return serverFilePath; - }); - + } var uploadFinishedTime = DateTime.Now; - - //// 上传非Dicom 后 将状态改为待提交 分为普通上传 和QC后重传 普通上传时才改为待提交 - //await _repository.UpdatePartialFromQueryAsync(t => t.Id == subjectVisitId && t.SubmitState == SubmitStateEnum.None, u => new SubjectVisit() { SubmitState = SubmitStateEnum.ToSubmit }); - var noneDicomStudy = await _noneDicomStudyRepository.FirstOrDefaultAsync((t => t.Id == noneDicomStudyId)); - noneDicomStudy.FileCount = noneDicomStudy.FileCount + formCollection.Files.Count; + noneDicomStudy.FileCount = noneDicomStudy.FileCount + incommand.UploadedFileList.Count; - studyMonitor.FileCount = formCollection.Files.Count; - studyMonitor.FileSize = formCollection.Files.Sum(t => t.Length); + studyMonitor.FileCount = incommand.UploadedFileList.Count; + studyMonitor.FileSize = incommand.UploadedFileList.Sum(t => t.FileFize); studyMonitor.IsDicom = false; studyMonitor.IsDicomReUpload = false; studyMonitor.StudyId = noneDicomStudyId; studyMonitor.StudyCode = noneDicomStudy.StudyCode; - studyMonitor.ArchiveFinishedTime = DateTime.Now; + studyMonitor.ArchiveFinishedTime = DateTime.Now; studyMonitor.IP = _userInfo.IP; await _repository.SaveChangesAsync(); @@ -742,6 +509,7 @@ namespace IRaCIS.Core.API.Controllers + /// /// 一致性核查 excel上传 支持三种格式 /// @@ -982,9 +750,6 @@ namespace IRaCIS.Core.API.Controllers } - - - /// /// 上传文件( 不是医生个人的文件)[FileUpload] /// 例如:阅片章程等 @@ -1057,8 +822,6 @@ namespace IRaCIS.Core.API.Controllers } - - [HttpPost, Route("enroll/downloadResume/{trialId:guid}/{language}")] [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] [AllowAnonymous] @@ -1068,6 +831,7 @@ namespace IRaCIS.Core.API.Controllers return ResponseOutput.Ok(zipPath); } + } #endregion @@ -1084,8 +848,6 @@ namespace IRaCIS.Core.API.Controllers private readonly IWebHostEnvironment _hostEnvironment; - - public UploadDownLoadController(IMapper mapper, IUserInfo userInfo, IMediator mediator, IWebHostEnvironment hostEnvironment) { _hostEnvironment = hostEnvironment; @@ -1094,104 +856,6 @@ namespace IRaCIS.Core.API.Controllers _userInfo = userInfo; } - /// 缩略图 - [AllowAnonymous] - [HttpGet("Common/LocalFilePreview")] - public async Task LocalFilePreview(string relativePath) - { - - var _fileStorePath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, relativePath); - - var storePreviewPath = _fileStorePath + ".preview.jpeg"; - - if (!System.IO.File.Exists(storePreviewPath)) - { - ImageHelper.ResizeSave(_fileStorePath, storePreviewPath); - } - - return new FileContentResult(await System.IO.File.ReadAllBytesAsync(storePreviewPath), "image/jpeg"); - - } - - - /// 通用文件下载 - [AllowAnonymous] - [HttpGet("CommonDocument/DownloadCommonDoc")] - public async Task DownloadCommonFile(string code, [FromServices] IRepository _commonDocumentRepository) - { - var (filePath, fileName) = await FileStoreHelper.GetCommonDocPhysicalFilePathAsync(_hostEnvironment, _commonDocumentRepository, code); - - new FileExtensionContentTypeProvider().Mappings.TryGetValue(Path.GetExtension(filePath), out var contentType); - - return File(System.IO.File.OpenRead(filePath), contentType ?? "application/octet-stream", fileName); - - } - - /// - /// 下载项目临床数据文件 - /// - /// - /// - /// - [AllowAnonymous] - [HttpGet("CommonDocument/DownloadTrialClinicalFile")] - public async Task DownloadTrialClinicalFile(Guid clinicalDataTrialSetId, [FromServices] IRepository _clinicalDataTrialSetRepository) - { - var (filePath, fileName) = await FileStoreHelper.GetTrialClinicalPathAsync(_hostEnvironment, _clinicalDataTrialSetRepository, clinicalDataTrialSetId); - - new FileExtensionContentTypeProvider().Mappings.TryGetValue(Path.GetExtension(filePath), out var contentType); - - return File(System.IO.File.OpenRead(filePath), contentType ?? "application/octet-stream", fileName); - - } - - - /// - /// 下载系统临床数据文件 - /// - /// - /// - /// - [AllowAnonymous] - [HttpGet("CommonDocument/DownloadSystemClinicalFile")] - public async Task DownloadSystemClinicalFile(Guid clinicalDataSystemSetId, [FromServices] IRepository _clinicalDataSystemSetRepository) - { - var (filePath, fileName) = await FileStoreHelper.GetSystemClinicalPathAsync(_hostEnvironment, _clinicalDataSystemSetRepository, clinicalDataSystemSetId); - - new FileExtensionContentTypeProvider().Mappings.TryGetValue(Path.GetExtension(filePath), out var contentType); - - return File(System.IO.File.OpenRead(filePath), contentType ?? "application/octet-stream", fileName); - - } - - /// - ///上传项目签名文档 - /// - /// - /// - [HttpPost("TrialDocument/UploadTrialDoc/{trialId:guid}")] - [DisableRequestSizeLimit] - [DisableFormValueModelBinding] - public async Task UploadTrialDoc(Guid trialId) - { - - return await SingleFileUploadAsync((fileName) => FileStoreHelper.GetTrialSignDocPath(_hostEnvironment, trialId, fileName)); - - } - - /// - /// 上传系统签名文档 - /// - /// - [HttpPost("TrialDocument/UploadSystemDoc")] - [DisableRequestSizeLimit] - [DisableFormValueModelBinding] - public async Task UploadSysTemDoc() - { - - return await SingleFileUploadAsync((fileName) => FileStoreHelper.GetSystemSignDocPath(_hostEnvironment, fileName)); - - } /// @@ -1208,19 +872,6 @@ namespace IRaCIS.Core.API.Controllers } - /// - /// 上传系统通知文档 - /// - /// - [HttpPost("SystemNotice/UploadSystemNoticeDoc")] - [DisableRequestSizeLimit] - [DisableFormValueModelBinding] - public async Task UploadSystemNoticeDoc() - { - - return await SingleFileUploadAsync((fileName) => FileStoreHelper.GetSystemNoticePath(_hostEnvironment, fileName)); - - } public enum UploadFileType { diff --git a/IRaCIS.Core.API/IRaCIS.Core.API.csproj b/IRaCIS.Core.API/IRaCIS.Core.API.csproj index 787cd194b..28ac6a452 100644 --- a/IRaCIS.Core.API/IRaCIS.Core.API.csproj +++ b/IRaCIS.Core.API/IRaCIS.Core.API.csproj @@ -159,7 +159,7 @@ - + diff --git a/IRaCIS.Core.API/_ServiceExtensions/EFSetup.cs b/IRaCIS.Core.API/_ServiceExtensions/EFSetup.cs index 3a7df5742..c3d3700d1 100644 --- a/IRaCIS.Core.API/_ServiceExtensions/EFSetup.cs +++ b/IRaCIS.Core.API/_ServiceExtensions/EFSetup.cs @@ -27,7 +27,7 @@ namespace IRaCIS.Core.API options.AddInterceptors(new QueryWithNoLockDbCommandInterceptor()); - options.UseProjectables(); + //options.UseProjectables(); //options.AddInterceptors(new AuditingInterceptor(configuration.GetSection("ConnectionStrings:RemoteNew").Value)); diff --git a/IRaCIS.Core.API/appsettings.Development.json b/IRaCIS.Core.API/appsettings.Development.json index a71d2d214..868d9187d 100644 --- a/IRaCIS.Core.API/appsettings.Development.json +++ b/IRaCIS.Core.API/appsettings.Development.json @@ -17,9 +17,9 @@ "Endpoint": "https://oss-cn-shanghai.aliyuncs.com", "AccessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ", "AccessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio", - "BucketName": "zy-sir-test-store", + "BucketName": "zyypacs", "RoleArn": "acs:ram::1899121822495495:role/oss-upload", - "ViewEndpoint": "https://zy-sir-test-store.oss-cn-shanghai.aliyuncs.com", + "ViewEndpoint": "https://zyypacs.oss-cn-shanghai.aliyuncs.com", "Region": "oss-cn-shanghai" }, "BasicSystemConfig": { diff --git a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs index f62423549..b5bcb0565 100644 --- a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs +++ b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs @@ -5,7 +5,6 @@ using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Application.Service; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; -using Microsoft.EntityFrameworkCore.SqlServer.Query.Internal; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using Newtonsoft.Json; diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.csproj b/IRaCIS.Core.Application/IRaCIS.Core.Application.csproj index aa9a82bba..5e1574265 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.csproj +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.csproj @@ -64,7 +64,6 @@ - diff --git a/IRaCIS.Core.Application/Service/Common/_MapConfig.cs b/IRaCIS.Core.Application/Service/Common/_MapConfig.cs index cf8a3a95c..f3f1e32ab 100644 --- a/IRaCIS.Core.Application/Service/Common/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Common/_MapConfig.cs @@ -3,6 +3,7 @@ using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Models; +using IRaCIS.Core.Domain.Share; namespace IRaCIS.Core.Application.Service { @@ -20,25 +21,31 @@ namespace IRaCIS.Core.Application.Service CreateMap().ReverseMap(); CreateMap().ReverseMap(); + + + CreateMap(); + + var trialId = Guid.Empty; CreateMap().IncludeBase() .ForMember(o => o.IsHaveSelected, t => t.MapFrom(u => u.TrialEmailNoticeConfigList.Any(c => c.TrialId == trialId && c.SysEmailNoticeConfigId == u.Id))) ; CreateMap() - .ForMember(t => t.EmailNoticeUserList, u => u.MapFrom(c => c.EmailNoticeUserTypeList)); - + .ForMember(t => t.EmailNoticeUserList, u => u.MapFrom(c => c.EmailNoticeUserTypeList)); + CreateMap() + .ForMember(t => t.ParentCode, u => u.MapFrom(c => c.Parent.Code)); CreateMap(); var isEn_Us = false; CreateMap() .ForMember(o => o.ParentCode, t => t.MapFrom(u => u.Parent.Code)) - .ForMember(o => o.Value, t => t.MapFrom(u => isEn_Us? u.Value:u.ValueCN)); + .ForMember(o => o.Value, t => t.MapFrom(u => isEn_Us ? u.Value : u.ValueCN)); CreateMap().ReverseMap(); - + CreateMap() .ForMember(o => o.ConfigType, t => t.MapFrom(u => u.ConfigDictionary.Code)); @@ -51,7 +58,7 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(o => o.ParentChildCodeEnum, t => t.MapFrom(u => u.Parent.ChildCodeEnum)) - .ForMember(o => o.Value, t => t.MapFrom(u => isEn_Us? u.Value : u.ValueCN )) + .ForMember(o => o.Value, t => t.MapFrom(u => isEn_Us ? u.Value : u.ValueCN)) .ForMember(o => o.ParentCode, t => t.MapFrom(u => u.Parent.Code)); CreateMap() @@ -59,7 +66,7 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.ParentCode, t => t.MapFrom(u => u.Parent.Code)); var token = ""; - CreateMap() + CreateMap() .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token)); CreateMap().ReverseMap(); @@ -68,7 +75,7 @@ namespace IRaCIS.Core.Application.Service CreateMap().ReverseMap(); CreateMap(); - + CreateMap(); CreateMap().ReverseMap(); @@ -76,5 +83,5 @@ namespace IRaCIS.Core.Application.Service } } - + } diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs index dd130c66b..559fff3a5 100644 --- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs @@ -571,6 +571,8 @@ namespace IRaCIS.Core.Application.Service SqlParameter[] paravalue = new SqlParameter[] { new SqlParameter("@para",para) }; + + //https://learn.microsoft.com/zh-tw/ef/core/querying/sql-queries jsonDataValueDic[item.Key] = string.Join(",", _frontAuditConfigRepository._dbContext.Database.SqlQuery(sql, paravalue).Select(x => x.Text).ToList()); } } diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 8b6b968e3..3cd41fec8 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -8,7 +8,6 @@ using Panda.DynamicWebApi.Attributes; using Microsoft.AspNetCore.Authorization; using Microsoft.Extensions.Options; using Microsoft.Extensions.Caching.Memory; -using IRaCIS.Core.Infra.Common.Cache; using Microsoft.Identity.Client; using static IRaCIS.Core.Domain.Share.StaticData; using IRaCIS.Core.Application.ViewModel; diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs index 46153bca6..158e1a40b 100644 --- a/IRaCIS.Core.Application/TestService.cs +++ b/IRaCIS.Core.Application/TestService.cs @@ -63,6 +63,9 @@ namespace IRaCIS.Application.Services [AllowAnonymous] public async Task TestDistributedLock( ) { + + _repository.Where().Select(t => t.FullName).FirstOrDefault(); + Console.WriteLine($"我进来了当前值是:" + IntValue); _logger.LogWarning($"我进来了当前值是:" + IntValue); diff --git a/IRaCIS.Core.Domain.Share/IRaCIS.Core.Domain.Share.csproj b/IRaCIS.Core.Domain.Share/IRaCIS.Core.Domain.Share.csproj index 78fa3b6cf..85a1db3cc 100644 --- a/IRaCIS.Core.Domain.Share/IRaCIS.Core.Domain.Share.csproj +++ b/IRaCIS.Core.Domain.Share/IRaCIS.Core.Domain.Share.csproj @@ -10,9 +10,6 @@ - - - diff --git a/IRaCIS.Core.Domain/Allocation/TaskConsistentRule.cs b/IRaCIS.Core.Domain/Allocation/TaskConsistentRule.cs index 1ce5902dc..05a06767c 100644 --- a/IRaCIS.Core.Domain/Allocation/TaskConsistentRule.cs +++ b/IRaCIS.Core.Domain/Allocation/TaskConsistentRule.cs @@ -6,7 +6,6 @@ using System; using System.ComponentModel.DataAnnotations.Schema; using System.Collections.Generic; -using EntityFrameworkCore.Projectables; using System.Linq; namespace IRaCIS.Core.Domain.Models diff --git a/IRaCIS.Core.Domain/Allocation/VisitTask.cs b/IRaCIS.Core.Domain/Allocation/VisitTask.cs index 73daba8ce..e0568cebd 100644 --- a/IRaCIS.Core.Domain/Allocation/VisitTask.cs +++ b/IRaCIS.Core.Domain/Allocation/VisitTask.cs @@ -9,7 +9,6 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Collections.Generic; using System.Linq; -using EntityFrameworkCore.Projectables; namespace IRaCIS.Core.Domain.Models { @@ -324,7 +323,7 @@ namespace IRaCIS.Core.Domain.Models public Guid? BeforeConvertedTaskId { get; set; } - [Projectable] + [NotMapped] [JsonIgnore] public bool IsConvertedTask => BeforeConvertedTaskId != null || IsHistoryConvertedTask|| Subject.SubjectVisitTaskList.Where(t => t.TrialReadingCriterionId == TrialReadingCriterionId && t.DoctorUserId == DoctorUserId && t.BeforeConvertedTaskId != null diff --git a/IRaCIS.Core.Domain/Common/Dictionary.cs b/IRaCIS.Core.Domain/Common/Dictionary.cs index f178c6154..b0596c510 100644 --- a/IRaCIS.Core.Domain/Common/Dictionary.cs +++ b/IRaCIS.Core.Domain/Common/Dictionary.cs @@ -1,4 +1,3 @@ -using EntityFrameworkCore.Projectables; using IRaCIS.Core.Domain.Share; using System; using System.Collections.Generic; @@ -60,9 +59,6 @@ namespace IRaCIS.Core.Domain.Models - [Projectable] - public string TranslateValue( string value, string valueCN,bool isCN) => isCN?valueCN:value; - } } diff --git a/IRaCIS.Core.Domain/Dcotor/Doctor.cs b/IRaCIS.Core.Domain/Dcotor/Doctor.cs index fcfdcfff7..09b034b9e 100644 --- a/IRaCIS.Core.Domain/Dcotor/Doctor.cs +++ b/IRaCIS.Core.Domain/Dcotor/Doctor.cs @@ -1,4 +1,3 @@ -using EntityFrameworkCore.Projectables; using IRaCIS.Core.Domain.Share; using System; using System.Collections.Generic; @@ -51,7 +50,7 @@ namespace IRaCIS.Core.Domain.Models [StringLength(100)] public string LastName { get; set; } = string.Empty; - [Projectable] + [NotMapped] public string FullName => LastName + " / " + FirstName; public int Sex { get; set; } diff --git a/IRaCIS.Core.Domain/IRaCIS.Core.Domain.csproj b/IRaCIS.Core.Domain/IRaCIS.Core.Domain.csproj index f9c01aaf3..d19daa8d4 100644 --- a/IRaCIS.Core.Domain/IRaCIS.Core.Domain.csproj +++ b/IRaCIS.Core.Domain/IRaCIS.Core.Domain.csproj @@ -8,15 +8,16 @@ ..\bin - - - - + + + + + diff --git a/IRaCIS.Core.Domain/Management/User.cs b/IRaCIS.Core.Domain/Management/User.cs index ade0229e1..946eb6683 100644 --- a/IRaCIS.Core.Domain/Management/User.cs +++ b/IRaCIS.Core.Domain/Management/User.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using EntityFrameworkCore.Projectables; using IRaCIS.Core.Domain.Share; namespace IRaCIS.Core.Domain.Models @@ -93,7 +92,8 @@ namespace IRaCIS.Core.Domain.Models /// public bool AutoCutNextTask { get; set; } = false; - [Projectable] public string FullName => LastName + " / " + FirstName; + [NotMapped] + public string FullName => LastName + " / " + FirstName; //[Projectable] public string FullName => $"{LastName} / {FirstName}"; } diff --git a/IRaCIS.Core.Domain/SQLFile/23231012.sql b/IRaCIS.Core.Domain/SQLFile/23231012.sql new file mode 100644 index 000000000..79bd6d1e8 --- /dev/null +++ b/IRaCIS.Core.Domain/SQLFile/23231012.sql @@ -0,0 +1,15 @@ +-- 查询指定 code 的记录及其父项 +SELECT * +FROM Dictionary +WHERE code = 'BusinessModule' + +UNION + +-- 查询指定 code 的记录及其子项 +SELECT t.* +FROM Dictionary t +INNER JOIN ( + SELECT Id + FROM Dictionary + WHERE code = 'BusinessModule' +) AS selected ON t.ParentId = selected.Id; diff --git a/IRaCIS.Core.Infra.EFCore/Common/EFSqlQuery.cs b/IRaCIS.Core.Infra.EFCore/Common/EFSqlQuery.cs index 38c84a998..d566f122c 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/EFSqlQuery.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/EFSqlQuery.cs @@ -56,7 +56,7 @@ namespace IRaCIS.Core.Infra.EFCore dbConn = conn; conn.Open(); DbCommand cmd = conn.CreateCommand(); - if (facade.IsSqlServer()) + if (facade.IsRelational()) { cmd.CommandText = sql; CombineParams(ref cmd, parameters); diff --git a/IRaCIS.Core.Infra.EFCore/IRaCIS.Core.Infra.EFCore.csproj b/IRaCIS.Core.Infra.EFCore/IRaCIS.Core.Infra.EFCore.csproj index ccebbacad..492899965 100644 --- a/IRaCIS.Core.Infra.EFCore/IRaCIS.Core.Infra.EFCore.csproj +++ b/IRaCIS.Core.Infra.EFCore/IRaCIS.Core.Infra.EFCore.csproj @@ -1,29 +1,31 @@  - - net6.0 - + + net6.0 + - - ..\bin - + + ..\bin + - - - - + + + + - - - - - - - - - + + + + + + + + + + + diff --git a/IRaCIS.Core.Infra.EFCore/Repository/IRaCISContextExtension.cs b/IRaCIS.Core.Infra.EFCore/Repository/IRaCISContextExtension.cs index 5428578f6..0687678aa 100644 --- a/IRaCIS.Core.Infra.EFCore/Repository/IRaCISContextExtension.cs +++ b/IRaCIS.Core.Infra.EFCore/Repository/IRaCISContextExtension.cs @@ -1,9 +1,12 @@ -using EFCore.BulkExtensions; +using AutoMapper.Internal; +using EFCore.BulkExtensions; using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Infrastructure.Extention; using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Query; using System; +using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; @@ -38,17 +41,17 @@ namespace IRaCIS.Core.Infra.EFCore public static class EntityAction { - /// - ///添加和更新的时候,通常需要与数据库已存在的数据进行校验,添加更新的区分在于是否需要排除自己 - /// - /// - /// - /// - /// - /// - /// - /// - public static async Task EntityVerifyAsync(this IRaCISDBContext _dbContext, bool isAdd, EntityVerifyExp[] verify, Guid? entitydId = null) where T : Entity + /// + ///添加和更新的时候,通常需要与数据库已存在的数据进行校验,添加更新的区分在于是否需要排除自己 + /// + /// + /// + /// + /// + /// + /// + /// + public static async Task EntityVerifyAsync(this IRaCISDBContext _dbContext, bool isAdd, EntityVerifyExp[] verify, Guid? entitydId = null) where T : Entity { if (isAdd) @@ -80,13 +83,13 @@ namespace IRaCIS.Core.Infra.EFCore } } } - } + } } - public static async Task EntityVerifyAsync(this IRepository _entityRepository, Guid? entitydId = null,params EntityVerifyExp[] verify) where T : Entity + public static async Task EntityVerifyAsync(this IRepository _entityRepository, Guid? entitydId = null, params EntityVerifyExp[] verify) where T : Entity { - if (entitydId==null) + if (entitydId == null) { foreach (var verifyItem in verify.Where(t => t.verifyType != VerifyEnum.OnlyUpdate && t.IsVerify)) { @@ -122,7 +125,7 @@ namespace IRaCIS.Core.Infra.EFCore ///注意 模型标注了 ConcurrencyCheck的属性,这样的实体,不适合用部分字段更新,ef生成的更新sql会自动带上ConcurrencyCheck的属性条件 /// EntityState.Detached的实体 修改 部分字段 - public static void EntityModifyPartialFiled(this IRaCISDBContext _dbContext,T waitModifyEntity, Expression> updateFactory) where T : Entity + public static void EntityModifyPartialFiled(this IRaCISDBContext _dbContext, T waitModifyEntity, Expression> updateFactory) where T : Entity { var entityEntry = _dbContext.Entry(waitModifyEntity); //entityEntry.State = EntityState.Detached; @@ -153,19 +156,22 @@ namespace IRaCIS.Core.Infra.EFCore #region 不走EF 跟踪机制的删除 更新 以及批量操作 /// 批量删除,相当于原生sql, 没用EF跟踪方式(所有查询出来,再删除 浪费性能) - public static async Task BatchDeleteNoTrackingAsync(this IRaCISDBContext _dbContext,Expression> deleteFilter) where T : Entity + public static async Task BatchDeleteNoTrackingAsync(this IRaCISDBContext _dbContext, Expression> deleteFilter) where T : Entity { if (deleteFilter == null) throw new ArgumentNullException(nameof(deleteFilter)); - return await _dbContext.Set().IgnoreQueryFilters().Where(deleteFilter).BatchDeleteAsync() > 0; + return await _dbContext.Set().IgnoreQueryFilters().Where(deleteFilter).ExecuteDeleteAsync() > 0; } /// 批量更新,相当于原生sql, 没用EF跟踪方式(所有查询出来,再更新 浪费性能) - public static async Task BatchUpdateNoTrackingAsync(this IRaCISDBContext _dbContext,Expression> where, Expression> updateFactory,Guid updateUserId) where T : Entity + public static async Task BatchUpdateNoTrackingAsync(this IRaCISDBContext _dbContext, Expression> where, Expression> updateFactory, Guid updateUserId) where T : Entity { if (where == null) throw new ArgumentNullException(nameof(where)); + + #region batch delete bug + var bindings = ((MemberInitExpression)updateFactory.Body).Bindings.ToList(); var hasPropNameList = bindings.Select(t => t.Member.Name).ToList(); @@ -193,12 +199,74 @@ namespace IRaCIS.Core.Infra.EFCore var factory = Expression.Lambda>(member, Expression.Parameter(typeof(T), "x")); + return await _dbContext.Set().IgnoreQueryFilters().Where(where).BatchUpdateAsync(factory).ConfigureAwait(false) > 0; + #endregion + + + #region efcore 7 + + //Dictionary propValues = new Dictionary(); + + //// 获取表达式体的 MemberInitExpression + //var memberInitExpr = (MemberInitExpression)updateFactory.Body; + + + + //// 获取初始化的绑定信息 + //var bindings = memberInitExpr.Bindings.ToList(); + + //var hasPropNameList = bindings.Select(t => t.Member.Name).ToList(); + + + //// 遍历绑定信息 + //foreach (MemberAssignment binding in bindings) + //{ + // // 获取属性名 + // string propName = binding.Member.Name; + + // // 获取属性值,需要对表达式进行编译和调用 + // var propValue = Expression.Lambda(binding.Expression).Compile().DynamicInvoke(); + + // // 现在,你可以访问属性名和属性值 + // propValues.Add(propName, propValue); + //} + + //if (typeof(IAuditUpdate).IsAssignableFrom(typeof(T))) + //{ + + // if (!hasPropNameList.Contains(nameof(IAuditUpdate.UpdateTime))) + // { + // propValues.Add(nameof(IAuditUpdate.UpdateTime), DateTime.Now); + + + // } + + // if (!hasPropNameList.Contains(nameof(IAuditUpdate.UpdateUserId))) + // { + // propValues.Add(nameof(IAuditUpdate.UpdateUserId), updateUserId); + + // } + + //} + + //return await _dbContext.Set().IgnoreQueryFilters().Where(where).ExecuteUpdateAsync(s => s.SetProperty(t => "UpdateTime", u => "").se).ConfigureAwait(false) > 0; + + ////return await _dbContext.Set().IgnoreQueryFilters().Where(where).ExecuteUpdateAsync(propValues.SetProperties()).ConfigureAwait(false) > 0; + + #endregion + + + + } + + + #endregion } diff --git a/IRaCIS.Core.Infra.EFCore/Repository/IRepository.cs b/IRaCIS.Core.Infra.EFCore/Repository/IRepository.cs index 698d295bb..616d242ca 100644 --- a/IRaCIS.Core.Infra.EFCore/Repository/IRepository.cs +++ b/IRaCIS.Core.Infra.EFCore/Repository/IRepository.cs @@ -12,7 +12,6 @@ using System.Linq; using System.Linq.Expressions; using System.Threading.Tasks; using IRaCIS.Core.Domain.Share; -using EFCore.BulkExtensions; using Microsoft.Extensions.Localization; namespace IRaCIS.Core.Infra.EFCore diff --git a/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs b/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs index b61540bf4..7901a0a84 100644 --- a/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs +++ b/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs @@ -10,7 +10,6 @@ using IRaCIS.Core.Domain.Models; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.ChangeTracking; using AutoMapper.QueryableExtensions; -using EFCore.BulkExtensions; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Infrastructure.Extention; @@ -194,7 +193,6 @@ namespace IRaCIS.Core.Infra.EFCore _dbContext.EntityModifyPartialFiled(entity, updateFactory); - await SaveChangesAsync(autoSave); } diff --git a/IRaCIS.Core.Infrastructure/Cache/CacheType.cs b/IRaCIS.Core.Infrastructure/Cache/CacheType.cs deleted file mode 100644 index 5f64f0cc8..000000000 --- a/IRaCIS.Core.Infrastructure/Cache/CacheType.cs +++ /dev/null @@ -1,18 +0,0 @@ - -namespace IRaCIS.Core.Infra.Common.Cache -{ - /// - /// 缓存类型 - /// - public enum CacheType - { - /// - /// 内存缓存 - /// - Memory, - /// - /// Redis缓存 - /// - Redis - } -} diff --git a/IRaCIS.Core.Infrastructure/Cache/ICache.cs b/IRaCIS.Core.Infrastructure/Cache/ICache.cs deleted file mode 100644 index defd2dd98..000000000 --- a/IRaCIS.Core.Infrastructure/Cache/ICache.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System; -using System.Threading.Tasks; - -namespace IRaCIS.Core.Infra.Common.Cache -{ - /// - /// 缓存接口 - /// - public interface ICache - { - /// - /// 用于在 key 存在时删除 key - /// - /// 键 - long Del(params string[] key); - - /// - /// 用于在 key 存在时删除 key - /// - /// 键 - /// - Task DelAsync(params string[] key); - - /// - /// 用于在 key 模板存在时删除 - /// - /// key模板 - /// - Task DelByPatternAsync(string pattern); - - /// - /// 检查给定 key 是否存在 - /// - /// 键 - /// - bool Exists(string key); - - /// - /// 检查给定 key 是否存在 - /// - /// 键 - /// - Task ExistsAsync(string key); - - /// - /// 获取指定 key 的值 - /// - /// 键 - /// - string Get(string key); - - /// - /// 获取指定 key 的值 - /// - /// byte[] 或其他类型 - /// 键 - /// - T Get(string key); - - /// - /// 获取指定 key 的值 - /// - /// 键 - /// - Task GetAsync(string key); - - /// - /// 获取指定 key 的值 - /// - /// byte[] 或其他类型 - /// 键 - /// - Task GetAsync(string key); - - /// - /// 设置指定 key 的值,所有写入参数object都支持string | byte[] | 数值 | 对象 - /// - /// 键 - /// 值 - bool Set(string key, object value); - - /// - /// 设置指定 key 的值,所有写入参数object都支持string | byte[] | 数值 | 对象 - /// - /// 键 - /// 值 - /// 有效期 - bool Set(string key, object value, TimeSpan expire); - - /// - /// 设置指定 key 的值,所有写入参数object都支持string | byte[] | 数值 | 对象 - /// - /// 键 - /// 值 - /// - Task SetAsync(string key, object value); - - /// - /// 设置指定 key 的值,所有写入参数object都支持string | byte[] | 数值 | 对象 - /// - /// 键 - /// 值 - /// 有效期 - /// - Task SetAsync(string key, object value, TimeSpan expire); - } -} diff --git a/IRaCIS.Core.Infrastructure/Cache/MemoryCache.cs b/IRaCIS.Core.Infrastructure/Cache/MemoryCache.cs deleted file mode 100644 index 16ffd5760..000000000 --- a/IRaCIS.Core.Infrastructure/Cache/MemoryCache.cs +++ /dev/null @@ -1,127 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using Microsoft.Extensions.Caching.Memory; - -namespace IRaCIS.Core.Infra.Common.Cache -{ - /// - /// 内存缓存 - /// - public class MemoryCache : ICache - { - private readonly IMemoryCache _memoryCache; - public MemoryCache(IMemoryCache memoryCache) - { - _memoryCache = memoryCache; - } - - public long Del(params string[] key) - { - foreach(var k in key) - { - _memoryCache.Remove(k); - } - return key.Length; - } - - public Task DelAsync(params string[] key) - { - foreach (var k in key) - { - _memoryCache.Remove(k); - } - - return Task.FromResult((long)key.Length); - } - - public async Task DelByPatternAsync(string pattern) - { - if (string.IsNullOrEmpty(pattern)) - return default; - - pattern = Regex.Replace(pattern, @"\{.*\}", "(.*)"); - - var keys = GetAllKeys().Where(k => Regex.IsMatch(k, pattern)); - - if(keys != null && keys.Count() > 0) - { - return await DelAsync(keys.ToArray()); - } - - return default; - } - - public bool Exists(string key) - { - return _memoryCache.TryGetValue(key, out _); - } - - public Task ExistsAsync(string key) - { - return Task.FromResult(_memoryCache.TryGetValue(key, out _)); - } - - public string Get(string key) - { - return _memoryCache.Get(key)?.ToString(); - } - - public T Get(string key) - { - return _memoryCache.Get(key); - } - - public Task GetAsync(string key) - { - return Task.FromResult(Get(key)); - } - - public Task GetAsync(string key) - { - return Task.FromResult(Get(key)); - } - - public bool Set(string key, object value) - { - _memoryCache.Set(key, value); - return true; - } - - public bool Set(string key, object value, TimeSpan expire) - { - _memoryCache.Set(key, value, expire); - return true; - } - - public Task SetAsync(string key, object value) - { - Set(key, value); - return Task.FromResult(true); - } - - public Task SetAsync(string key, object value, TimeSpan expire) - { - Set(key, value, expire); - return Task.FromResult(true); - } - - private List GetAllKeys() - { - const BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic; - var entries = _memoryCache.GetType().GetField("_entries", flags).GetValue(_memoryCache); - var cacheItems = entries as IDictionary; - var keys = new List(); - if (cacheItems == null) return keys; - foreach (DictionaryEntry cacheItem in cacheItems) - { - keys.Add(cacheItem.Key.ToString()); - } - return keys; - } - } -} diff --git a/IRaCIS.Core.Infrastructure/Cache/RedisCache.cs b/IRaCIS.Core.Infrastructure/Cache/RedisCache.cs deleted file mode 100644 index 1c540178f..000000000 --- a/IRaCIS.Core.Infrastructure/Cache/RedisCache.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System; -using System.Text.RegularExpressions; -using System.Threading.Tasks; - -namespace IRaCIS.Core.Infra.Common.Cache -{ - /// - /// Redis缓存 - /// - public class RedisCache : ICache - { - public long Del(params string[] key) - { - return RedisHelper.Del(key); - } - - public Task DelAsync(params string[] key) - { - return RedisHelper.DelAsync(key); - } - - public async Task DelByPatternAsync(string pattern) - { - if (string.IsNullOrEmpty(pattern)) - return default; - - pattern = Regex.Replace(pattern, @"\{.*\}", "*"); - - var keys = (await RedisHelper.KeysAsync(pattern)); - if(keys != null && keys.Length > 0) - { - return await RedisHelper.DelAsync(keys); - } - - return default; - } - - public bool Exists(string key) - { - return RedisHelper.Exists(key); - } - - public Task ExistsAsync(string key) - { - return RedisHelper.ExistsAsync(key); - } - - public string Get(string key) - { - return RedisHelper.Get(key); - } - - public T Get(string key) - { - return RedisHelper.Get(key); - } - - public Task GetAsync(string key) - { - return RedisHelper.GetAsync(key); - } - - public Task GetAsync(string key) - { - return RedisHelper.GetAsync(key); - } - - public bool Set(string key, object value) - { - return RedisHelper.Set(key, value); - } - - public bool Set(string key, object value, TimeSpan expire) - { - return RedisHelper.Set(key, value, expire); - } - - public Task SetAsync(string key, object value) - { - return RedisHelper.SetAsync(key, value); - } - - public Task SetAsync(string key, object value, TimeSpan expire) - { - return RedisHelper.SetAsync(key, value, expire); - } - } -} diff --git a/IRaCIS.Core.Infrastructure/IRaCIS.Core.Infrastructure.csproj b/IRaCIS.Core.Infrastructure/IRaCIS.Core.Infrastructure.csproj index 9976f5251..881affa42 100644 --- a/IRaCIS.Core.Infrastructure/IRaCIS.Core.Infrastructure.csproj +++ b/IRaCIS.Core.Infrastructure/IRaCIS.Core.Infrastructure.csproj @@ -1,27 +1,27 @@  - - net6.0 - + + net6.0 + - - ..\bin - + + ..\bin + - - - - - - - - + + + + + + + + - - - + + +