Mark endpoints for Swagger
This commit is contained in:
@@ -41,7 +41,11 @@ public sealed class FramesController : ControllerBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("{name}/image")]
|
[HttpPost("{name}/image")]
|
||||||
public async Task<IActionResult> UploadImage(string name, CancellationToken cancellationToken)
|
[Consumes("multipart/form-data")]
|
||||||
|
public async Task<IActionResult> UploadImage(
|
||||||
|
string name,
|
||||||
|
IFormFile image,
|
||||||
|
CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var stopwatch = Stopwatch.StartNew();
|
var stopwatch = Stopwatch.StartNew();
|
||||||
|
|
||||||
@@ -50,7 +54,7 @@ public sealed class FramesController : ControllerBase
|
|||||||
return NotFound();
|
return NotFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
var file = Request.Form.Files.GetFile("image");
|
var file = image;
|
||||||
if (file is null || file.Length == 0)
|
if (file is null || file.Length == 0)
|
||||||
{
|
{
|
||||||
return BadRequest(new { error = "Missing 'image' file part." });
|
return BadRequest(new { error = "Missing 'image' file part." });
|
||||||
@@ -70,6 +74,7 @@ public sealed class FramesController : ControllerBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("{name}/image-url")]
|
[HttpPost("{name}/image-url")]
|
||||||
|
[Consumes("application/json")]
|
||||||
public async Task<IActionResult> UploadImageUrl(
|
public async Task<IActionResult> UploadImageUrl(
|
||||||
string name,
|
string name,
|
||||||
[FromBody] ImageUrlRequest? body,
|
[FromBody] ImageUrlRequest? body,
|
||||||
@@ -149,5 +154,6 @@ public sealed class FramesController : ControllerBase
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed record ImageUrlRequest(string? Url);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public sealed record ImageUrlRequest(string? Url);
|
||||||
|
|||||||
Reference in New Issue
Block a user