|
|
|
@@ -0,0 +1,42 @@ |
|
|
|
<?php |
|
|
|
|
|
|
|
namespace App\Http\Controllers\Web\Image; |
|
|
|
|
|
|
|
use App\Http\Controllers\Web\WebController; |
|
|
|
use App\Kintone\KintoneAccess; |
|
|
|
use App\Kintone\Models\SeasonTicketContract; |
|
|
|
use Illuminate\Http\Request; |
|
|
|
use Illuminate\Http\Response; |
|
|
|
|
|
|
|
abstract class ImageController extends WebController |
|
|
|
{ |
|
|
|
|
|
|
|
public function name(): string |
|
|
|
{ |
|
|
|
return "画像取得"; |
|
|
|
} |
|
|
|
|
|
|
|
public function description(): string |
|
|
|
{ |
|
|
|
return "KINTONEから画像を取得する"; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function __construct(protected ImageParam $param) |
|
|
|
{ |
|
|
|
parent::__construct(); |
|
|
|
$this->middleware('auth:sanctum'); |
|
|
|
} |
|
|
|
|
|
|
|
protected function run(Request $request): Response |
|
|
|
{ |
|
|
|
$access = $this->getAccess(); |
|
|
|
$file = $access->fileGet($this->param->id); |
|
|
|
return response($file->body(), 200, [ |
|
|
|
'Content-Length' => $file->header('Content-Length'), |
|
|
|
'Content-Type' => $file->header('Content-Type'), |
|
|
|
]); |
|
|
|
} |
|
|
|
|
|
|
|
abstract protected function getAccess(): KintoneAccess; |
|
|
|
} |