29 lines
704 B
C#
29 lines
704 B
C#
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");
|
|
}
|
|
}
|