refactor(DocumentController): remvoe Open endpoint and its client method

This commit is contained in:
2025-08-22 21:54:25 +02:00
parent 82a63b0dae
commit 3394a580f4
5 changed files with 2 additions and 71 deletions

View File

@@ -15,23 +15,18 @@ public class DocumentController : BaseController
{
private readonly EnvelopeOldService envelopeService;
private readonly ActionService? actionService;
[Obsolete("Use MediatR")]
private readonly IEnvelopeDocumentService _envDocService;
[Obsolete("Use MediatR")]
public DocumentController(DatabaseService database, EnvelopeOldService envelope, IEnvelopeDocumentService envDocService, ILogger<DocumentController> logger) : base(database, logger)
public DocumentController(DatabaseService database, EnvelopeOldService envelope, ILogger<DocumentController> logger) : base(database, logger)
{
envelopeService = envelope;
actionService = database.Services?.actionService;
_envDocService = envDocService;
}
[Obsolete("Use MediatR")]
[NonAction]
public async Task<IActionResult> Get([FromRoute] string envelopeKey, [FromQuery] int index)
{
// Validate Envelope Key and load envelope
envelopeService.EnsureValidEnvelopeKey(envelopeKey);
EnvelopeReceiver response = await envelopeService.LoadEnvelope(envelopeKey);
// Load document info
@@ -43,23 +38,4 @@ public class DocumentController : BaseController
// Return the document as bytes
return File(bytes, "application/octet-stream");
}
[Authorize(Roles = ReceiverRole.FullyAuth)]
[HttpPost("{envelopeKey}")]
[Obsolete("Use MediatR")]
public async Task<IActionResult> Open(string envelopeKey)
{
var authSignature = this.GetAuthReceiverSignature();
if (authSignature != envelopeKey.GetReceiverSignature())
return Forbid();
// Validate Envelope Key and load envelope
envelopeService.EnsureValidEnvelopeKey(envelopeKey);
EnvelopeReceiver response = await envelopeService.LoadEnvelope(envelopeKey);
actionService?.OpenEnvelope(response.Envelope, response.Receiver);
return Ok(new object());
}
}