WellFinalDocumentsController remove CancellationToken default value

This commit is contained in:
ngfrolov 2023-02-01 14:38:59 +05:00
parent 5d3b954171
commit 00a6a333e4
Signed by: ng.frolov
GPG Key ID: E99907A0357B29A7

View File

@ -46,7 +46,7 @@ namespace AsbCloudWebApi.Controllers
[HttpGet("{idWell}")]
[Permission]
[ProducesResponseType(typeof(WellCaseDto), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetAsync(int idWell, CancellationToken token = default)
public async Task<IActionResult> GetAsync(int idWell, CancellationToken token)
{
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
return Forbid();
@ -65,7 +65,7 @@ namespace AsbCloudWebApi.Controllers
[HttpGet("{idWell}/availableUsers")]
[Permission]
[ProducesResponseType(typeof(IEnumerable<UserDto>), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetAvailableUsersAsync(int idWell, CancellationToken token = default)
public async Task<IActionResult> GetAvailableUsersAsync(int idWell, CancellationToken token )
{
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
return Forbid();
@ -84,7 +84,7 @@ namespace AsbCloudWebApi.Controllers
[HttpPut("{idWell}")]
[Permission("WellFinalDocuments.editPublisher")]
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> UpdateRangeAsync(int idWell, [Required] IEnumerable<WellFinalDocumentInputDto> dtos, CancellationToken token = default)
public async Task<IActionResult> UpdateRangeAsync(int idWell, [Required] IEnumerable<WellFinalDocumentInputDto> dtos, CancellationToken token )
{
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
return Forbid();
@ -102,7 +102,7 @@ namespace AsbCloudWebApi.Controllers
[HttpPut("{idWell}/reNotifyPublishers")]
[Permission("WellFinalDocuments.editPublisher")]
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> ReNotifyPublishersAsync(int idWell, [Required] int idCategory, CancellationToken token = default)
public async Task<IActionResult> ReNotifyPublishersAsync(int idWell, [Required] int idCategory, CancellationToken token )
{
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
return Forbid();
@ -124,7 +124,7 @@ namespace AsbCloudWebApi.Controllers
[ProducesResponseType(typeof(WellFinalDocumentsHistoryDto), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> GetFilesHistoryByIdCategoryAsync(int idWell,
[Required] int idCategory,
CancellationToken token = default)
CancellationToken token )
{
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
return Forbid();
@ -144,7 +144,7 @@ namespace AsbCloudWebApi.Controllers
[HttpPost("{idWell}")]
[Permission]
[ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> SaveCategoryFileAsync(int idWell, [Required] int idCategory, [Required] IFormFile file, CancellationToken token = default)
public async Task<IActionResult> SaveCategoryFileAsync(int idWell, [Required] int idCategory, [Required] IFormFile file, CancellationToken token )
{
if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))
return Forbid();
@ -168,7 +168,7 @@ namespace AsbCloudWebApi.Controllers
return Ok(data);
}
private async Task<bool> CanUserAccessToWellAsync(int idWell, CancellationToken token = default)
private async Task<bool> CanUserAccessToWellAsync(int idWell, CancellationToken token )
{
int? idCompany = User.GetCompanyId();
return idCompany is not null && await wellService.IsCompanyInvolvedInWellAsync((int)idCompany,