36 lines
856 B
C#
36 lines
856 B
C#
|
using Chatbot.Api.Application.Queries;
|
|||
|
using MediatR;
|
|||
|
using Microsoft.AspNetCore.Authorization;
|
|||
|
using Microsoft.AspNetCore.Mvc;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace Chatbot.Api.Controllers
|
|||
|
{
|
|||
|
[Authorize]
|
|||
|
[ApiController]
|
|||
|
[Route("system")]
|
|||
|
public class SystemController : ControllerBase
|
|||
|
{
|
|||
|
private readonly IMediator _mediator;
|
|||
|
|
|||
|
public SystemController(IMediator mediator)
|
|||
|
{
|
|||
|
_mediator = mediator;
|
|||
|
}
|
|||
|
|
|||
|
[AllowAnonymous]
|
|||
|
[HttpGet("ping")]
|
|||
|
public IActionResult Ping()
|
|||
|
{
|
|||
|
return Ok("Chatbot api ping success.");
|
|||
|
}
|
|||
|
|
|||
|
[HttpGet("bots")]
|
|||
|
public async Task<IActionResult> GetReleaseNotes([FromRoute] GetBots.Query query)
|
|||
|
{
|
|||
|
var result = await _mediator.Send(query);
|
|||
|
return Ok(result);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|