From 6b7f5fd2657776f925c26b31e54e5d7db176883e Mon Sep 17 00:00:00 2001 From: "choi.jh" Date: Fri, 3 Oct 2025 17:21:19 +0900 Subject: [PATCH] dbmsv3 init...1 --- app/Services/Equipment/ServerService.php | 4 ++++ app/Services/Part/IPService.php | 15 +++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/Services/Equipment/ServerService.php b/app/Services/Equipment/ServerService.php index 03ef8f6..2972e59 100644 --- a/app/Services/Equipment/ServerService.php +++ b/app/Services/Equipment/ServerService.php @@ -211,6 +211,10 @@ class ServerService extends EquipmentService implements ServiceInterface { //수정전 정보 $oldEntity = clone $entity; //반드시 clone 할것 + //ip값이 없으면 null처리 + if (array_key_exists('ip', $formDatas) && !$formDatas['ip']) { + $formDatas['ip'] = null; + } //서버정보 수정 $entity = parent::modify($entity, $formDatas); //서비스가 연결되어 있고 대체서버가 아니면, 서비스정보수정(청구액수정) diff --git a/app/Services/Part/IPService.php b/app/Services/Part/IPService.php index e516ec1..ac8dcda 100644 --- a/app/Services/Part/IPService.php +++ b/app/Services/Part/IPService.php @@ -174,13 +174,16 @@ class IPService extends PartService implements ServerInterface if (!array_key_exists('status', $formDatas)) { throw new \Exception(__METHOD__ . ":{$action}에서 오류발생: IP상태가 설정되지 않았습니다."); } - //IP정보가져오기 - $entity = $this->getEntity($serverPartEntity->getPartUID()); - if (!$entity instanceof IPEntity) { - throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 IP정보를 찾을수없습니다."); + //공백 값이 아니면 + if (!$serverPartEntity->getPartUID()) { + //IP정보가져오기 + $entity = $this->getEntity($serverPartEntity->getPartUID()); + if (!$entity instanceof IPEntity) { + throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 IP정보를 찾을수없습니다."); + } + //IP정보 수정 + $entity = parent::modify($entity, $formDatas); } - //IP정보 수정 - $entity = parent::modify($entity, $formDatas); break; case 'delete': //반드시 serverPartEntity 사용해야함 $formDatas = [];