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