mirror of
https://github.com/C9Glax/tranga.git
synced 2025-09-10 11:58:19 +02:00
Return all Manga by default, add endpoint to return Mangakeys
This commit is contained in:
@@ -20,16 +20,27 @@ namespace API.Controllers;
|
|||||||
[Route("v{v:apiVersion}/[controller]")]
|
[Route("v{v:apiVersion}/[controller]")]
|
||||||
public class MangaController(MangaContext context) : Controller
|
public class MangaController(MangaContext context) : Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns all cached <see cref="Manga"/>
|
/// Returns all cached <see cref="Manga"/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <response code="200"><see cref="Manga"/> Keys/IDs</response>
|
/// <response code="200"></response>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType<string[]>(Status200OK, "application/json")]
|
[ProducesResponseType<Manga[]>(Status200OK, "application/json")]
|
||||||
public IActionResult GetAllManga()
|
public IActionResult GetAllManga()
|
||||||
{
|
{
|
||||||
string[] ret = context.Mangas.Select(m => m.Key).ToArray();
|
return Ok(context.Mangas.ToArray());
|
||||||
return Ok(ret);
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns all cached <see cref="Manga"/>.Keys
|
||||||
|
/// </summary>
|
||||||
|
/// <response code="200"><see cref="Manga"/> Keys/IDs</response>
|
||||||
|
[HttpGet("Keys")]
|
||||||
|
[ProducesResponseType<string[]>(Status200OK, "application/json")]
|
||||||
|
public IActionResult GetAllMangaKeys()
|
||||||
|
{
|
||||||
|
return Ok(context.Mangas.Select(m => m.Key).ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Reference in New Issue
Block a user