From 5b9e3d59a53e94076cb0bf7e028a211c3b8ed4de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Mon, 15 Dec 2025 11:43:34 +0900 Subject: [PATCH] dbmsv4 init...3 --- app/Forms/CommonForm.php | 2 +- app/Services/CommonService.php | 16 ++++++++-------- app/Services/Equipment/ServerService.php | 2 +- app/Services/Part/PartType2Service.php | 2 +- app/Services/Part/PartType3Service.php | 2 +- app/Services/PaymentService.php | 6 ++++++ 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/app/Forms/CommonForm.php b/app/Forms/CommonForm.php index 68d8664..ac3b7b6 100644 --- a/app/Forms/CommonForm.php +++ b/app/Forms/CommonForm.php @@ -140,7 +140,7 @@ abstract class CommonForm // run()에는 데이터만 전달 (setRules에서 이미 설정됨) $result = $this->_validation->run($formDatas); if ($result === false) { - $message = __METHOD__ . "에서 데이터 검증 오류발생: " . var_export($this->_validation->getErrors(), true); + $message = static::class . '->' . __FUNCTION__ . "에서 데이터 검증 오류발생: " . var_export($this->_validation->getErrors(), true); log_message('debug', $message); throw new RuntimeException($message); } else { diff --git a/app/Services/CommonService.php b/app/Services/CommonService.php index 23e5f1d..5840a67 100644 --- a/app/Services/CommonService.php +++ b/app/Services/CommonService.php @@ -67,7 +67,7 @@ abstract class CommonService } catch (DatabaseException $e) { $errorMessage = sprintf( "\n------DB Query 오류 (%s)-----\nQuery: %s\nError: %s\n------------------------------\n", - __FUNCTION__, + static::class . '->' . __FUNCTION__, $this->model->getLastQuery() ?? "No Query Available", $e->getMessage() ); @@ -76,7 +76,7 @@ abstract class CommonService } catch (\Exception $e) { $errorMessage = sprintf( "\n------일반 오류 (%s)-----\nError: %s\n------------------------------\n", - __FUNCTION__, + static::class . '->' . __FUNCTION__, $e->getMessage() ); throw new \Exception($errorMessage, $e->getCode(), $e); @@ -108,7 +108,7 @@ abstract class CommonService } catch (DatabaseException $e) { $errorMessage = sprintf( "\n------DB Query 오류 (%s)-----\nQuery: %s\nError: %s\n------------------------------\n", - __FUNCTION__, + static::class . '->' . __FUNCTION__, $this->model->getLastQuery() ?? "No Query Available", $e->getMessage() ); @@ -117,7 +117,7 @@ abstract class CommonService } catch (\Exception $e) { $errorMessage = sprintf( "\n------일반 오류 (%s)-----\nError: %s\n------------------------------\n", - __FUNCTION__, + static::class . '->' . __FUNCTION__, $e->getMessage() ); throw new \Exception($errorMessage, $e->getCode(), $e); @@ -199,7 +199,7 @@ abstract class CommonService // DatabaseException을 포착하면 자동으로 롤백 처리됨 throw new RuntimeException(sprintf( "\n----[%s]에서 트랜잭션 실패: DB 오류----\n%s\n%s\n------------------------------\n", - __METHOD__, + static::class . '->' . __FUNCTION__, $this->model->getLastQuery(), $e->getMessage() ), $e->getCode(), $e); @@ -263,7 +263,7 @@ abstract class CommonService // DatabaseException을 포착하면 자동으로 롤백 처리됨 throw new RuntimeException(sprintf( "\n----[%s]에서 트랜잭션 실패: DB 오류----\n%s\n%s\n------------------------------\n", - __METHOD__, + static::class . '->' . __FUNCTION__, $this->model->getLastQuery(), $e->getMessage() ), $e->getCode(), $e); @@ -342,7 +342,7 @@ abstract class CommonService // DatabaseException을 포착하면 자동으로 롤백 처리됨 throw new RuntimeException(sprintf( "\n----[%s]에서 트랜잭션 실패: DB 오류----\n%s\n%s\n------------------------------\n", - __METHOD__, + __FUNCTION__, $this->model->getLastQuery(), $e->getMessage() ), $e->getCode(), $e); @@ -385,7 +385,7 @@ abstract class CommonService // DatabaseException을 포착하면 자동으로 롤백 처리됨 throw new RuntimeException(sprintf( "\n----[%s]에서 트랜잭션 실패: DB 오류----\n%s\n%s\n------------------------------\n", - __METHOD__, + __FUNCTION__, $this->model->getLastQuery(), $e->getMessage() ), $e->getCode(), $e); diff --git a/app/Services/Equipment/ServerService.php b/app/Services/Equipment/ServerService.php index 779ff33..edaa4bb 100644 --- a/app/Services/Equipment/ServerService.php +++ b/app/Services/Equipment/ServerService.php @@ -224,7 +224,7 @@ class ServerService extends EquipmentService { //필수항목검사 if (!array_key_exists('chassisinfo_uid', $formDatas)) { - throw new RuntimeException(__METHOD__ . '에서 오류발생: 샷시정보가 정의되지 않았습니다.'); + throw new RuntimeException(static::class . '->' . __FUNCTION__ . '에서 오류발생: 샷시정보가 정의되지 않았습니다.'); } //변경전 정보 $oldEntity = clone $entity; diff --git a/app/Services/Part/PartType2Service.php b/app/Services/Part/PartType2Service.php index 62d9d32..10f8457 100644 --- a/app/Services/Part/PartType2Service.php +++ b/app/Services/Part/PartType2Service.php @@ -24,7 +24,7 @@ abstract class PartType2Service extends PartService $entity = $this->getPartEntityByServerPart($serverPartEntity); //상태확인 if ($entity->getStatus() !== STATUS['AVAILABLE']) { - throw new \Exception(__METHOD__ . ":에서 오류발생: {$entity->getTitle()}는 사용중입니다."); + throw new \Exception(static::class . '->' . __FUNCTION__ . ":에서 오류발생: {$entity->getTitle()}는 사용중입니다."); } //파트정보 수정 return parent::modify_process($entity, $formDatas); diff --git a/app/Services/Part/PartType3Service.php b/app/Services/Part/PartType3Service.php index 593d5f9..3f972a5 100644 --- a/app/Services/Part/PartType3Service.php +++ b/app/Services/Part/PartType3Service.php @@ -23,7 +23,7 @@ abstract class PartType3Service extends PartType2Service //파트정보가져오기 $entity = $this->getPartEntityByServer($serverEntity); if ($entity->getStatus() !== STATUS['AVAILABLE']) { - throw new \Exception(__METHOD__ . ":에서 오류발생: {$entity->getTitle()}는 사용중입니다."); + throw new \Exception(static::class . '->' . __FUNCTION__ . ":에서 오류발생: {$entity->getTitle()}는 사용중입니다."); } //파트정보 수정 return parent::modify_process($entity, $formDatas); diff --git a/app/Services/PaymentService.php b/app/Services/PaymentService.php index 3a9644a..3963694 100644 --- a/app/Services/PaymentService.php +++ b/app/Services/PaymentService.php @@ -149,6 +149,12 @@ class PaymentService extends CommonService //기본 기능부분 protected function getEntity_process(mixed $entity): PaymentEntity { + $errorMessage = sprintf( + "\n------Last Query (%s)-----\nQuery: %s\n------------------------------\n", + static::class . '->' . __FUNCTION__, + $this->model->getLastQuery() ?? "No Query Available", + ); + log_message('error', $errorMessage); return $entity; } //List 검색용