Remove echo route and add hello route

This commit is contained in:
Basique Evangelist 2021-03-02 22:10:16 +03:00
parent b89076cbfb
commit 878eef6485
3 changed files with 22 additions and 24 deletions

View File

@ -1,23 +0,0 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace JetHerald.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class EchoController : ControllerBase
{
[HttpGet]
public async Task<IActionResult> Get(string msg)
{
await Task.Delay(100);
return Ok(msg);
}
[HttpPost]
public IActionResult GetSync(string msg)
{
return Ok(msg);
}
}
}

View File

@ -0,0 +1,21 @@
using System.Reflection;
using Microsoft.AspNetCore.Mvc;
namespace JetHerald.Controllers
{
[ApiController]
public class HelloController : ControllerBase
{
[Route("api/hello")]
[HttpGet]
public object Hello()
{
return new
{
status = "OK",
server_name = "JetHerald",
server_version = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion
};
}
}
}

View File

@ -5,7 +5,6 @@ using Microsoft.AspNetCore.Mvc;
namespace JetHerald.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class ReportController : ControllerBase
{
@ -18,6 +17,7 @@ namespace JetHerald.Controllers
Db = db;
}
[Route("api/report")]
[HttpPost]
public async Task<IActionResult> Post([FromBody] ReportArgs args)
{