Add auth and response docs to DocumentController endpoints
This commit is contained in:
parent
a37cb64a19
commit
e58b6c0679
|
|
@ -1,4 +1,5 @@
|
|||
using DoliMiddlewareApi.Services;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
|
|
@ -6,10 +7,14 @@ namespace DoliMiddlewareApi.Controllers
|
|||
{
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
[Authorize]
|
||||
public class DocumentController(DocumentService documentService) : ControllerBase
|
||||
{
|
||||
|
||||
[HttpGet("invoice/{invoiceRef}/pdf")]
|
||||
[ProducesResponseType(typeof(FileContentResult), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
|
||||
public async Task<IActionResult> GetInvoicePdf(string invoiceRef)
|
||||
{
|
||||
var (content, filename) = await documentService.BuildInvoicePdfAsync(invoiceRef);
|
||||
|
|
|
|||
Loading…
Reference in New Issue