34 lines
821 B
C#
34 lines
821 B
C#
|
using Microsoft.AspNetCore.Authorization;
|
|||
|
using Microsoft.AspNetCore.Mvc;
|
|||
|
using Microsoft.Extensions.Logging;
|
|||
|
using System;
|
|||
|
|
|||
|
namespace NDB.Test.Api.Controllers
|
|||
|
{
|
|||
|
[Authorize]
|
|||
|
[ApiController]
|
|||
|
[Route("[controller]")]
|
|||
|
public class DebugController : ControllerBase
|
|||
|
{
|
|||
|
private readonly ILogger<DebugController> _logger;
|
|||
|
|
|||
|
public DebugController(ILogger<DebugController> logger)
|
|||
|
{
|
|||
|
_logger = logger;
|
|||
|
}
|
|||
|
|
|||
|
[AllowAnonymous]
|
|||
|
[HttpGet("ping")]
|
|||
|
public IActionResult Ping()
|
|||
|
{
|
|||
|
return Ok($"Ping success. System datetime: {DateTime.Now}");
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("ping-auth")]
|
|||
|
public IActionResult PingAuth()
|
|||
|
{
|
|||
|
return Ok($"Secured ping success. System datetime: {DateTime.Now}");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|