File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
HwProj.APIGateway/HwProj.APIGateway.API Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,8 @@ public async Task<IActionResult> Process([FromForm] ProcessFilesDTO processFiles
4040 if ( ! checkRights ) return StatusCode ( ( int ) HttpStatusCode . Forbidden , "Недостаточно прав для загрузки файлов" ) ;
4141
4242 var checkCountLimit = await _countFilter . CheckCountLimit ( processFilesDto ) ;
43- if ( ! checkCountLimit ) return StatusCode ( ( int ) HttpStatusCode . Forbidden , "Слишком много файлов в решении" ) ;
43+ if ( ! checkCountLimit ) return StatusCode ( ( int ) HttpStatusCode . Forbidden , "Слишком много файлов в решении."
44+ + $ "Максимальное количество файлов - ${ _countFilter . maxSolutionFiles } ") ;
4445
4546 var result = await _contentServiceClient . ProcessFilesAsync ( processFilesDto ) ;
4647 return result . Succeeded
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ namespace HwProj.APIGateway.API.Filters;
99public class FilesCountLimit
1010{
1111 private readonly IContentServiceClient _contentServiceClient ;
12- private readonly long _maxSolutionFiles = 5 ;
12+ public readonly long maxSolutionFiles = 5 ;
1313
1414 public FilesCountLimit ( IContentServiceClient contentServiceClient )
1515 {
@@ -29,7 +29,7 @@ public async Task<bool> CheckCountLimit(ProcessFilesDTO processFilesDto)
2929 return false ;
3030 }
3131
32- if ( existingIds . Count ( ) + processFilesDto . NewFiles . Count - processFilesDto . DeletingFileIds . Count > _maxSolutionFiles )
32+ if ( existingIds . Count ( ) + processFilesDto . NewFiles . Count - processFilesDto . DeletingFileIds . Count > maxSolutionFiles )
3333 {
3434 return false ;
3535 }
You can’t perform that action at this time.
0 commit comments