Use response dto
This commit is contained in:
parent
0e584f6840
commit
bcb1c9b652
|
@ -98,14 +98,14 @@ namespace Jellyfin.Api.Controllers
|
||||||
/// <response code="200">Document saved.</response>
|
/// <response code="200">Document saved.</response>
|
||||||
/// <response code="403">Event logging disabled.</response>
|
/// <response code="403">Event logging disabled.</response>
|
||||||
/// <response code="413">Upload size too large.</response>
|
/// <response code="413">Upload size too large.</response>
|
||||||
/// <returns>Created file name.</returns>
|
/// <returns>Create response.</returns>
|
||||||
[HttpPost("Document")]
|
[HttpPost("Document")]
|
||||||
[ProducesResponseType(typeof(string), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(ClientLogDocumentResponseDto), StatusCodes.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status403Forbidden)]
|
[ProducesResponseType(StatusCodes.Status403Forbidden)]
|
||||||
[ProducesResponseType(StatusCodes.Status413PayloadTooLarge)]
|
[ProducesResponseType(StatusCodes.Status413PayloadTooLarge)]
|
||||||
[AcceptsFile(MediaTypeNames.Text.Plain)]
|
[AcceptsFile(MediaTypeNames.Text.Plain)]
|
||||||
[RequestSizeLimit(MaxDocumentSize)]
|
[RequestSizeLimit(MaxDocumentSize)]
|
||||||
public async Task<ActionResult<string>> LogFile()
|
public async Task<ActionResult<ClientLogDocumentResponseDto>> LogFile()
|
||||||
{
|
{
|
||||||
if (!_serverConfigurationManager.Configuration.AllowClientLogUpload)
|
if (!_serverConfigurationManager.Configuration.AllowClientLogUpload)
|
||||||
{
|
{
|
||||||
|
@ -123,7 +123,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
|
|
||||||
var fileName = await _clientEventLogger.WriteDocumentAsync(authorizationInfo, Request.Body)
|
var fileName = await _clientEventLogger.WriteDocumentAsync(authorizationInfo, Request.Body)
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
return Ok(fileName);
|
return Ok(new ClientLogDocumentResponseDto(fileName));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Log(ClientLogEventDto dto, AuthorizationInfo authorizationInfo)
|
private void Log(ClientLogEventDto dto, AuthorizationInfo authorizationInfo)
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
namespace Jellyfin.Api.Models.ClientLogDtos
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Client log document response dto.
|
||||||
|
/// </summary>
|
||||||
|
public class ClientLogDocumentResponseDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ClientLogDocumentResponseDto"/> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="filename">The file name.</param>
|
||||||
|
public ClientLogDocumentResponseDto(string filename)
|
||||||
|
{
|
||||||
|
Filename = filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the resulting filename.
|
||||||
|
/// </summary>
|
||||||
|
public string Filename { get; }
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user