mirror of
https://github.com/Jetsparrow/jetherald.git
synced 2026-01-21 07:56:09 +03:00
Remove echo route and add hello route
This commit is contained in:
parent
12059f83dc
commit
5c4e391804
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
21
JetHerald/Controllers/HelloController.cs
Normal file
21
JetHerald/Controllers/HelloController.cs
Normal 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
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user