From e7d439b1cfc2d5a73cadda565377a32f2204325c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Wed, 4 Feb 2026 11:26:50 +0900 Subject: [PATCH] dbmsv4 init...5 --- app/Entities/Equipment/ServerEntity.php | 6 ++++-- app/Services/Equipment/ServerService.php | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Entities/Equipment/ServerEntity.php b/app/Entities/Equipment/ServerEntity.php index 03c0cf7..39095fd 100644 --- a/app/Entities/Equipment/ServerEntity.php +++ b/app/Entities/Equipment/ServerEntity.php @@ -81,7 +81,8 @@ class ServerEntity extends EquipmentEntity } public function getIP(): ?string { - return $this->ip ?? null; + $val = $this->ip ?? null; + return ($val === '' || $val === null) ? null : $val; } public function getViewer(): ?string @@ -103,6 +104,7 @@ class ServerEntity extends EquipmentEntity } public function getFormatAt(): ?string { - return $this->format_at ?? null; + $val = $this->format_at ?? null; + return ($val === '' || $val === null) ? null : $val; } } diff --git a/app/Services/Equipment/ServerService.php b/app/Services/Equipment/ServerService.php index 5a7e51e..98f4f33 100644 --- a/app/Services/Equipment/ServerService.php +++ b/app/Services/Equipment/ServerService.php @@ -167,7 +167,7 @@ class ServerService extends EquipmentService //기존 IP 제거 service('part_ipservice')->detachFromServer($oldEntity); //새로운 IP 추가 (IP가 정의 되어 있으면) - if ($entity->getIP()) { + if ($entity->getIP() !== null) { service('part_ipservice')->attachToServer($entity); } } @@ -175,7 +175,7 @@ class ServerService extends EquipmentService if ($oldEntity->getSwitchInfoUid() !== $entity->getSwitchInfoUid()) { service('part_switchservice')->detachFromServer($oldEntity); //새로운 Switch 추가 (Switch가 정의 되어 있으면) - if ($entity->getSwitchInfoUid()) { + if ($entity->getSwitchInfoUid() !== null) { service('part_switchservice')->attachToServer($entity); } } @@ -183,7 +183,7 @@ class ServerService extends EquipmentService if ($oldEntity->getChassisInfoUid() !== $entity->getChassisInfoUid()) { service('equipment_chassisservice')->detachFromServer($oldEntity); //새로운 Chassis 추가 (Chassis가 정의 되어 있으면) - if ($entity->getChassisInfoUid()) { + if ($entity->getChassisInfoUid() !== null) { service('equipment_chassisservice')->attachToServer($entity); } }