You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
873 B
C#

using Microsoft.AspNetCore.Mvc;
using NapCatRobotClient.Service.Dispatcher.Service;
namespace NapCatRobotClient.API.Controllers
{
[ApiController]
[Route("api/[controller]")]
public class EntryController : ControllerBase
{
private readonly IDispatcherService _dispatcherService;
public EntryController(IDispatcherService dispatcherService)
{
_dispatcherService = dispatcherService;
}
/// <summary>
/// ½ÓÊÕÏûÏ¢Èë¿Ú
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<IActionResult> Post()
{
using StreamReader reader = new(Request.Body);
string body = await reader.ReadToEndAsync();
bool result = await _dispatcherService.ReceiveMessageAndProcess(body);
return Ok(result);
}
}
}