Ejemplo n.º 1
0
        public async Task <IActionResult> Post(Guid fileId, [FromBody] EofMessageTransmissionModel model)
        {
            WorkerLog.Instance.Information($"Eof message received from {Request.HttpContext.Connection.RemoteIpAddress}");
            var result = await _eofMessageRepository.AddReceivedEofMessage(new EofMessage(fileId, model.AmountOfChunks));

            return(result.WasSuccessful
                                ? NoContent()
                                : StatusCode((int)HttpStatusCode.InternalServerError));
        }
Ejemplo n.º 2
0
            public async Task <EofMessageTransmissionResponse> SendEofMessage(EofMessageTransmissionRequest request)
            {
                WorkerLog.Instance.Information($"Eof message received from {request.Host}");
                var result = await _eofMessageRepository.AddReceivedEofMessage(new EofMessage(Guid.Parse(request.FileId), request.AmountOfChunks));

                return(result.WasSuccessful
                                        ? _successFullEofMessageTransmissionResponse
                                        : _failedEofMessageTransmissionResponse);
            }