27 lines
561 B
C#
27 lines
561 B
C#
using Microsoft.AspNetCore.Components;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using RouteAttribute = Microsoft.AspNetCore.Mvc.RouteAttribute;
|
|
|
|
|
|
namespace ApiServer.Controllers
|
|
{
|
|
[ApiController]
|
|
[Route("api")]
|
|
public class PostContoller
|
|
{
|
|
[HttpGet]
|
|
[Route("post")]
|
|
public string GetUserPost()
|
|
{
|
|
return "Hello, user! Your post is best!";
|
|
}
|
|
|
|
[HttpGet]
|
|
[Route("admin")]
|
|
public string GetAdmin()
|
|
{
|
|
return "Hello, Admin! It's your POST!!!";
|
|
}
|
|
}
|
|
}
|