- SQL-SELECT-Anweisungen in Dokumenten aktualisiert, um alle Spalten abzurufen.
- Prioritätsbehandlung für document_path_dmz in EnvelopeService.LoadEnvelopes hinzugefügt. - CRUD-Operationen in EnvlopeDocument und ConfigurationFile Services/Repositories unter Verwendung von WebCoreModules implementiert. - Verschiedene Dateimethoden in [spezifischen Orten oder Klassen, falls zutreffend] auf async umgestellt.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using EnvelopeGenerator.Common;
|
||||
using EnvelopeGenerator.Web.Services;
|
||||
using static EnvelopeGenerator.Common.Constants;
|
||||
using EnvelopeGenerator.Application.Contracts;
|
||||
|
||||
namespace EnvelopeGenerator.Web.Controllers
|
||||
{
|
||||
@@ -9,16 +10,18 @@ namespace EnvelopeGenerator.Web.Controllers
|
||||
{
|
||||
private readonly EnvelopeService envelopeService;
|
||||
private readonly ActionService? actionService;
|
||||
private readonly IEnvelopeDocumentService _envDocService;
|
||||
|
||||
public DocumentController(DatabaseService database, LoggingService logging, EnvelopeService envelope) : base(database, logging)
|
||||
public DocumentController(DatabaseService database, LoggingService logging, EnvelopeService envelope, IEnvelopeDocumentService envDocService) : base(database, logging)
|
||||
{
|
||||
envelopeService = envelope;
|
||||
actionService = database.Services?.actionService;
|
||||
_envDocService = envDocService;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[Route("api/document/{envelopeKey}")]
|
||||
public async Task<IActionResult> Get(string envelopeKey)
|
||||
public async Task<IActionResult> Get([FromRoute] string envelopeKey, [FromQuery] int index)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -26,11 +29,11 @@ namespace EnvelopeGenerator.Web.Controllers
|
||||
|
||||
// Validate Envelope Key and load envelope
|
||||
envelopeService.EnsureValidEnvelopeKey(envelopeKey);
|
||||
EnvelopeResponse response = envelopeService.LoadEnvelope(envelopeKey);
|
||||
EnvelopeResponse response = await envelopeService.LoadEnvelope(envelopeKey);
|
||||
|
||||
// Load document info
|
||||
var Request = ControllerContext.HttpContext.Request;
|
||||
var document = envelopeService.GetDocument(Request, envelopeKey);
|
||||
var document = await envelopeService.GetDocument(Request, envelopeKey);
|
||||
|
||||
// Load the document from disk
|
||||
var bytes = await envelopeService.GetDocumentContents(document);
|
||||
@@ -46,7 +49,7 @@ namespace EnvelopeGenerator.Web.Controllers
|
||||
|
||||
[HttpPost]
|
||||
[Route("api/document/{envelopeKey}")]
|
||||
public IActionResult Open(string envelopeKey)
|
||||
public async Task<IActionResult> Open(string envelopeKey)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -54,7 +57,7 @@ namespace EnvelopeGenerator.Web.Controllers
|
||||
|
||||
// Validate Envelope Key and load envelope
|
||||
envelopeService.EnsureValidEnvelopeKey(envelopeKey);
|
||||
EnvelopeResponse response = envelopeService.LoadEnvelope(envelopeKey);
|
||||
EnvelopeResponse response = await envelopeService.LoadEnvelope(envelopeKey);
|
||||
|
||||
actionService.OpenEnvelope(response.Envelope, response.Receiver);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user