Add attachments, more pages
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Tyler
2020-12-26 19:34:07 -05:00
parent d086b29bcc
commit a1ac81a73a
29 changed files with 2349 additions and 17899 deletions

View File

@ -0,0 +1,19 @@
<?php
namespace App\Services\BookInformation;
use Cache;
class CachedService implements BookLookupService {
private $service;
public function __construct($service) {
$this->service = $service;
}
public function lookup($isbn) {
return Cache::remember('isbn_' . $isbn, 86400, function() use ($isbn) {
return $this->service->lookup($isbn);
});
}
}

View File

@ -22,9 +22,10 @@ class GoogleBooks implements BookLookupService {
*/
$volume = Arr::first($results->getItems())->getVolumeInfo();
return [
return (object) [
'title' => $volume->getTitle(),
'authors' => $volume->getAuthors()
'authors' => $volume->getAuthors(),
'images' => $volume->getImageLinks(),
];
}
}