mirror of
https://github.com/rekryt/iplist.git
synced 2025-10-12 08:34:15 +03:00
36 lines
831 B
PHP
36 lines
831 B
PHP
<?php
|
|
|
|
namespace OpenCCK\App\Controller;
|
|
|
|
use Amp\ByteStream\BufferException;
|
|
use Amp\Http\Server\Request;
|
|
|
|
use OpenCCK\App\Service\IPListService;
|
|
use OpenCCK\Infrastructure\API\App;
|
|
|
|
use Monolog\Logger;
|
|
use Throwable;
|
|
|
|
abstract class AbstractIPListController extends AbstractController {
|
|
protected Logger $logger;
|
|
protected IPListService $service;
|
|
|
|
/**
|
|
* @param Request $request
|
|
* @param array $headers
|
|
* @throws BufferException
|
|
* @throws Throwable
|
|
*/
|
|
public function __construct(protected Request $request, protected array $headers = []) {
|
|
parent::__construct($request, $this->headers);
|
|
|
|
$this->logger = App::getLogger();
|
|
$this->service = IPListService::getInstance();
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
abstract public function getBody(): string;
|
|
}
|