cfmgrv4 init...10

This commit is contained in:
최준흠 2025-03-12 16:13:07 +09:00
parent f190249475
commit b74684f8bd
2 changed files with 71 additions and 1 deletions

View File

@ -11,7 +11,6 @@ use CodeIgniter\HTTP\RedirectResponse;
use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface; use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use App\Services\MyLogService;
class ZoneController extends CloudflareController class ZoneController extends CloudflareController
{ {

View File

@ -9,6 +9,7 @@ use CodeIgniter\HTTP\RedirectResponse;
use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface; use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use App\Services\MyLogService;
class MapurlController extends AdminController class MapurlController extends AdminController
{ {
@ -50,6 +51,12 @@ class MapurlController extends AdminController
$this->init('create', [$this->getService()->getModel()::TITLE, 'newurl', 'status']); $this->init('create', [$this->getService()->getModel()::TITLE, 'newurl', 'status']);
return $this->create_form_procedure(); return $this->create_form_procedure();
} }
protected function create_process_failed($message): RedirectResponse|string
{
MyLogService::add("error", $message);
MyLogService::save($this->getService()->getClassName(), __FUNCTION__, MESSAGES["FAILED"], $this->myauth->getUIDByAuthInfo());
return parent::create_process_failed($message);
}
protected function create_process(): void protected function create_process(): void
{ {
parent::create_process(); parent::create_process();
@ -60,6 +67,7 @@ class MapurlController extends AdminController
$this->init(__FUNCTION__, [$this->getService()->getModel()::TITLE, 'newurl', 'status']); $this->init(__FUNCTION__, [$this->getService()->getModel()::TITLE, 'newurl', 'status']);
return $this->create_procedure(); return $this->create_procedure();
} }
//수정 //수정
public function modify_form(int $uid): RedirectResponse|string public function modify_form(int $uid): RedirectResponse|string
{ {
@ -67,6 +75,18 @@ class MapurlController extends AdminController
return $this->modify_form_procedure($uid); return $this->modify_form_procedure($uid);
} }
//(modify,toggle,batchjob사용) //(modify,toggle,batchjob사용)
//수정관련
protected function modify_process_result($message): RedirectResponse|string
{
MyLogService::save($this->getService()->getClassName(), __FUNCTION__, $message, $this->myauth->getUIDByAuthInfo());
return parent::modify_process_result($message);
}
protected function modify_process_failed($message): RedirectResponse|string
{
MyLogService::add("error", $message);
MyLogService::save($this->getService()->getClassName(), __FUNCTION__, MESSAGES["FAILED"], $this->myauth->getUIDByAuthInfo());
return parent::modify_process_failed($message);
}
protected function modify_process(mixed $uid): void protected function modify_process(mixed $uid): void
{ {
parent::modify_process($uid); parent::modify_process($uid);
@ -77,16 +97,42 @@ class MapurlController extends AdminController
$this->init(__FUNCTION__, [$this->getService()->getModel()::TITLE, 'newurl', 'status']); $this->init(__FUNCTION__, [$this->getService()->getModel()::TITLE, 'newurl', 'status']);
return $this->modify_procedure($uid); return $this->modify_procedure($uid);
} }
//단일필드작업
protected function toggle_process_result($message): RedirectResponse|string
{
MyLogService::save($this->getService()->getClassName(), __FUNCTION__, $message, $this->myauth->getUIDByAuthInfo());
return parent::toggle_process_result($message);
}
protected function toggle_process_failed($message): RedirectResponse|string
{
MyLogService::add("error", $message);
MyLogService::save($this->getService()->getClassName(), __FUNCTION__, MESSAGES["FAILED"], $this->myauth->getUIDByAuthInfo());
return parent::toggle_process_failed($message);
}
public function toggle(mixed $uid, string $field): RedirectResponse public function toggle(mixed $uid, string $field): RedirectResponse
{ {
return $this->toggle_procedure($uid, $field); return $this->toggle_procedure($uid, $field);
} }
//일괄처리작업 //일괄처리작업
protected function batchjob_process_result($message): RedirectResponse|string
{
MyLogService::save($this->getService()->getClassName(), __FUNCTION__, $message, $this->myauth->getUIDByAuthInfo());
return parent::batchjob_process_result($message);
}
protected function batchjob_process_failed($message): RedirectResponse|string
{
MyLogService::add("error", $message);
MyLogService::save($this->getService()->getClassName(), __FUNCTION__, MESSAGES["FAILED"], $this->myauth->getUIDByAuthInfo());
return parent::batchjob_process_failed($message);
}
public function batchjob(): RedirectResponse public function batchjob(): RedirectResponse
{ {
$this->init(__FUNCTION__); $this->init(__FUNCTION__);
return $this->batchjob_procedure(); return $this->batchjob_procedure();
} }
//View //View
public function view(int $uid): RedirectResponse|string public function view(int $uid): RedirectResponse|string
{ {
@ -94,11 +140,36 @@ class MapurlController extends AdminController
return $this->view_procedure($uid); return $this->view_procedure($uid);
} }
//삭제 //삭제
protected function delete_process_result($message): RedirectResponse|string
{
MyLogService::save($this->getService()->getClassName(), __FUNCTION__, $message, $this->myauth->getUIDByAuthInfo());
return parent::delete_process_result($message);
}
protected function delete_process_failed($message): RedirectResponse|string
{
MyLogService::add("error", $message);
MyLogService::save($this->getService()->getClassName(), __FUNCTION__, MESSAGES["FAILED"], $this->myauth->getUIDByAuthInfo());
return parent::delete_process_failed($message);
}
protected function delete_process(mixed $uid): void protected function delete_process(mixed $uid): void
{ {
parent::delete_process($uid); parent::delete_process($uid);
$this->remaping_process(); $this->remaping_process();
} }
//일괄삭제
protected function batchdelete_process_result($message): RedirectResponse|string
{
MyLogService::save($this->getService()->getClassName(), __FUNCTION__, $message, $this->myauth->getUIDByAuthInfo());
return parent::batchjob_delete_process_result($message);
}
protected function batchdelete_process_failed($message): RedirectResponse|string
{
MyLogService::add("error", $message);
MyLogService::save($this->getService()->getClassName(), __FUNCTION__, MESSAGES["FAILED"], $this->myauth->getUIDByAuthInfo());
return parent::batchjob_delete_process_failed($message);
}
// 리스트 // 리스트
public function index(): string public function index(): string
{ {