refactor: use HttpGet for api routes
This commit is contained in:
parent
d3958fc22c
commit
3e20e41565
|
@ -16,14 +16,14 @@ public sealed class BlogApiController : ControllerBase
|
||||||
_blogService = blogService;
|
_blogService = blogService;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Route("count")]
|
[HttpGet("count")]
|
||||||
public IActionResult Count()
|
public IActionResult Count()
|
||||||
{
|
{
|
||||||
if (!ValidateReferer()) return NotFound();
|
if (!ValidateReferer()) return NotFound();
|
||||||
return Ok(new { count = _blogService.AllPosts.Count });
|
return Ok(new { count = _blogService.AllPosts.Count });
|
||||||
}
|
}
|
||||||
|
|
||||||
[Route("all/{skip:int?}/{take:int?}")]
|
[HttpGet("all/{skip:int?}/{take:int?}")]
|
||||||
public IActionResult GetAllBlogPosts(int skip = 0, int take = -1)
|
public IActionResult GetAllBlogPosts(int skip = 0, int take = -1)
|
||||||
{
|
{
|
||||||
if (!ValidateReferer()) return NotFound();
|
if (!ValidateReferer()) return NotFound();
|
||||||
|
@ -52,7 +52,7 @@ public sealed class BlogApiController : ControllerBase
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Route("author/{id:int}")]
|
[HttpGet("author/{id:int}")]
|
||||||
public IActionResult GetAuthor(int id)
|
public IActionResult GetAuthor(int id)
|
||||||
{
|
{
|
||||||
if (!ValidateReferer()) return NotFound();
|
if (!ValidateReferer()) return NotFound();
|
||||||
|
|
Loading…
Reference in New Issue