61 lines
2.2 KiB
C#
61 lines
2.2 KiB
C#
using IRaCIS.Application.Interfaces;
|
|
using IRaCIS.Application.ViewModels;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using IRaCIS.Core.Application.Contracts.RequestAndResponse;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
namespace IRaCIS.Api.Controllers.Trial
|
|
{
|
|
/// <summary>
|
|
/// 影像获取规范
|
|
/// </summary>
|
|
[Route("acquisitionSpecification")]
|
|
[ApiController, Authorize, ApiExplorerSettings(GroupName = "Trial")]
|
|
public class TrialAttachmentController : ControllerBase
|
|
{
|
|
private readonly ITrialAttachmentService _specificationService;
|
|
public TrialAttachmentController(ITrialAttachmentService specificationService)
|
|
{
|
|
_specificationService = specificationService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加或更新影像采集规范[New][AUTH]
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
[HttpPost, Route("addOrUpdate")]
|
|
|
|
public IResponseOutput AddOrUpdateSpecification(TrialAttachmentCommand model)
|
|
{
|
|
var userId = User.FindFirst("id").Value;
|
|
return _specificationService.AddOrUpdateSpecification(model, Guid.Parse(userId));
|
|
}
|
|
|
|
/// <summary> 删除采集规范[New]</summary>
|
|
|
|
[HttpDelete, Route("delete/{id:guid}")]
|
|
public IResponseOutput DeleteSpecification(Guid id)
|
|
{
|
|
return _specificationService.DeleteSpecification(id);
|
|
}
|
|
|
|
[HttpPost, Route("list/{trialId:guid}")]
|
|
public IResponseOutput<IEnumerable<AcquisitionSpecificationDTO>> GetAcquisitionSpecificationList(Guid trialId,string type)
|
|
{
|
|
return ResponseOutput.Ok(_specificationService.GetSpecificationList( trialId, type));
|
|
}
|
|
|
|
///// <summary> 分页获取影像采集规范[New]</summary>
|
|
//[HttpPost, Route("getPageList")]
|
|
//[ApiExplorerSettings(IgnoreApi = true)]
|
|
//public IResponseOutput<PageOutput<AcquisitionSpecificationDTO>> GetSpecificationList(ImageAcquisitionSpecificationQueryDTO param)
|
|
//{
|
|
// return ResponseOutput.Ok(_specificationService.GetSpecificationList(param));
|
|
//}
|
|
|
|
}
|
|
}
|