refactor(ReceiverSecretDto): remove
This commit is contained in:
parent
c59b179a8f
commit
7568274c77
@ -3,17 +3,12 @@ using EnvelopeGenerator.Application.Common.Dto.Receiver;
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
namespace EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public record EnvelopeReceiverDto : EnvelopeReceiverDto<ReceiverDto>;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
public record EnvelopeReceiverDto<TReceiverDto> where TReceiverDto : ReceiverDto
|
public record EnvelopeReceiverDto
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
@ -23,7 +18,7 @@ public record EnvelopeReceiverDto<TReceiverDto> where TReceiverDto : ReceiverDto
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public TReceiverDto? Receiver { get; set; }
|
public ReceiverDto? Receiver { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
using EnvelopeGenerator.Application.Common.Dto.Receiver;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
namespace EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
||||||
|
|
||||||
@ -7,7 +6,7 @@ namespace EnvelopeGenerator.Application.Common.Dto.EnvelopeReceiver;
|
|||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
public record EnvelopeReceiverSecretDto : EnvelopeReceiverDto<ReceiverSecretDto>
|
public record EnvelopeReceiverSecretDto : EnvelopeReceiverDto
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
|||||||
@ -34,7 +34,6 @@ public class MappingProfile : Profile
|
|||||||
CreateMap<Domain.Entities.EnvelopeReceiver, EnvelopeReceiverSecretDto>();
|
CreateMap<Domain.Entities.EnvelopeReceiver, EnvelopeReceiverSecretDto>();
|
||||||
CreateMap<EnvelopeType, EnvelopeTypeDto>();
|
CreateMap<EnvelopeType, EnvelopeTypeDto>();
|
||||||
CreateMap<Domain.Entities.Receiver, ReceiverDto>();
|
CreateMap<Domain.Entities.Receiver, ReceiverDto>();
|
||||||
CreateMap<Domain.Entities.Receiver, ReceiverSecretDto>();
|
|
||||||
CreateMap<Domain.Entities.EnvelopeReceiverReadOnly, EnvelopeReceiverReadOnlyDto>();
|
CreateMap<Domain.Entities.EnvelopeReceiverReadOnly, EnvelopeReceiverReadOnlyDto>();
|
||||||
|
|
||||||
// DTO to Entity mappings
|
// DTO to Entity mappings
|
||||||
|
|||||||
@ -25,6 +25,12 @@ public class ReceiverDto
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public required string Signature { get; set; }
|
public required string Signature { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
|
public string? TotpSecretkey { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -1,15 +0,0 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Application.Common.Dto.Receiver;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
[ApiExplorerSettings(IgnoreApi = true)]
|
|
||||||
public class ReceiverSecretDto : ReceiverDto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public string? TotpSecretkey { get; set; }
|
|
||||||
}
|
|
||||||
@ -142,8 +142,7 @@ public class HomeController : ViewControllerBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Obsolete("Use MediatR")]
|
[Obsolete("Use MediatR")]
|
||||||
private async Task<IActionResult> CreateShowEnvelopeView<TReceiver>(string envelopeReceiverId, EnvelopeReceiverDto<TReceiver> er)
|
private async Task<IActionResult> CreateShowEnvelopeView(string envelopeReceiverId, EnvelopeReceiverDto er)
|
||||||
where TReceiver : ReceiverDto
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@ -30,8 +30,7 @@ public static class WebExtensions
|
|||||||
return int.TryParse(env_id_str, out int env_id) ? env_id : null;
|
return int.TryParse(env_id_str, out int env_id) ? env_id : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task SignInEnvelopeAsync<TReceiver>(this HttpContext context, EnvelopeReceiverDto<TReceiver> er, string receiverRole)
|
public static async Task SignInEnvelopeAsync(this HttpContext context, EnvelopeReceiverDto er, string receiverRole)
|
||||||
where TReceiver : ReceiverDto
|
|
||||||
{
|
{
|
||||||
var claims = new List<Claim> {
|
var claims = new List<Claim> {
|
||||||
new(ClaimTypes.NameIdentifier, er.Envelope!.Uuid),
|
new(ClaimTypes.NameIdentifier, er.Envelope!.Uuid),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user