cfmgrv4 init...3

This commit is contained in:
최준흠 2024-10-23 09:11:51 +09:00
parent b3adac0787
commit a4c262bfaf
4 changed files with 19 additions and 13 deletions

View File

@ -53,15 +53,18 @@ abstract class CloudflareController extends MVController
return $this->_recordModel; return $this->_recordModel;
} }
//Trigger //Trigger
protected function trigger_process(mixed $uid): void {} protected function trigger_process(): void
final protected function trigger_procedure(mixed $uid): ResponseInterface {
log_message("debug", var_export($this->request->getVar(), true));
}
final protected function trigger_procedure(): ResponseInterface
{ {
//Transaction Start //Transaction Start
$this->getModel()->transStart(); $this->getModel()->transStart();
try { try {
// 여기에 필요한 로직을 구현하세요 // 여기에 필요한 로직을 구현하세요
log_message("debug", var_export($this->request->getVar(), true)); log_message("debug", var_export($this->request->getVar(), true));
$this->trigger_process($uid); $this->trigger_process();
$this->message = "{$this->class_name}: Trigger 작업이 완료되었습니다."; $this->message = "{$this->class_name}: Trigger 작업이 완료되었습니다.";
$this->getModel()->transCommit(); $this->getModel()->transCommit();
log_message("notice", __FUNCTION__ . $this->message); log_message("notice", __FUNCTION__ . $this->message);

View File

@ -34,8 +34,9 @@ class FirewallController extends CloudflareController
return $this->_myLibrays[$this->_zone_entity->getPK()]; return $this->_myLibrays[$this->_zone_entity->getPK()];
} }
//Trigger작업 //Trigger작업
protected function trigger_process(mixed $uid): void protected function trigger_process(): void
{ {
parent::trigger_process();
// //자신정보정의 // //자신정보정의
// $this->entity = $this->getModel()->getEntityByPK($uid); // $this->entity = $this->getModel()->getEntityByPK($uid);
// if ($this->entity === null) { // if ($this->entity === null) {
@ -47,8 +48,8 @@ class FirewallController extends CloudflareController
// $this->entity = $this->getMyLibrary()->sync($this->entity); // $this->entity = $this->getMyLibrary()->sync($this->entity);
log_message("notice", message: "Firewall Trigger 작업완료"); log_message("notice", message: "Firewall Trigger 작업완료");
} }
public function trigger(mixed $uid): ResponseInterface public function trigger(): ResponseInterface
{ {
return $this->trigger_procedure($uid); return $this->trigger_procedure();
} }
} }

View File

@ -34,8 +34,9 @@ class RecordController extends CloudflareController
return $this->_myLibrays[$this->_zone_entity->getPK()]; return $this->_myLibrays[$this->_zone_entity->getPK()];
} }
//Trigger작업 //Trigger작업
protected function trigger_process(mixed $uid): void protected function trigger_process(): void
{ {
parent::trigger_process();
// //자신정보정의 // //자신정보정의
// $this->entity = $this->getModel()->getEntityByPK($uid); // $this->entity = $this->getModel()->getEntityByPK($uid);
// if ($this->entity === null) { // if ($this->entity === null) {
@ -47,8 +48,8 @@ class RecordController extends CloudflareController
// $this->entity = $this->getMyLibrary()->sync($this->entity); // $this->entity = $this->getMyLibrary()->sync($this->entity);
log_message("notice", "Record Trigger 작업완료"); log_message("notice", "Record Trigger 작업완료");
} }
public function trigger(mixed $uid): ResponseInterface public function trigger(): ResponseInterface
{ {
return $this->trigger_procedure($uid); return $this->trigger_procedure();
} }
} }

View File

@ -34,8 +34,9 @@ class ZoneController extends CloudflareController
return $this->_myLibrays[$this->_account_entity->getPK()]; return $this->_myLibrays[$this->_account_entity->getPK()];
} }
//Trigger작업 //Trigger작업
protected function trigger_process(mixed $uid): void protected function trigger_process(): void
{ {
parent::trigger_process();
// //자신정보정의 // //자신정보정의
// $this->entity = $this->getModel()->getEntityByPK($uid); // $this->entity = $this->getModel()->getEntityByPK($uid);
// if ($this->entity === null) { // if ($this->entity === null) {
@ -45,10 +46,10 @@ class ZoneController extends CloudflareController
// $this->_account_entity = $this->getAccountModel()->getEntityByPK($this->entity->getParent()); // $this->_account_entity = $this->getAccountModel()->getEntityByPK($this->entity->getParent());
// //Socket처리 // //Socket처리
// $this->entity = $this->getMyLibrary()->sync($this->entity); // $this->entity = $this->getMyLibrary()->sync($this->entity);
log_message("notice", "Zone Trigger {$uid} 작업완료"); log_message("notice", "Zone Trigger 작업완료");
} }
public function trigger(mixed $uid): ResponseInterface public function trigger(): ResponseInterface
{ {
return $this->trigger_procedure($uid); return $this->trigger_procedure();
} }
} }