release
This commit is contained in:
parent
93b41bfa94
commit
e868c152e0
48 changed files with 372 additions and 34 deletions
|
|
@ -1,17 +1,18 @@
|
|||
using lilos_stitcher;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace LiloStitcher;
|
||||
|
||||
[ApiController]
|
||||
[Route( "api/image" )]
|
||||
public sealed class LiloController( LiloStitcher stitcher ) : ControllerBase
|
||||
public sealed class LiloController( lilos_stitcher.LiloStitcher stitcher ) : ControllerBase
|
||||
{
|
||||
[HttpPost]
|
||||
[Route( "generate" )]
|
||||
[Produces( "image/png" )]
|
||||
public async Task<IActionResult> Generate( [FromBody] GenerateRequest payload, CancellationToken ct )
|
||||
{
|
||||
var png = await stitcher.CreateImageAsync( payload, ct );
|
||||
return File( png, "image/png" );
|
||||
}
|
||||
[HttpPost]
|
||||
[Route( "generate" )]
|
||||
[Produces( "image/png" )]
|
||||
public async Task<IActionResult> Generate( [FromBody] GenerateRequest payload, CancellationToken ct )
|
||||
{
|
||||
string path = await stitcher.CreateImageAsync( payload, ct );
|
||||
return PhysicalFile(path, "image/png", enableRangeProcessing: false);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue