Add project files.
This commit is contained in:
28
Gateway/Controllers/TestController.cs
Normal file
28
Gateway/Controllers/TestController.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Gateway.Data;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Gateway.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/test")]
|
||||
public class TestController : ControllerBase
|
||||
{
|
||||
private readonly SqlService _sql;
|
||||
|
||||
public TestController(SqlService sql)
|
||||
{
|
||||
_sql = sql;
|
||||
}
|
||||
|
||||
[HttpGet("ping")]
|
||||
public async Task<IActionResult> Ping(CancellationToken ct)
|
||||
{
|
||||
// Use a real clientId that exists in tbClient (or you'll hit your FK check)
|
||||
var rqst = """
|
||||
{ "clientId":"00000000-0000-0000-0000-000000000001" }
|
||||
""";
|
||||
|
||||
var resp = await _sql.ExecProcAsync("dbo.spTemplate", "ping", rqst, ct: ct);
|
||||
return Content(resp, "application/json");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user