forked from gongxuegit/tiku-backend.net
feat: add tenant resolve and health endpoints
This commit is contained in:
24
Tiku.Api/Controllers/HealthController.cs
Normal file
24
Tiku.Api/Controllers/HealthController.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Tiku.Api.Contracts;
|
||||
|
||||
namespace Tiku.Api.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[AllowAnonymous]
|
||||
[Produces("application/json")]
|
||||
[Route("api/health")]
|
||||
public sealed class HealthController : ControllerBase
|
||||
{
|
||||
[HttpGet]
|
||||
[EndpointSummary("健康检查")]
|
||||
[EndpointDescription("用于本地、CI 和部署环境 smoke test 的轻量健康检查。")]
|
||||
[ProducesResponseType<HealthResponseDto>(StatusCodes.Status200OK)]
|
||||
public ActionResult<HealthResponseDto> Get()
|
||||
{
|
||||
return Ok(new HealthResponseDto(
|
||||
"ok",
|
||||
"tiku-api",
|
||||
DateTimeOffset.UtcNow));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user