cfmgrv4/app/Controllers/Cloudflare/ZoneController.php
2024-10-25 10:55:02 +09:00

52 lines
1.6 KiB
PHP

<?php
namespace App\Controllers\Cloudflare;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Models\Cloudflare\ZoneModel;
use App\Services\Cloudflare\ZoneService;
class ZoneController extends CloudflareController
{
private $_account_entity = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
}
final protected function getModel(): ZoneModel
{
if ($this->model === null) {
$this->model = new ZoneModel();
}
return $this->model;
}
protected function getService(): ZoneService
{
if ($this->service === null) {
$this->service = new ZoneService();
}
return $this->service;
}
//Trigger작업
protected function webhook_process(): void
{
parent::webhook_process();
// //자신정보정의
// $this->entity = $this->getModel()->getEntityByPK($uid);
// if ($this->entity === null) {
// throw new \Exception("{$uid} 정보를 찾을수 없습니다.");
// }
// //부모데이터정의
// $this->_account_entity = $this->getAccountModel()->getEntityByPK($this->entity->getParent());
// //Socket처리
// $this->entity = $this->getMyLibrary()->sync($this->entity);
log_message("notice", "Zone Trigger 작업완료");
}
public function webhook(): ResponseInterface
{
return $this->webhook_procedure();
}
}