|
|
@ -11,7 +11,7 @@ namespace APILOL.Controllers.v2
|
|
|
|
{
|
|
|
|
{
|
|
|
|
[ApiController]
|
|
|
|
[ApiController]
|
|
|
|
[Route("api/v{version:apiVersion}/[controller]")]
|
|
|
|
[Route("api/v{version:apiVersion}/[controller]")]
|
|
|
|
[ApiVersion("2.0")]
|
|
|
|
[ApiVersion("2")]
|
|
|
|
public class RunePageController : ControllerBase
|
|
|
|
public class RunePageController : ControllerBase
|
|
|
|
{
|
|
|
|
{
|
|
|
|
IRunePagesManager dataManager;
|
|
|
|
IRunePagesManager dataManager;
|
|
|
@ -28,7 +28,7 @@ namespace APILOL.Controllers.v2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// GET: api/<RunePageController>
|
|
|
|
// GET: api/<RunePageController>
|
|
|
|
[MapToApiVersion("2.0")]
|
|
|
|
[MapToApiVersion("2")]
|
|
|
|
[HttpGet]
|
|
|
|
[HttpGet]
|
|
|
|
public async Task<IActionResult> Get([FromQuery] PageRequest request)
|
|
|
|
public async Task<IActionResult> Get([FromQuery] PageRequest request)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -54,11 +54,11 @@ namespace APILOL.Controllers.v2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GET api/<RunePageController>/5
|
|
|
|
// GET api/<RunePageController>/5
|
|
|
|
[MapToApiVersion("2.0")]
|
|
|
|
[MapToApiVersion("2")]
|
|
|
|
[HttpGet("{name}")]
|
|
|
|
[HttpGet("{name}")]
|
|
|
|
public async Task<IActionResult> Get([FromQuery] PageRequest request, string name)
|
|
|
|
public async Task<IActionResult> Get([FromQuery] PageRequest request, string name)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.LogInformation("API call - [GET / NAME] - RUNEPAGE");
|
|
|
|
_logger.LogInformation("API call - [GET / NAME] - RUNEPAGE {name}",name);
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (dataManager.GetNbItemsByName(name) != null)
|
|
|
|
if (dataManager.GetNbItemsByName(name) != null)
|
|
|
@ -82,7 +82,7 @@ namespace APILOL.Controllers.v2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// POST api/<RunePageController>
|
|
|
|
// POST api/<RunePageController>
|
|
|
|
[MapToApiVersion("2.0")]
|
|
|
|
[MapToApiVersion("2")]
|
|
|
|
[HttpPost]
|
|
|
|
[HttpPost]
|
|
|
|
public async Task<IActionResult> Post([FromBody] RunePageDTO runePageDTO)
|
|
|
|
public async Task<IActionResult> Post([FromBody] RunePageDTO runePageDTO)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -106,11 +106,11 @@ namespace APILOL.Controllers.v2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// PUT api/<RunePage>/5
|
|
|
|
// PUT api/<RunePage>/5
|
|
|
|
[MapToApiVersion("2.0")]
|
|
|
|
[MapToApiVersion("2")]
|
|
|
|
[HttpPut("{name}")]
|
|
|
|
[HttpPut("{name}")]
|
|
|
|
public async Task<IActionResult> PutAsync(string name, [FromBody] RunePageDTO runePageDTO)
|
|
|
|
public async Task<IActionResult> PutAsync(string name, [FromBody] RunePageDTO runePageDTO)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.LogInformation("API call - [PUT / NAME] - RUNEPAGE");
|
|
|
|
_logger.LogInformation("API call - [PUT / NAME] - RUNEPAGE {name}", name);
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var runePage = await dataManager
|
|
|
|
var runePage = await dataManager
|
|
|
@ -147,11 +147,11 @@ namespace APILOL.Controllers.v2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// DELETE api/<RunePageController>/5
|
|
|
|
// DELETE api/<RunePageController>/5
|
|
|
|
[MapToApiVersion("2.0")]
|
|
|
|
[MapToApiVersion("2")]
|
|
|
|
[HttpDelete("{name}")]
|
|
|
|
[HttpDelete("{name}")]
|
|
|
|
public async Task<IActionResult> Delete(string name)
|
|
|
|
public async Task<IActionResult> Delete(string name)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_logger.LogInformation("API call - [DELETE / NAME] - RUNEPAGE");
|
|
|
|
_logger.LogInformation("API call - [DELETE / NAME] - RUNEPAGE {name}", name);
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var runePage = await (dataManager.GetItemsByName(name, 0, await dataManager.GetNbItems()));
|
|
|
|
var runePage = await (dataManager.GetItemsByName(name, 0, await dataManager.GetNbItems()));
|
|
|
|