2021-11-24 03:40:30 +02:00
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
|
using System;
|
|
|
|
|
|
2023-01-12 01:01:36 +02:00
|
|
|
|
namespace Netmash.Test.Api.Controllers
|
2021-11-24 03:40:30 +02:00
|
|
|
|
{
|
|
|
|
|
[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}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|