Deprecate services in favor of MediatR integration
This commit introduces the `[Obsolete("Use MediatR")]` attribute to various service fields and methods across multiple controllers and extension classes, signaling a transition to MediatR for handling requests and commands.
Key changes include:
- Marking `IEnvelopeService`, `IEnvelopeReceiverService`, and `IEnvelopeTypeService` as obsolete in their respective controllers.
- Updating `AddEnvelopeGeneratorInfrastructureServices` to utilize `IRepository`.
- Refactoring `AddCommandManagerRunner` and `CreateHost` methods to indicate obsolescence.
- Replacing `DigitalData.Core.DTO` with `DigitalData.Core.Abstraction.Application.DTO` in using directives.
These changes modernize the codebase and improve command and query handling while cleaning up service dependencies.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using DigitalData.Core.DTO;
|
||||
using DigitalData.Core.Abstraction.Application.DTO;
|
||||
using EnvelopeGenerator.Application.Contracts.Services;
|
||||
using EnvelopeGenerator.Application.Envelopes.Commands;
|
||||
using EnvelopeGenerator.Application.Envelopes.Queries.Read;
|
||||
@@ -6,8 +6,6 @@ using MediatR;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace EnvelopeGenerator.GeneratorAPI.Controllers;
|
||||
|
||||
@@ -31,6 +29,7 @@ namespace EnvelopeGenerator.GeneratorAPI.Controllers;
|
||||
public class EnvelopeController : ControllerBase
|
||||
{
|
||||
private readonly ILogger<EnvelopeController> _logger;
|
||||
[Obsolete("Use MediatR")]
|
||||
private readonly IEnvelopeService _envelopeService;
|
||||
private readonly IMediator _mediator;
|
||||
|
||||
@@ -40,6 +39,7 @@ public class EnvelopeController : ControllerBase
|
||||
/// <param name="logger">Der Logger, der für das Protokollieren von Informationen verwendet wird.</param>
|
||||
/// <param name="envelopeService">Der Dienst, der für die Verarbeitung von Umschlägen zuständig ist.</param>
|
||||
/// <param name="mediator"></param>
|
||||
[Obsolete("Use MediatR")]
|
||||
public EnvelopeController(ILogger<EnvelopeController> logger, IEnvelopeService envelopeService, IMediator mediator)
|
||||
{
|
||||
_logger = logger;
|
||||
@@ -59,6 +59,7 @@ public class EnvelopeController : ControllerBase
|
||||
/// <response code="500">Ein unerwarteter Fehler ist aufgetreten.</response>
|
||||
[Authorize]
|
||||
[HttpGet]
|
||||
[Obsolete("Use MediatR")]
|
||||
public async Task<IActionResult> GetAsync([FromQuery] ReadEnvelopeQuery envelope)
|
||||
{
|
||||
if (User.GetId() is int intId)
|
||||
@@ -98,6 +99,7 @@ public class EnvelopeController : ControllerBase
|
||||
/// <response code="404">Das Dokument wurde nicht gefunden oder ist nicht verfügbar.</response>
|
||||
/// <response code="500">Ein unerwarteter Fehler ist aufgetreten.</response>
|
||||
[HttpGet("doc-result")]
|
||||
[Obsolete("Use MediatR")]
|
||||
public async Task<IActionResult> GetDocResultAsync([FromQuery] int id, [FromQuery] bool view = false)
|
||||
{
|
||||
if (User.GetId() is int intId)
|
||||
@@ -154,4 +156,4 @@ public class EnvelopeController : ControllerBase
|
||||
else
|
||||
return Ok(res);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user