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));
    }
}
