feat(EnvelopeReceiverReadOnly): Erweiterungsmethode zum Kodieren und Dekodieren von Envelope-Receiver ReadOnly Id hinzugefügt
This commit is contained in:
@@ -40,13 +40,27 @@ namespace EnvelopeGenerator.Web.Controllers.Test
|
||||
}
|
||||
|
||||
[HttpGet("decode")]
|
||||
public IActionResult DecodeEnvelopeReceiverId(string envelopeReceiverId)
|
||||
public IActionResult DecodeEnvelopeReceiverId(string envelopeReceiverId, bool isReadOnly = false)
|
||||
{
|
||||
var decoded = envelopeReceiverId.DecodeEnvelopeReceiverId();
|
||||
return Ok(new { uuid = decoded.EnvelopeUuid, signature = decoded.ReceiverSignature });
|
||||
if (isReadOnly)
|
||||
{
|
||||
var (Random1, ReadOnlyId, Random2) = envelopeReceiverId.DecodeEnvelopeReceiverReadOnlyId();
|
||||
return Ok(new { random = new string?[] { Random1, Random2 }, readOnlyId = ReadOnlyId });
|
||||
}
|
||||
else
|
||||
{
|
||||
var (EnvelopeUuid, ReceiverSignature) = envelopeReceiverId.DecodeEnvelopeReceiverId();
|
||||
return Ok(new { uuid = EnvelopeUuid, signature = ReceiverSignature });
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet("encode")]
|
||||
public IActionResult EncodeEnvelopeReceiverId(string uuid, string signature) => Ok((uuid, signature).EncodeEnvelopeReceiverId());
|
||||
public IActionResult EncodeEnvelopeReceiverId(string? uuid = null, string? signature = null, long? readOnlyId = null)
|
||||
{
|
||||
if(readOnlyId is long readOnlyId_long)
|
||||
return Ok(readOnlyId_long.EncodeEnvelopeReceiverId());
|
||||
else
|
||||
return Ok((uuid ?? string.Empty, signature ?? string.Empty).EncodeEnvelopeReceiverId());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user