switchade t bootstrap och testar solid-bootstrap. konf för calibre. test m covers
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user