TrialResourceFilter
parent
ce4ca4b382
commit
8838871c0d
|
@ -397,7 +397,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||
[HttpPost, Route("Inspection/QCOperation/SetReuploadFinished")]
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> SetReuploadFinished(DataInspectionDto<CRCReuploadFinishedCommand> opt)
|
||||
public async Task<IResponseOutput> SetReuploadFinished(DataInspectionDto<CRCReuploadFinishedCommand> opt)
|
||||
{
|
||||
var singid = await _inspectionService.RecordSing(opt.SignInfo);
|
||||
var result = await _qCOperationService.SetReuploadFinished(opt.Data);
|
||||
|
@ -411,7 +411,8 @@ namespace IRaCIS.Core.API.Controllers
|
|||
/// <param name="opt"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Inspection/TrialConfig/updateTrialState")]
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||
//[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })]
|
||||
[TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "BeforeOngoingCantOpt" })]
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> UpdateTrialState(DataInspectionDto<UpdateTrialStateDto> opt)
|
||||
{
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace IRaCIS.Core.Application.Filter
|
|||
|
||||
private readonly string _trialOpt;
|
||||
|
||||
|
||||
//private readonly List<string> _trialOptList;
|
||||
|
||||
|
||||
public TrialResourceFilter(IEasyCachingProvider provider, IUserInfo userInfo, string trialOpt)
|
||||
|
@ -29,6 +29,13 @@ namespace IRaCIS.Core.Application.Filter
|
|||
}
|
||||
|
||||
|
||||
//public TrialResourceFilter(IEasyCachingProvider provider, IUserInfo userInfo, List<string> trialOptList=new list)
|
||||
//{
|
||||
// _provider = provider;
|
||||
// _userInfo = userInfo;
|
||||
// _trialOptList = trialOptList;
|
||||
//}
|
||||
|
||||
|
||||
//优先选择异步的方法
|
||||
public async Task OnResourceExecutionAsync(ResourceExecutingContext context, ResourceExecutionDelegate next)
|
||||
|
@ -138,7 +145,7 @@ namespace IRaCIS.Core.Application.Filter
|
|||
var trialStatusStr = cacheResultDic[trialIdStr];
|
||||
|
||||
// 这里是统一拦截 项目有关的操作允许情况(特殊的地方,比如项目配置(有的在多种状态(初始化,ongoing)都可以操作,有的仅仅在Initializing)还有 项目添加和更新,不走这里,特殊处理,不然在这里显得很乱,判断是哪个接口)
|
||||
if (trialStatusStr.Value == StaticData.TrialState.TrialOngoing || _trialOpt==TrialOpt.BeforeOngoingCantOpt)
|
||||
if (trialStatusStr.Value == StaticData.TrialState.TrialOngoing || _trialOpt == TrialOpt.BeforeOngoingCantOpt)
|
||||
{
|
||||
|
||||
await next.Invoke();
|
||||
|
|
Loading…
Reference in New Issue