From 0f1d2ddb7f3876ff239636b2904dc1a32474ddea Mon Sep 17 00:00:00 2001
From: hang <872297557@qq.com>
Date: Thu, 2 Jun 2022 11:46:44 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E9=99=A4=E6=96=87=E6=A1=A3token?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
IRaCIS.Core.API/Startup.cs | 3 +++
.../IRaCIS.Core.Application.xml | 24 +++++++++++++++++--
.../Service/Document/TrialDocumentService.cs | 12 +++++-----
.../Service/Document/_MapConfig.cs | 8 +++----
IRaCIS.Core.Application/TestService.cs | 17 ++++++-------
5 files changed, 44 insertions(+), 20 deletions(-)
diff --git a/IRaCIS.Core.API/Startup.cs b/IRaCIS.Core.API/Startup.cs
index 102969299..e52799119 100644
--- a/IRaCIS.Core.API/Startup.cs
+++ b/IRaCIS.Core.API/Startup.cs
@@ -111,6 +111,9 @@ namespace IRaCIS.Core.API
services.AddMediatR(typeof(ConsistencyVerificationHandler).Assembly);
// EasyCaching 缓存
services.AddEasyCachingSetup();
+
+ //services.AddDistributedMemoryCache();
+
// hangfire 定时任务框架 有界面,更友好~
services.AddhangfireSetup(_configuration);
// QuartZ 定时任务框架 使用了hangfire 暂时不用,后续需要可以打开,已经配好
diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
index db392299c..9397ca403 100644
--- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
+++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
@@ -900,16 +900,36 @@
FrontAuditConfigView 鍒楄〃瑙嗗浘妯″瀷
-
+
+
+ 瀹屽叏澶嶅埗瀵硅薄
+
+
+
鏁版嵁鏉ユ簮瀵硅薄
-
+
瑕佽祴鍊煎埌鐨勫璞
+
+
+ 澶嶅埗鍏朵粬瀵硅薄鍒板綋鍓嶅璞
+
+
+
+
+ 鏁版嵁婧怗uids
+
+
+
+
+ 娣诲姞瀵硅薄鐨凣uid
+
+
FrontAuditConfigQuery 鍒楄〃鏌ヨ鍙傛暟妯″瀷
diff --git a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs
index bacf1021d..f480d836e 100644
--- a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs
+++ b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs
@@ -149,7 +149,7 @@ namespace IRaCIS.Core.Application.Services
FileType = needConfirmedUserType.SystemDocument.FileType.Value,
UpdateTime = needConfirmedUserType.SystemDocument.UpdateTime,
- FullFilePath = needConfirmedUserType.SystemDocument.Path + "?access_token=" + _userInfo.UserToken,
+ FullFilePath = needConfirmedUserType.SystemDocument.Path ,
ConfirmUserId = confirm.ConfirmUserId,
ConfirmTime = confirm.ConfirmTime,
@@ -172,7 +172,7 @@ namespace IRaCIS.Core.Application.Services
Id = trialDoc.Id,
IsSystemDoc = false,
CreateTime = trialDoc.CreateTime,
- FullFilePath = trialDoc.Path + "?access_token=" + _userInfo.UserToken,
+ FullFilePath = trialDoc.Path ,
IsDeleted = trialDoc.IsDeleted,
Name = trialDoc.Name,
Path = trialDoc.Path,
@@ -292,7 +292,7 @@ namespace IRaCIS.Core.Application.Services
UserName = trialUser.User.UserName,
UserTypeShortName = trialUser.User.UserTypeRole.UserTypeShortName,
- FullFilePath = trialDocumentNeedConfirmedUserType.TrialDocument.Path + "?access_token=" + _userInfo.UserToken
+ FullFilePath = trialDocumentNeedConfirmedUserType.TrialDocument.Path
};
@@ -325,7 +325,7 @@ namespace IRaCIS.Core.Application.Services
UserName = trialUser.User.UserName,
UserTypeShortName = trialUser.User.UserTypeRole.UserTypeShortName,
- FullFilePath = needConfirmEdUserType.SystemDocument.Path + "?access_token=" + _userInfo.UserToken
+ FullFilePath = needConfirmEdUserType.SystemDocument.Path
};
var unionQuery = trialDocQuery.Union(systemDocQuery)
@@ -626,7 +626,7 @@ namespace IRaCIS.Core.Application.Services
Id = t.Id,
IsSystemDoc = true,
CreateTime = t.CreateTime,
- FullFilePath = t.Path + "?access_token=" + _userInfo.UserToken,
+ FullFilePath = t.Path ,
IsDeleted = t.IsDeleted,
Name = t.Name,
Path = t.Path,
@@ -644,7 +644,7 @@ namespace IRaCIS.Core.Application.Services
Id = t.Id,
IsSystemDoc = false,
CreateTime = t.CreateTime,
- FullFilePath = t.Path + "?access_token=" + _userInfo.UserToken,
+ FullFilePath = t.Path ,
IsDeleted = t.IsDeleted,
Name = t.Name,
Path = t.Path,
diff --git a/IRaCIS.Core.Application/Service/Document/_MapConfig.cs b/IRaCIS.Core.Application/Service/Document/_MapConfig.cs
index 7ab5441ee..12a87216d 100644
--- a/IRaCIS.Core.Application/Service/Document/_MapConfig.cs
+++ b/IRaCIS.Core.Application/Service/Document/_MapConfig.cs
@@ -15,21 +15,21 @@ namespace IRaCIS.Core.Application.Service
var token = string.Empty;
CreateMap()
.ForMember(d => d.FileType, u => u.MapFrom(s => s.FileType.Value))
- .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token));
+ .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path));
CreateMap()
.ForMember(d => d.FileType, u => u.MapFrom(s => s.FileType.Value))
.ForMember(d => d.IsSomeUserSigned, u => u.MapFrom(s => s.TrialDocConfirmedUserList.Any()))
- .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token));
+ .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path ));
CreateMap()
.ForMember(d => d.IsSystemDoc, u => u.MapFrom(s => true))
- .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token));
+ .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path ));
CreateMap()
.ForMember(d => d.IsSystemDoc, u => u.MapFrom(s => false))
- .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token));
+ .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path ));
CreateMap().ForMember(d => d.UserTypeShortName, t => t.MapFrom(c => c.UserTypeRole.UserTypeShortName));
CreateMap().ForMember(d => d.UserTypeShortName, t => t.MapFrom(c => c.UserTypeRole.UserTypeShortName));
diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs
index 08e5fbb23..f188cbbcf 100644
--- a/IRaCIS.Core.Application/TestService.cs
+++ b/IRaCIS.Core.Application/TestService.cs
@@ -1,9 +1,5 @@
-锘縰sing IRaCIS.Application.Interfaces;
-using IRaCIS.Application.Contracts;
-using IRaCIS.Core.Infra.EFCore;
-using Microsoft.AspNetCore.Mvc;
-using System.Globalization;
-using System.ComponentModel.DataAnnotations;
+锘縰sing Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Caching.Distributed;
namespace IRaCIS.Application.Services
{
@@ -13,10 +9,13 @@ namespace IRaCIS.Application.Services
private readonly IRepository _dicRepository;
private readonly IRepository _trialRepository;
- public TestService(IRepository dicRepository, IRepository trialRepository)
+ private readonly IDistributedCache _cache;
+
+ public TestService(IRepository dicRepository, IRepository trialRepository, IDistributedCache cache)
{
_dicRepository = dicRepository;
_trialRepository = trialRepository;
+ _cache = cache;
}
public string Get()
@@ -28,7 +27,9 @@ namespace IRaCIS.Application.Services
public string Get(testModel testModel)
{
- var aa= _trialRepository.Where(t => t.Id == Guid.Empty).First();
+ //_cache.SetString("test" , "cacheStr");
+
+ //var aa= _trialRepository.Where(t => t.Id == Guid.Empty).First();
//var aaabb = _trialRepository.BatchDeleteNoTrackingAsync(t => t.Id == Guid.Empty).Result;