Add ApiExplorerSettings to DTOs and update controllers

This commit introduces the `[ApiExplorerSettings(IgnoreApi = true)]` attribute to various DTO classes to exclude them from API documentation. The `using Microsoft.AspNetCore.Mvc;` directive has been added to several files to support ASP.NET Core MVC features.

Additionally, comments in `HistoryController.cs` have been reformatted for clarity, and `LocalizationController.cs` has been updated with standard API controller attributes. These changes improve code organization and maintain cleaner API documentation.
This commit is contained in:
Developer 02
2025-04-11 23:41:47 +02:00
parent 6e641395d5
commit e3dfa8dd39
24 changed files with 88 additions and 46 deletions

View File

@@ -1,9 +1,11 @@
using DigitalData.Core.Abstractions;
using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
namespace EnvelopeGenerator.Application.DTOs
{
[ApiExplorerSettings(IgnoreApi = true)]
public record ConfigDto(
string DocumentPath,
int SendingProfile,

View File

@@ -1,7 +1,9 @@
using DigitalData.Core.Abstractions;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs
{
[ApiExplorerSettings(IgnoreApi = true)]
public record DocumentReceiverElementDto(
int Id,
int DocumentId,

View File

@@ -1,7 +1,9 @@
using DigitalData.Core.Abstractions;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs
{
[ApiExplorerSettings(IgnoreApi = true)]
public record DocumentStatusDto(
int Id,
int EnvelopeId,

View File

@@ -1,7 +1,9 @@
using DigitalData.Core.Abstractions;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs
{
[ApiExplorerSettings(IgnoreApi = true)]
public record EmailTemplateDto(
int Id,
string Name,

View File

@@ -1,7 +1,9 @@
using DigitalData.Core.Abstractions;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs
{
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeCertificateDto(
int Id,
int EnvelopeId,

View File

@@ -1,7 +1,9 @@
using DigitalData.Core.Abstractions;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs
{
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeDocumentDto
(
int Id,

View File

@@ -2,9 +2,11 @@
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
using DigitalData.UserManager.Application.DTOs.User;
using EnvelopeGenerator.Domain.Entities;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs
{
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeDto() : IUnique<int>
{
public int Id { get; set; }

View File

@@ -1,5 +1,8 @@
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory
{
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeHistoryCreateDto(
int EnvelopeId,
string UserReference,

View File

@@ -2,10 +2,12 @@
using DigitalData.Core.DTO;
using DigitalData.UserManager.Application.DTOs.User;
using EnvelopeGenerator.Application.DTOs.Receiver;
using Microsoft.AspNetCore.Mvc;
using static EnvelopeGenerator.Common.Constants;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeHistory
{
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeHistoryDto(
long Id,
int EnvelopeId,

View File

@@ -1,8 +1,10 @@
using DigitalData.Core.Abstractions;
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver
{
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeReceiverBasicDto() : IUnique<(int Envelope, int Receiver)>
{
public (int Envelope, int Receiver) Id => (Envelope: EnvelopeId, Receiver: ReceiverId);

View File

@@ -1,7 +1,9 @@
using EnvelopeGenerator.Application.DTOs.Receiver;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver
{
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeReceiverDto() : EnvelopeReceiverBasicDto()
{
public EnvelopeDto? Envelope { get; set; }

View File

@@ -1,5 +1,8 @@
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver
{
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeReceiverSecretDto() : EnvelopeReceiverDto()
{
public string? AccessCode { get; init; }

View File

@@ -1,8 +1,10 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly
{
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeReceiverReadOnlyCreateDto(
DateTime DateValid)
{

View File

@@ -1,7 +1,9 @@
using EnvelopeGenerator.Application.DTOs.Receiver;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly
{
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeReceiverReadOnlyDto(
long Id,
long EnvelopeId,

View File

@@ -1,7 +1,9 @@
using DigitalData.Core.Abstractions;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiverReadOnly
{
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeReceiverReadOnlyUpdateDto(
long Id,
DateTime DateValid,

View File

@@ -1,7 +1,9 @@
using DigitalData.Core.Abstractions;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs
{
[ApiExplorerSettings(IgnoreApi = true)]
public record EnvelopeTypeDto(
int Id,
string Title,

View File

@@ -1,4 +1,7 @@
namespace EnvelopeGenerator.Application.DTOs.Messaging
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.Messaging
{
[ApiExplorerSettings(IgnoreApi = true)]
public class GtxMessagingResponse : Dictionary<string, object?> { }
}

View File

@@ -1,5 +1,8 @@
namespace EnvelopeGenerator.Application.DTOs.Messaging
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.Messaging
{
[ApiExplorerSettings(IgnoreApi = true)]
public record SmsResponse
{
public required bool Ok { get; init; }

View File

@@ -1,9 +1,11 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Mvc;
using System.ComponentModel.DataAnnotations;
using System.Security.Cryptography;
using System.Text;
namespace EnvelopeGenerator.Application.DTOs.Receiver
{
[ApiExplorerSettings(IgnoreApi = true)]
public record ReceiverCreateDto([EmailAddress] string EmailAddress, string? TotpSecretkey = null)
{
public string Signature => sha256HexOfMail.Value;

View File

@@ -2,10 +2,12 @@
using DigitalData.Core.DTO;
using DigitalData.EmailProfilerDispatcher.Abstraction.Attributes;
using EnvelopeGenerator.Application.DTOs.EnvelopeReceiver;
using Microsoft.AspNetCore.Mvc;
using System.Text.Json.Serialization;
namespace EnvelopeGenerator.Application.DTOs.Receiver;
[ApiExplorerSettings(IgnoreApi = true)]
public record ReceiverReadDto(
int Id,
string EmailAddress,

View File

@@ -1,5 +1,7 @@
using DigitalData.Core.Abstractions;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs.Receiver;
[ApiExplorerSettings(IgnoreApi = true)]
public record ReceiverUpdateDto(int Id, string? TotpSecretkey = null, DateTime? TfaRegDeadline = null) : IUnique<int>;

View File

@@ -1,7 +1,9 @@
using DigitalData.Core.Abstractions;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Application.DTOs
{
[ApiExplorerSettings(IgnoreApi = true)]
public record UserReceiverDto(
int Id,
int UserId,