feat(MockController): Erstellt, um einen echten Server zu simulieren

This commit is contained in:
Developer 02 2025-01-30 11:10:41 +01:00
parent 54eca6fceb
commit 1fde6e7e34

View File

@ -0,0 +1,23 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.HttpResults;
using Microsoft.AspNetCore.Mvc;
namespace DigitalData.Swagger.MockAPI.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class MockController : ControllerBase
{
[HttpPost("{servicetierName}/ODataV4/{webserviceName}_CreateInvoice")]
public IActionResult CreateInvoice([FromRoute] string servicetierName, [FromRoute] string webserviceName, [FromQuery] string company)
{
return Created($"{servicetierName}/ODataV4/{webserviceName}?id={1}", new { Id = 1, Foo = 1});
}
[HttpGet("{servicetierName}/ODataV4/{webserviceName}")]
public IActionResult GetInvoice([FromRoute] string servicetierName, [FromRoute] string webserviceName, [FromQuery] string id)
{
return Ok(new { Id = id, Foo = 1 });
}
}
}