switchade t bootstrap och testar solid-bootstrap. konf för calibre. test m covers

This commit is contained in:
2025-09-06 01:27:13 +02:00
parent 5ae7c7f47b
commit 1744a5b7de
11 changed files with 476 additions and 38 deletions

View File

@@ -8,16 +8,24 @@ namespace Bibblan.Controllers
[Route("api/[controller]")]
public class CalibreController : ControllerBase
{
CalibreService service;
public CalibreController(CalibreContext db) {
service = new CalibreService(db);
CalibreService _service;
public CalibreController(CalibreService service) {
_service = service;
}
[HttpGet("books")]
public IActionResult GetBooks()
{
var books = service.GetAllBooks().Take(100).ToList();
var books = _service.GetAllBooks().Take(100).ToList();
return Ok(books);
}
[HttpGet("cover")]
public IActionResult GetCover(string path)
{
var bytes = _service.Cover(path);
return File(bytes, "image/jpeg", true);
}
}
}