Developer 02 941b98b1a4 feat(SmsResponse): Erstellung eines Standardantwort-DTOs für SMS-Anfragen.
- GtxMessagingResponse für rohe dynamische Antwort erstellt.
 - Mapping-Profil hinzufügen
2024-11-27 15:13:41 +01:00

24 lines
769 B
C#

using EnvelopeGenerator.Application.Contracts;
using Microsoft.AspNetCore.Mvc;
namespace EnvelopeGenerator.Web.Controllers.Test
{
[Route("api/[controller]")]
[ApiController]
public class TestMessagingController : ControllerBase
{
private readonly IMessagingService _service;
public TestMessagingController(IMessagingService service)
{
_service = service;
}
[HttpPost]
public async Task<IActionResult> SendAsync(string recipient, string message, bool staticResponse = true)
{
var res = await _service.SendSmsAsync(recipient: recipient, message: message);
return res is null? StatusCode(StatusCodes.Status500InternalServerError) : Ok(res);
}
}
}