From 6b000d8cad4e47664699a9c0e67218484185263f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Thu, 18 Dec 2025 18:34:22 +0900 Subject: [PATCH] dbmsv4 init...3 --- app/Controllers/Admin/PaymentController.php | 10 +-- app/DTOs/BoardDTO.php | 8 +-- app/DTOs/CommonDTO.php | 66 +++++++----------- app/DTOs/Customer/ClientDTO.php | 69 ++++++++----------- app/DTOs/Customer/ServiceDTO.php | 26 +++---- app/DTOs/Customer/Wallet/AccountDTO.php | 18 ++--- app/DTOs/Customer/Wallet/CouponDTO.php | 13 +--- app/DTOs/Customer/Wallet/PointDTO.php | 13 +--- app/DTOs/Customer/Wallet/WalletDTO.php | 22 ++++++ app/DTOs/Equipment/CHASSISDTO.php | 10 +-- app/DTOs/Equipment/LineDTO.php | 12 ++-- app/DTOs/Equipment/ServerDTO.php | 18 ++--- app/DTOs/Equipment/ServerPartDTO.php | 15 ++-- app/DTOs/Part/CPUDTO.php | 13 +--- app/DTOs/Part/CSDTO.php | 16 ++--- app/DTOs/Part/DISKDTO.php | 13 ++-- app/DTOs/Part/IPDTO.php | 10 +-- app/DTOs/Part/PartDTO.php | 18 +++++ app/DTOs/Part/RAMDTO.php | 11 +-- app/DTOs/Part/SOFTWAREDTO.php | 13 +--- app/DTOs/Part/SWITCHDTO.php | 10 +-- app/DTOs/UserDTO.php | 47 +++++-------- app/Database/dbmsv4_init.sql | 6 +- app/Database/dbmsv4_test1.sql | 6 +- app/Entities/BoardEntity.php | 12 +++- app/Entities/CommonEntity.php | 2 +- app/Entities/Customer/ClientEntity.php | 25 +++++-- app/Entities/Customer/ServiceEntity.php | 66 +++++++++++------- .../Customer/Wallet/AccountEntity.php | 23 ++++--- app/Entities/Customer/Wallet/CouponEntity.php | 17 +---- app/Entities/Customer/Wallet/PointEntity.php | 17 +---- app/Entities/Customer/Wallet/WalletEntity.php | 25 +++++++ app/Entities/Equipment/CHASSISEntity.php | 17 ++++- app/Entities/Equipment/LineEntity.php | 28 +++++++- app/Entities/Equipment/ServerEntity.php | 51 ++++++++++---- app/Entities/Equipment/ServerPartEntity.php | 37 ++++++---- app/Entities/Part/CPUEntity.php | 10 ++- app/Entities/Part/CSEntity.php | 40 +++++++---- app/Entities/Part/DISKEntity.php | 13 +++- app/Entities/Part/IPEntity.php | 28 +++++--- app/Entities/Part/PartEntity.php | 21 ++---- app/Entities/Part/RAMEntity.php | 10 ++- app/Entities/Part/SOFTWAREEntity.php | 10 ++- app/Entities/Part/SWITCHEntity.php | 26 ++++--- app/Entities/PaymentEntity.php | 6 +- app/Forms/CommonForm.php | 17 +++-- app/Helpers/Customer/ServiceHelper.php | 2 +- app/Services/BoardService.php | 2 +- app/Services/CommonService.php | 5 +- app/Services/Customer/ServiceService.php | 8 +-- .../Customer/Wallet/WalletService.php | 6 +- app/Services/Equipment/CHASSISService.php | 8 +-- app/Services/Equipment/ServerPartService.php | 20 +++--- app/Services/Equipment/ServerService.php | 20 +++--- app/Services/Part/CPUService.php | 4 +- app/Services/Part/CSService.php | 4 +- app/Services/Part/DISKService.php | 4 +- app/Services/Part/IPService.php | 8 +-- app/Services/Part/PartType2Service.php | 6 +- app/Services/Part/PartType3Service.php | 4 +- app/Services/Part/RAMService.php | 4 +- app/Services/Part/SOFTWAREService.php | 4 +- app/Services/Part/SWITCHService.php | 8 +-- app/Services/PaymentService.php | 26 +++---- app/Views/admin/welcome/new_service.php | 6 +- app/Views/cells/payment/detail.php | 4 +- app/Views/cells/server/detail.php | 4 +- app/Views/cells/server/servicelist.php | 4 +- 68 files changed, 612 insertions(+), 513 deletions(-) create mode 100644 app/DTOs/Customer/Wallet/WalletDTO.php create mode 100644 app/DTOs/Part/PartDTO.php diff --git a/app/Controllers/Admin/PaymentController.php b/app/Controllers/Admin/PaymentController.php index 26a745d..1ec91a8 100644 --- a/app/Controllers/Admin/PaymentController.php +++ b/app/Controllers/Admin/PaymentController.php @@ -110,14 +110,14 @@ class PaymentController extends AdminController //지급기한일이 오늘보다 작거나 같고 미지급인경우 if ($entity->getBillingAt() <= date("Y-m-d") && $entity->getStatus() === STATUS['UNPAID']) { //고객 정보가져오기 - if (array_key_exists($entity->getClientInfoUID(), $clientEntities)) { - $clientEntity = $clientEntities[$entity->getClientInfoUID()]; + if (array_key_exists($entity->getClientInfoUid(), $clientEntities)) { + $clientEntity = $clientEntities[$entity->getClientInfoUid()]; } else { - $clientEntity = service('customer_clientservice')->getEntity($entity->getClientInfoUID()); + $clientEntity = service('customer_clientservice')->getEntity($entity->getClientInfoUid()); if (!$clientEntity instanceof ClientEntity) { - throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생:{$entity->getClientInfoUID()}에 대한 고객정보를 찾을수 없습니다."); + throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생:{$entity->getClientInfoUid()}에 대한 고객정보를 찾을수 없습니다."); } - $clientEntities[$entity->getClientInfoUID()] = $clientEntity; + $clientEntities[$entity->getClientInfoUid()] = $clientEntity; } //서비스 정보가져오기 if (array_key_exists($entity->getServiceInfoUid(), $serviceEntities)) { diff --git a/app/DTOs/BoardDTO.php b/app/DTOs/BoardDTO.php index 72710a1..520bb21 100644 --- a/app/DTOs/BoardDTO.php +++ b/app/DTOs/BoardDTO.php @@ -7,10 +7,10 @@ class BoardDTO extends CommonDTO public ?int $uid = null; public ?int $user_uid = null; public ?int $worker_uid = null; - public ?string $category = null; - public ?string $title = null; - public ?string $content = null; - public ?string $status = null; + public string $category = ''; + public string $title = ''; + public string $status = STATUS['AVAILABLE']; + public string $content = ''; public function __construct(array $datas = []) { diff --git a/app/DTOs/CommonDTO.php b/app/DTOs/CommonDTO.php index 8f25992..a1fcb57 100644 --- a/app/DTOs/CommonDTO.php +++ b/app/DTOs/CommonDTO.php @@ -9,71 +9,51 @@ abstract class CommonDTO { protected function __construct(array $datas = []) { - // 데이터가 없으면 바로 리턴 - if (empty($datas)) { - return; - } + if (empty($datas)) return; - // $this는 이 시점에 자식 클래스(AccountDTO)의 인스턴스입니다. $reflection = new ReflectionClass($this); foreach ($datas as $key => $value) { - // 1. 속성이 존재하는지 확인 - if (!$reflection->hasProperty($key)) { - continue; - } + if (!$reflection->hasProperty($key)) continue; $property = $reflection->getProperty($key); - - // public이 아닌 속성도 접근 가능하게 설정 (필요시) - // $property->setAccessible(true); - - // 2. 속성의 타입 정보를 가져옴 $type = $property->getType(); - - // 값을 할당하기 전 정제된 값을 담을 변수 $assignValue = $value; - // 3. 빈 문자열("") 처리 - // HTML 폼에서 온 빈 값은 null로 처리해야 ?int 등에 들어갈 수 있음 if ($value === '') { $assignValue = null; - } - // 4. 타입에 따른 강제 형변환 (Casting) - elseif ($type instanceof ReflectionNamedType) { + } elseif ($type instanceof ReflectionNamedType) { $typeName = $type->getName(); - // int 타입이고 값이 숫자형일 때 - if ($typeName === 'int' && is_numeric($value)) { + // [추가] 타입이 array인 경우 처리 + if ($typeName === 'array' && is_string($value)) { + $assignValue = explode(DEFAULTS["DELIMITER_ROLE"], $value); + } elseif ($typeName === 'int' && is_numeric($value)) { $assignValue = (int) $value; } - // float 타입이고 값이 숫자형일 때 - elseif ($typeName === 'float' && is_numeric($value)) { - $assignValue = (float) $value; - } - // 필요하다면 bool 처리 등 추가 가능 + // ... float 등 기존 로직 ... } - // 5. 값 할당 $this->{$key} = $assignValue; } } - public function __get(string $name): mixed + // [중요] final 해제 또는 로직 변경 + public function toArray(): array { - // 1. 속성이 클래스에 실제로 존재하는지 확인 - if (property_exists($this, $name)) { - // 2. 속성이 존재하면 값을 반환 (PHP 7.4 이상의 타입 속성 덕분에 null 병합 연산자 사용 불필요) - return $this->{$name}; + // get_object_vars는 protected를 가져오지 못하므로 + // Reflection을 사용하여 모든 프로퍼티를 가져오되, + // 값을 가져올 때는 $this->{$name}을 통해 Getter나 매직메서드가 작동하게 합니다. + $reflection = new ReflectionClass($this); + $properties = $reflection->getProperties(); + $result = []; + + foreach ($properties as $property) { + $name = $property->getName(); + // $this->$name 처리를 통해 자식의 __get()이 호출되도록 유도 + $result[$name] = $this->{$name}; } - // 3. 속성이 존재하지 않으면 오류 발생 (일반적인 Entity/DTO 접근 방식) - throw new \BadMethodCallException( - "Undefined property or method: " . static::class . "::{$name}" - ); - } - final public function toArray(): array - { - // $this가 가진 모든 public 프로퍼티와 그 값을 배열로 반환합니다. - return get_object_vars($this); + + return $result; } } diff --git a/app/DTOs/Customer/ClientDTO.php b/app/DTOs/Customer/ClientDTO.php index 22fd413..a1b85b9 100644 --- a/app/DTOs/Customer/ClientDTO.php +++ b/app/DTOs/Customer/ClientDTO.php @@ -8,55 +8,42 @@ class ClientDTO extends CommonDTO { public ?int $uid = null; public ?int $user_uid = null; - public ?string $site = null; - - // __get이 동작하려면 public이 아닌 protected여야 합니다. - // public으로 선언되어 있으면 $dto->role 접근 시 __get을 거치지 않고 직접 접근합니다. - protected ?string $role = null; - - public ?string $name = null; - public ?string $phone = null; - public ?string $email = null; - public ?string $history = null; - public ?int $account_balance = null; - public ?int $coupon_balance = null; - public ?int $point_balance = null; - public ?string $status = null; + public string $site = SITES['prime']; + public string $name = ''; + public string $phone = ''; + public string $email = 'test@example.com'; + public array $role = []; + public int $account_balance = 0; + public int $coupon_balance = 0; + public int $point_balance = 0; + public string $status = ''; + public string $history = ''; public function __construct(array $datas = []) { - // 1. [전처리] role이 배열로 들어왔다면 문자열로 변환하여 $datas 덮어쓰기 - if (isset($datas['role']) && is_array($datas['role'])) { - $datas['role'] = implode(DEFAULTS["DELIMITER_ROLE"], $datas['role']); + // 1. role 변환 로직 (기존 유지) + if (isset($datas['role']) && is_string($datas['role'])) { + $datas['role'] = explode(DEFAULTS["DELIMITER_ROLE"], $datas['role']); + } + + if (!isset($datas['role'])) { + $datas['role'] = []; + } + + // 2. [추가] 잔액 관련 데이터가 null이거나 비어있다면 0으로 보정 + // CommonDTO의 parent::__construct가 호출되기 전에 데이터를 정제합니다. + $balanceFields = ['account_balance', 'coupon_balance', 'point_balance']; + foreach ($balanceFields as $field) { + if (!isset($datas[$field]) || $datas[$field] === '' || $datas[$field] === null) { + $datas[$field] = 0; + } } - // 2. 변환된 $datas를 가지고 부모(CommonDTO) 생성자 호출 - // 이제 'role'은 문자열이므로 부모 클래스의 Reflection 로직이나 타입 검사를 통과합니다. parent::__construct($datas); } - /** - * role 속성을 읽을 때 자동으로 배열로 변환해서 반환 - */ - public function __get(string $name): mixed + public function getRoleToString(): string { - // role을 요청했고, 실제 데이터가 문자열로 존재한다면 배열로 변환 - switch ($name) { - case 'role': - $value = is_string($this->$name) ? explode(DEFAULTS["DELIMITER_ROLE"], $this->role) : []; - break; - default: - // 부모에게 위임 (혹시 CommonDTO에도 __get이 있다면) - $value = parent::__get($name); - break; - } - return $value; - } - - // role 값을 설정할 때도 배열을 받을 수 있게 하려면 __set도 필요할 수 있습니다. - // (선택 사항) - public function setRole(array $roles): void - { - $this->role = implode(DEFAULTS["DELIMITER_ROLE"], $roles); + return implode(DEFAULTS["DELIMITER_ROLE"], $this->role); } } diff --git a/app/DTOs/Customer/ServiceDTO.php b/app/DTOs/Customer/ServiceDTO.php index 463d9a3..a3b1488 100644 --- a/app/DTOs/Customer/ServiceDTO.php +++ b/app/DTOs/Customer/ServiceDTO.php @@ -10,19 +10,19 @@ class ServiceDTO extends CommonDTO public ?int $user_uid = null; public ?int $clientinfo_uid = null; public ?int $serverinfo_uid = null; - public ?string $code = null; - public ?string $title = null; - public ?string $site = null; - public ?string $location = null; - public ?int $rack = null; - public ?int $line = null; - public ?string $billing_at = null; - public ?int $sale = null; - public ?int $amount = null; - public ?string $start_at = null; - public ?string $end_at = null; - public ?string $history = null; - public ?string $status = null; + public string $code = ''; + public string $title = ''; + public string $site = ''; + public string $location = ''; + public int $rack = 0; + public int $line = 0; + public string $billing_at = ''; + public int $sale = 0; + public int $amount = 0; + public string $start_at = ''; + public string $end_at = ''; + public string $status = ''; + public string $history = ''; public function __construct(array $datas = []) { diff --git a/app/DTOs/Customer/Wallet/AccountDTO.php b/app/DTOs/Customer/Wallet/AccountDTO.php index 89facd3..d2558c7 100644 --- a/app/DTOs/Customer/Wallet/AccountDTO.php +++ b/app/DTOs/Customer/Wallet/AccountDTO.php @@ -2,21 +2,11 @@ namespace App\DTOs\Customer\Wallet; -use App\DTOs\CommonDTO; - -class AccountDTO extends CommonDTO +class AccountDTO extends WalletDTO { - public ?int $uid = null; - public ?int $user_uid = null; - public ?int $clientinfo_uid = null; - public ?string $bank = null; - public ?string $title = null; - public ?string $alias = null; - public ?string $issue_at = null; - public ?int $amount = null; - public ?int $balance = null; - public ?string $status = null; - public ?string $content = null; + public string $bank = ''; + public string $alias = ''; + public string $issue_at = ''; public function __construct(array $datas = []) { diff --git a/app/DTOs/Customer/Wallet/CouponDTO.php b/app/DTOs/Customer/Wallet/CouponDTO.php index 8228909..944f8e5 100644 --- a/app/DTOs/Customer/Wallet/CouponDTO.php +++ b/app/DTOs/Customer/Wallet/CouponDTO.php @@ -2,19 +2,8 @@ namespace App\DTOs\Customer\Wallet; -use App\DTOs\CommonDTO; - -class CouponDTO extends CommonDTO +class CouponDTO extends WalletDTO { - public ?int $uid = null; - public ?int $user_uid = null; - public ?int $clientinfo_uid = null; - public ?string $title = null; - public ?int $amount = null; - public ?int $balance = null; - public ?string $status = null; - public ?string $content = null; - public function __construct(array $datas = []) { parent::__construct($datas); diff --git a/app/DTOs/Customer/Wallet/PointDTO.php b/app/DTOs/Customer/Wallet/PointDTO.php index 0d16920..0e0fcc4 100644 --- a/app/DTOs/Customer/Wallet/PointDTO.php +++ b/app/DTOs/Customer/Wallet/PointDTO.php @@ -2,19 +2,8 @@ namespace App\DTOs\Customer\Wallet; -use App\DTOs\CommonDTO; - -class PointDTO extends CommonDTO +class PointDTO extends WalletDTO { - public ?int $uid = null; - public ?int $user_uid = null; - public ?int $clientinfo_uid = null; - public ?string $title = null; - public ?int $amount = null; - public ?int $balance = null; - public ?string $status = null; - public ?string $content = null; - public function __construct(array $datas = []) { parent::__construct($datas); diff --git a/app/DTOs/Customer/Wallet/WalletDTO.php b/app/DTOs/Customer/Wallet/WalletDTO.php new file mode 100644 index 0000000..35835bc --- /dev/null +++ b/app/DTOs/Customer/Wallet/WalletDTO.php @@ -0,0 +1,22 @@ +role 접근 시 __get을 거치지 않고 직접 접근합니다. - protected ?string $role = null; + + /** + * 검증(is_array) 통과를 위해 public array로 선언합니다. + * get_object_vars($this) 호출 시 배열 형태로 추출됩니다. + */ + public array $role = []; + public ?string $status = null; public function __construct(array $datas = []) { - // 1. [전처리] role이 배열로 들어왔다면 문자열로 변환하여 $datas 덮어쓰기 - if (isset($datas['role']) && is_array($datas['role'])) { - $datas['role'] = implode(DEFAULTS["DELIMITER_ROLE"], $datas['role']); + // 1. [전처리] 입력값이 문자열(CSV)로 들어왔다면 배열로 변환 + if (isset($datas['role']) && is_string($datas['role'])) { + $datas['role'] = explode(DEFAULTS["DELIMITER_ROLE"], $datas['role']); } - // 2. 변환된 $datas를 가지고 부모(CommonDTO) 생성자 호출 - // 이제 'role'은 문자열이므로 부모 클래스의 Reflection 로직이나 타입 검사를 통과합니다. + // 2. 만약 데이터가 없다면 빈 배열로 초기화 + if (!isset($datas['role'])) { + $datas['role'] = []; + } + + // 3. 부모 생성자 호출 parent::__construct($datas); } /** - * role 속성을 읽을 때 자동으로 배열로 변환해서 반환 + * DB 저장용(Entity 전달용) CSV 문자열이 필요할 때 사용합니다. */ - public function __get(string $name): mixed + public function getRoleToString(): string { - // role을 요청했고, 실제 데이터가 문자열로 존재한다면 배열로 변환 - switch ($name) { - case 'role': - $value = is_string($this->name) ? explode(DEFAULTS["DELIMITER_ROLE"], $this->role) : []; - break; - default: - // 부모에게 위임 (혹시 CommonDTO에도 __get이 있다면) - $value = parent::__get($name); - break; - } - return $value; - } - - // role 값을 설정할 때도 배열을 받을 수 있게 하려면 __set도 필요할 수 있습니다. - // (선택 사항) - public function setRole(array $roles): void - { - $this->role = implode(DEFAULTS["DELIMITER_ROLE"], $roles); + return implode(DEFAULTS["DELIMITER_ROLE"], $this->role); } } diff --git a/app/Database/dbmsv4_init.sql b/app/Database/dbmsv4_init.sql index af7114c..6c38e1b 100644 --- a/app/Database/dbmsv4_init.sql +++ b/app/Database/dbmsv4_init.sql @@ -139,7 +139,7 @@ CREATE TABLE `clientinfo` ( `account_balance` int(11) NOT NULL DEFAULT 0 COMMENT '예치금', `coupon_balance` int(11) NOT NULL DEFAULT 0 COMMENT '쿠폰수', `point_balance` int(11) NOT NULL DEFAULT 0 COMMENT '포인트', - `status` varchar(20) NOT NULL DEFAULT 'normal', + `status` varchar(20) NOT NULL DEFAULT 'available', `updated_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `deleted_at` timestamp NULL DEFAULT NULL, @@ -648,7 +648,7 @@ CREATE TABLE `serviceinfo` ( KEY `FK_serverinfo_TO_serviceinfo` (`serverinfo_uid`), CONSTRAINT `FK_clientinfo_TO_serviceinfo` FOREIGN KEY (`clientinfo_uid`) REFERENCES `clientinfo` (`uid`), CONSTRAINT `FK_serverinfo_TO_serviceinfo` FOREIGN KEY (`serverinfo_uid`) REFERENCES `serverinfo` (`uid`) -) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='서비스정보'; +) ENGINE=InnoDB AUTO_INCREMENT=112 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='서비스정보'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -776,4 +776,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2025-12-17 16:41:18 +-- Dump completed on 2025-12-18 16:54:25 diff --git a/app/Database/dbmsv4_test1.sql b/app/Database/dbmsv4_test1.sql index 5e3b8ff..bf679c8 100644 --- a/app/Database/dbmsv4_test1.sql +++ b/app/Database/dbmsv4_test1.sql @@ -139,7 +139,7 @@ CREATE TABLE `clientinfo` ( `account_balance` int(11) NOT NULL DEFAULT 0 COMMENT '예치금', `coupon_balance` int(11) NOT NULL DEFAULT 0 COMMENT '쿠폰수', `point_balance` int(11) NOT NULL DEFAULT 0 COMMENT '포인트', - `status` varchar(20) NOT NULL DEFAULT 'normal', + `status` varchar(20) NOT NULL DEFAULT 'available', `updated_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `deleted_at` timestamp NULL DEFAULT NULL, @@ -648,7 +648,7 @@ CREATE TABLE `serviceinfo` ( KEY `FK_serverinfo_TO_serviceinfo` (`serverinfo_uid`), CONSTRAINT `FK_clientinfo_TO_serviceinfo` FOREIGN KEY (`clientinfo_uid`) REFERENCES `clientinfo` (`uid`), CONSTRAINT `FK_serverinfo_TO_serviceinfo` FOREIGN KEY (`serverinfo_uid`) REFERENCES `serverinfo` (`uid`) -) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='서비스정보'; +) ENGINE=InnoDB AUTO_INCREMENT=112 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='서비스정보'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -776,4 +776,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2025-12-17 16:41:24 +-- Dump completed on 2025-12-18 16:54:11 diff --git a/app/Entities/BoardEntity.php b/app/Entities/BoardEntity.php index 59d1b72..530d771 100644 --- a/app/Entities/BoardEntity.php +++ b/app/Entities/BoardEntity.php @@ -9,7 +9,17 @@ class BoardEntity extends CommonEntity { const PK = Model::PK; const TITLE = Model::TITLE; - final public function getUserUID(): int|null + protected $attributes = [ + 'category' => '', + 'title' => '', + 'status' => STATUS['AVAILABLE'], + 'content' => '' + ]; + public function __construct(array|null $data = null) + { + parent::__construct($data); + } + final public function getUserUid(): int|null { return $this->attributes['user_uid'] ?? null; } diff --git a/app/Entities/CommonEntity.php b/app/Entities/CommonEntity.php index 8a77a95..2b0edff 100644 --- a/app/Entities/CommonEntity.php +++ b/app/Entities/CommonEntity.php @@ -28,7 +28,7 @@ abstract class CommonEntity extends Entity { return $this->getTitle(); } - public function getStatus(): string + final public function getStatus(): string { return $this->attributes['status'] ?? ""; } diff --git a/app/Entities/Customer/ClientEntity.php b/app/Entities/Customer/ClientEntity.php index 5c464ee..519d540 100644 --- a/app/Entities/Customer/ClientEntity.php +++ b/app/Entities/Customer/ClientEntity.php @@ -8,7 +8,24 @@ class ClientEntity extends CustomerEntity { const PK = ClientModel::PK; const TITLE = ClientModel::TITLE; - final public function getUserUID(): int|null + protected $attributes = [ + 'site' => SITES['prime'], + 'name' => '', + 'phone' => '', + 'email' => 'test@example.com', + 'role' => [], + 'account_balance' => 0, + 'coupon_balance' => 0, + 'point_balance' => 0, + 'status' => STATUS['AVAILABLE'], + 'history' => '' + ]; + public function __construct(array|null $data = null) + { + parent::__construct($data); + } + + final public function getUserUid(): int|null { return $this->attributes['user_uid'] ?? null; } @@ -27,15 +44,15 @@ class ClientEntity extends CustomerEntity } public function getAccountBalance(): int { - return $this->attributes['account_balance']; + return $this->attributes['account_balance'] ?? 0; } public function getCouponBalance(): int { - return $this->attributes['coupon_balance']; + return $this->attributes['coupon_balance'] ?? 0; } public function getPointBalance(): int { - return $this->attributes['point_balance']; + return $this->attributes['point_balance'] ?? 0; } public function getHistory(): string|null { diff --git a/app/Entities/Customer/ServiceEntity.php b/app/Entities/Customer/ServiceEntity.php index 447ef05..8db8de2 100644 --- a/app/Entities/Customer/ServiceEntity.php +++ b/app/Entities/Customer/ServiceEntity.php @@ -8,64 +8,80 @@ class ServiceEntity extends CustomerEntity { const PK = ServiceModel::PK; const TITLE = ServiceModel::TITLE; - final public function getUserUID(): int|null + protected $attributes = [ + 'code' => '', + 'title' => '', + 'site' => '', + 'location' => '', + 'rack' => 0, + 'coupon_balance' => 0, + 'line' => 0, + 'billing_at' => '', + 'sale' => 0, + 'amount' => 0, + 'start_at' => '', + 'end_at' => '', + 'status' => STATUS['AVAILABLE'], + 'history' => '' + ]; + public function __construct(array|null $data = null) + { + parent::__construct($data); + } + final public function getUserUid(): int|null { return $this->attributes['user_uid'] ?? null; } - final public function getClientInfoUID(): int|null + final public function getClientInfoUid(): int|null { return $this->attributes['clientinfo_uid'] ?? null; } - final public function getServerInfoUID(): int|null + final public function getServerInfoUid(): int|null { return $this->attributes['serverinfo_uid'] ?? null; } //기본기능용 - public function getCustomTitle(mixed $title = null): string - { - return $this->getTitle(); - } final public function getCode(): string { - return $this->attributes['code']; + return $this->attributes['code'] ?? ''; } final public function getSite(): string { - return $this->attributes['site']; + return $this->attributes['site'] ?? ''; } final public function getLocation(): string { - return $this->attributes['location']; + return $this->attributes['location'] ?? ''; } final public function getBillingAt(): string { - return $this->attributes['billing_at']; + return $this->attributes['billing_at'] ?? ''; } //청구금액->기본:상면비+회선비+서버금액(price)+서버파트연결(월비용)-할인액 + //상면비 + final public function getRack(): int + { + return $this->attributes['rack'] ?? 0; + } + //회선비 + final public function getLine(): int + { + return $this->attributes['line'] ?? 0; + } final public function getSale(): int { return $this->attributes['sale'] ?? 0; } final public function getAmount(): int { - return $this->attributes['amount']; - } - //상면비 - final public function getRack(): int - { - return $this->attributes['rack']; - } - //회선비 - final public function getLine(): int - { - return $this->attributes['line']; + return $this->attributes['amount'] ?? 0; } final public function getStartAt(): string { - return $this->attributes['start_at']; + return $this->attributes['start_at'] ?? ''; } - public function getHistory(): string|null + public function getHistory(): string { - return $this->attributes['history'] ?? null; + return $this->attributes['history'] ?? ''; } } diff --git a/app/Entities/Customer/Wallet/AccountEntity.php b/app/Entities/Customer/Wallet/AccountEntity.php index 6e270d7..e275859 100644 --- a/app/Entities/Customer/Wallet/AccountEntity.php +++ b/app/Entities/Customer/Wallet/AccountEntity.php @@ -8,21 +8,24 @@ class AccountEntity extends WalletEntity { const PK = AccountModel::PK; const TITLE = AccountModel::TITLE; - final public function getUserUID(): int|null + public function __construct(array|null $data = null) { - return $this->attributes['user_uid'] ?? null; - } - final public function getClientInfoUID(): int|null - { - return $this->attributes['clientinfo_uid'] ?? null; + parent::__construct($data); + $this->attributes['bank'] = ''; + $this->attributes['alias'] = ''; + $this->attributes['issue_at'] = ''; } //기본기능 - public function getContent(): string|null + public function getBank(): string { - return $this->attributes['content'] ?? null; + return $this->attributes['bank'] ?? ''; } - public function getAmount(): int + public function getAlias(): string { - return $this->attributes['amount'] ?? 0; + return $this->attributes['alias'] ?? ''; + } + public function getIssueAt(): string + { + return $this->attributes['issue_at'] ?? ''; } } diff --git a/app/Entities/Customer/Wallet/CouponEntity.php b/app/Entities/Customer/Wallet/CouponEntity.php index fc72674..df3b70a 100644 --- a/app/Entities/Customer/Wallet/CouponEntity.php +++ b/app/Entities/Customer/Wallet/CouponEntity.php @@ -8,21 +8,8 @@ class CouponEntity extends WalletEntity { const PK = CouponModel::PK; const TITLE = CouponModel::TITLE; - final public function getUserUID(): int|null + public function __construct(array|null $data = null) { - return $this->attributes['user_uid'] ?? null; - } - final public function getClientInfoUID(): int|null - { - return $this->attributes['clientinfo_uid'] ?? null; - } - //기본기능 - public function getContent(): string|null - { - return $this->attributes['content'] ?? null; - } - public function getAmount(): int - { - return $this->attributes['amount'] ?? 0; + parent::__construct($data); } } diff --git a/app/Entities/Customer/Wallet/PointEntity.php b/app/Entities/Customer/Wallet/PointEntity.php index 6d296ec..996d9ed 100644 --- a/app/Entities/Customer/Wallet/PointEntity.php +++ b/app/Entities/Customer/Wallet/PointEntity.php @@ -8,21 +8,8 @@ class PointEntity extends WalletEntity { const PK = PointModel::PK; const TITLE = PointModel::TITLE; - final public function getUserUID(): int|null + public function __construct(array|null $data = null) { - return $this->attributes['user_uid']; - } - final public function getClientInfoUID(): int|null - { - return $this->attributes['clientinfo_uid'] ?? null; - } - //기본기능 - public function getContent(): string|null - { - return $this->attributes['content'] ?? null; - } - public function getAmount(): int - { - return $this->attributes['amount'] ?? 0; + parent::__construct($data); } } diff --git a/app/Entities/Customer/Wallet/WalletEntity.php b/app/Entities/Customer/Wallet/WalletEntity.php index 800dc97..7bef4f4 100644 --- a/app/Entities/Customer/Wallet/WalletEntity.php +++ b/app/Entities/Customer/Wallet/WalletEntity.php @@ -7,12 +7,37 @@ use App\Entities\Customer\CustomerEntity; abstract class WalletEntity extends CustomerEntity { + protected $attributes = [ + 'title' => '', + 'amount' => 0, + 'balance' => 0, + 'status' => STATUS['DEPOSIT'], // 기본 상태 + 'content' => '' + ]; + public function __construct(array|null $data = null) { parent::__construct($data); } + final public function getUserUid(): int|null + { + return $this->attributes['user_uid'] ?? null; + } + final public function getClientInfoUid(): int|null + { + return $this->attributes['clientinfo_uid'] ?? null; + } + //기본기능 + final public function getAmount(): int + { + return $this->attributes['amount'] ?? 0; + } final public function getBalance(): int { return $this->attributes['balance'] ?? 0; } + final public function getContent(): string + { + return $this->attributes['content'] ?? ''; + } } diff --git a/app/Entities/Equipment/CHASSISEntity.php b/app/Entities/Equipment/CHASSISEntity.php index 2663d7a..c126ccb 100644 --- a/app/Entities/Equipment/CHASSISEntity.php +++ b/app/Entities/Equipment/CHASSISEntity.php @@ -8,18 +8,29 @@ class CHASSISEntity extends EquipmentEntity { const PK = CHASSISModel::PK; const TITLE = CHASSISModel::TITLE; + protected $attributes = [ + 'title' => '', + 'price' => 0, + 'used' => 0, + 'stock' => 0, + 'status' => STATUS['AVAILABLE'], + ]; + public function __construct(array|null $data = null) + { + parent::__construct($data); + } //기본기능 public function getPrice(): int { - return $this->attributes['price']; + return $this->attributes['price'] ?? 0; } public function getStock(): int { - return $this->attributes['stock']; + return $this->attributes['stock'] ?? 0; } public function getUsed(): int { - return $this->attributes['used']; + return $this->attributes['used'] ?? 0; } public function getAvailable(): int { diff --git a/app/Entities/Equipment/LineEntity.php b/app/Entities/Equipment/LineEntity.php index 3f3be70..400eede 100644 --- a/app/Entities/Equipment/LineEntity.php +++ b/app/Entities/Equipment/LineEntity.php @@ -7,9 +7,35 @@ use App\Models\Equipment\LineModel; class LineEntity extends EquipmentEntity { const PK = LineModel::PK; + protected $attributes = [ + 'title' => '', + 'bandwith' => '', + 'start_at' => 0, + 'end_at' => 0, + 'status' => STATUS['AVAILABLE'], + 'content' => '', + ]; + public function __construct(array|null $data = null) + { + parent::__construct($data); + } const TITLE = LineModel::TITLE; + public function getBandwith(): string { - return $this->attributes['bandwith']; + return $this->attributes['bandwith'] ?? ''; + } + public function getStartAt(): string + { + return $this->attributes['start_at'] ?? ''; + } + + public function getEndAt(): string + { + return $this->attributes['end_at'] ?? ''; + } + public function getContent(): string + { + return $this->attributes['content'] ?? ''; } } diff --git a/app/Entities/Equipment/ServerEntity.php b/app/Entities/Equipment/ServerEntity.php index 0056f43..a7d7d5d 100644 --- a/app/Entities/Equipment/ServerEntity.php +++ b/app/Entities/Equipment/ServerEntity.php @@ -8,19 +8,34 @@ class ServerEntity extends EquipmentEntity { const PK = ServerModel::PK; const TITLE = ServerModel::TITLE; - final public function getClientInfoUID(): int|null + protected $attributes = [ + 'code' => '', + 'title' => '', + 'type' => '', + 'ip' => '', + 'os' => '', + 'price' => 0, + 'manufactur_at' => '', + 'format_at' => '', + 'status' => STATUS['AVAILABLE'], + ]; + public function __construct(array|null $data = null) + { + parent::__construct($data); + } + final public function getClientInfoUid(): int|null { return $this->attributes['clientinfo_uid'] ?? null; } - final public function getServiceInfoUID(): int|null + final public function getServiceInfoUid(): int|null { return $this->attributes['serviceinfo_uid'] ?? null; } - final public function getChassisInfoUID(): int|null + final public function getChassisInfoUid(): int|null { return $this->attributes['chassisinfo_uid'] ?? null; } - final public function getSwitchInfoUID(): int|null + final public function getSwitchInfoUid(): int|null { return $this->attributes['switchinfo_uid'] ?? null; } @@ -31,22 +46,30 @@ class ServerEntity extends EquipmentEntity } final public function getCode(): string { - return $this->attributes['code']; - } - public function getPrice(): int - { - return $this->attributes['price']; + return $this->attributes['code'] ?? ''; } public function getType(): string { - return $this->attributes['type']; + return $this->attributes['type'] ?? ''; } - public function getIP(): string|null + public function getIP(): string { - return $this->attributes['ip'] ?? null; + return $this->attributes['ip'] ?? ''; } - public function getOS(): string|null + public function getOS(): string { - return $this->attributes['os'] ?? null; + return $this->attributes['os'] ?? ''; + } + public function getPrice(): int + { + return $this->attributes['price'] ?? 0; + } + public function getManufacturAt(): string + { + return $this->attributes['manufactur_at'] ?? ''; + } + public function getFormatAt(): string + { + return $this->attributes['format_at'] ?? ''; } } diff --git a/app/Entities/Equipment/ServerPartEntity.php b/app/Entities/Equipment/ServerPartEntity.php index 46c25f8..847f759 100644 --- a/app/Entities/Equipment/ServerPartEntity.php +++ b/app/Entities/Equipment/ServerPartEntity.php @@ -8,22 +8,35 @@ class ServerPartEntity extends EquipmentEntity { const PK = ServerPartModel::PK; const TITLE = ServerPartModel::TITLE; - final public function getServerInfoUID(): int|null + protected $attributes = [ + 'title' => '', + 'type' => '', + 'billing' => '', + 'billing_at' => '', + 'cnt' => 0, + 'amount' => 0, + 'extra' => '', + ]; + public function __construct(array|null $data = null) { - return $this->attributes['serverinfo_uid'] ?? null; + parent::__construct($data); } - public function getPartUID(): int|null - { - return $this->attributes['part_uid'] ?? null; - } - final public function getClientInfoUID(): int|null + final public function getClientInfoUid(): int|null { return $this->attributes['clientinfo_uid'] ?? null; } - final public function getServiceInfoUID(): int|null + final public function getServiceInfoUid(): int|null { return $this->attributes['serviceinfo_uid'] ?? null; } + final public function getServerInfoUid(): int|null + { + return $this->attributes['serverinfo_uid'] ?? null; + } + public function getPartUid(): int|null + { + return $this->attributes['part_uid'] ?? null; + } //기본기능용 public function getCustomTitle(): string { @@ -45,14 +58,14 @@ class ServerPartEntity extends EquipmentEntity { return $this->attributes['billing_at']; } - public function getAmount(): int - { - return $this->attributes['amount']; - } public function getCnt(): int { return $this->attributes['cnt']; } + public function getAmount(): int + { + return $this->attributes['amount']; + } public function getExtra(): string|null { return $this->attributes['extra']; diff --git a/app/Entities/Part/CPUEntity.php b/app/Entities/Part/CPUEntity.php index f06a181..0a2ca31 100644 --- a/app/Entities/Part/CPUEntity.php +++ b/app/Entities/Part/CPUEntity.php @@ -8,14 +8,20 @@ class CPUEntity extends PartEntity { const PK = CPUModel::PK; const TITLE = CPUModel::TITLE; + public function __construct(array|null $data = null) + { + $this->attributes['used'] = 0; + $this->attributes['stock'] = 0; + parent::__construct($data); + } //기본기능 public function getStock(): int { - return $this->attributes['stock']; + return $this->attributes['stock'] ?? 0; } public function getUsed(): int { - return $this->attributes['used']; + return $this->attributes['used'] ?? 0; } public function getAvailable(): int { diff --git a/app/Entities/Part/CSEntity.php b/app/Entities/Part/CSEntity.php index bee94fb..2bb8b16 100644 --- a/app/Entities/Part/CSEntity.php +++ b/app/Entities/Part/CSEntity.php @@ -8,27 +8,39 @@ class CSEntity extends PartEntity { const PK = CSModel::PK; const TITLE = CSModel::TITLE; - //기본기능 + public function __construct(array|null $data = null) + { + $this->attributes['type'] = ''; + $this->attributes['ip'] = ''; + $this->attributes['accountid'] = ''; + $this->attributes['domain'] = ''; + parent::__construct($data); + } + //기본기능 + final public function getClientInfoUid(): int|null + { + return $this->attributes['clientinfo_uid']; + } + final public function getServiceInfoUid(): int|null + { + return $this->attributes['serviceinfo_uid']; + } + final public function getServerInfoUid(): int|null + { + return $this->attributes['serverinfo_uid']; + } public function getIP(): string { - return $this->attributes['ip']; + return $this->attributes['ip'] ?? ''; } //기본기능 - public function getAccountID(): string|null + public function getAccountID(): string { - return $this->attributes['accountid'] ?? null; + return $this->attributes['accountid'] ?? ""; } - public function getDomain(): string|null + public function getDomain(): string { - return $this->attributes['domain'] ?? null; + return $this->attributes['domain'] ?? ""; } //abstract 선언처리용 - public function getUsed(): int - { - return 0; - } - public function getAvailable(): int - { - return 0; - } } diff --git a/app/Entities/Part/DISKEntity.php b/app/Entities/Part/DISKEntity.php index 32e63c4..23ddaa4 100644 --- a/app/Entities/Part/DISKEntity.php +++ b/app/Entities/Part/DISKEntity.php @@ -8,18 +8,25 @@ class DISKEntity extends PartEntity { const PK = DISKModel::PK; const TITLE = DISKModel::TITLE; + public function __construct(array|null $data = null) + { + $this->attributes['used'] = 0; + $this->attributes['stock'] = 0; + $this->attributes['format'] = ''; + parent::__construct($data); + } //기본기능 public function getStock(): int { - return $this->attributes['stock']; + return $this->attributes['stock'] ?? 0; } public function getFormat(): int { - return intval($this->attributes['format'] ?? 0); + return $this->attributes['format'] ?? 0; } public function getUsed(): int { - return $this->attributes['used']; + return $this->attributes['used'] ?? 0; } public function getAvailable(): int { diff --git a/app/Entities/Part/IPEntity.php b/app/Entities/Part/IPEntity.php index 9f342fd..71122b8 100644 --- a/app/Entities/Part/IPEntity.php +++ b/app/Entities/Part/IPEntity.php @@ -8,6 +8,11 @@ class IPEntity extends PartEntity { const PK = IPModel::PK; const TITLE = IPModel::TITLE; + public function __construct(array|null $data = null) + { + $this->attributes['ip'] = ''; + parent::__construct($data); + } public function getLineInfoUID(): int|null { return $this->attributes['lineinfo_uid'] ?? null; @@ -16,18 +21,21 @@ class IPEntity extends PartEntity { return $this->attributes['old_clientinfo_uid'] ?? null; } + final public function getClientInfoUid(): int|null + { + return $this->attributes['clientinfo_uid']; + } + final public function getServiceInfoUid(): int|null + { + return $this->attributes['serviceinfo_uid']; + } + final public function getServerInfoUid(): int|null + { + return $this->attributes['serverinfo_uid']; + } //기본기능 public function getIP(): string { - return $this->attributes['ip']; - } - //abstract 선언처리용 - public function getUsed(): int - { - return 0; - } - public function getAvailable(): int - { - return 0; + return $this->attributes['ip'] ?? ""; } } diff --git a/app/Entities/Part/PartEntity.php b/app/Entities/Part/PartEntity.php index e242a2b..fa0f92d 100644 --- a/app/Entities/Part/PartEntity.php +++ b/app/Entities/Part/PartEntity.php @@ -6,24 +6,15 @@ use App\Entities\CommonEntity; abstract class PartEntity extends CommonEntity { + protected $attributes = [ + 'title' => '', + 'price' => 0, + 'status' => STATUS['AVAILABLE'], + ]; public function __construct(array|null $data = null) { parent::__construct($data); } - abstract public function getAvailable(): int; - abstract public function getUsed(): int; - final public function getClientInfoUID(): int|null - { - return $this->attributes['clientinfo_uid']; - } - final public function getServiceInfoUID(): int|null - { - return $this->attributes['serviceinfo_uid']; - } - final public function getServerInfoUID(): int|null - { - return $this->attributes['serverinfo_uid']; - } //기본기능용 public function getCustomTitle(mixed $title = null): string { @@ -31,6 +22,6 @@ abstract class PartEntity extends CommonEntity } final public function getPrice(): int { - return $this->attributes['price']; + return $this->attributes['price'] ?? 0; } } diff --git a/app/Entities/Part/RAMEntity.php b/app/Entities/Part/RAMEntity.php index 70a1316..df484c5 100644 --- a/app/Entities/Part/RAMEntity.php +++ b/app/Entities/Part/RAMEntity.php @@ -8,14 +8,20 @@ class RAMEntity extends PartEntity { const PK = RAMModel::PK; const TITLE = RAMModel::TITLE; + public function __construct(array|null $data = null) + { + $this->attributes['used'] = 0; + $this->attributes['stock'] = 0; + parent::__construct($data); + } //기본기능 public function getStock(): int { - return $this->attributes['stock']; + return $this->attributes['stock'] ?? 0; } public function getUsed(): int { - return $this->attributes['used']; + return $this->attributes['used'] ?? 0; } public function getAvailable(): int { diff --git a/app/Entities/Part/SOFTWAREEntity.php b/app/Entities/Part/SOFTWAREEntity.php index 5d66d14..51b693c 100644 --- a/app/Entities/Part/SOFTWAREEntity.php +++ b/app/Entities/Part/SOFTWAREEntity.php @@ -8,14 +8,20 @@ class SOFTWAREEntity extends PartEntity { const PK = SOFTWAREModel::PK; const TITLE = SOFTWAREModel::TITLE; + public function __construct(array|null $data = null) + { + $this->attributes['used'] = 0; + $this->attributes['stock'] = 0; + parent::__construct($data); + } //기본기능 public function getStock(): int { - return $this->attributes['stock']; + return $this->attributes['stock'] ?? 0; } public function getUsed(): int { - return $this->attributes['used']; + return $this->attributes['used'] ?? 0; } public function getAvailable(): int { diff --git a/app/Entities/Part/SWITCHEntity.php b/app/Entities/Part/SWITCHEntity.php index cd2d263..0a43fbe 100644 --- a/app/Entities/Part/SWITCHEntity.php +++ b/app/Entities/Part/SWITCHEntity.php @@ -8,17 +8,25 @@ class SWITCHEntity extends PartEntity { const PK = SWITCHModel::PK; const TITLE = SWITCHModel::TITLE; + public function __construct(array|null $data = null) + { + $this->attributes['code'] = ''; + parent::__construct($data); + } + final public function getClientInfoUid(): int|null + { + return $this->attributes['clientinfo_uid']; + } + final public function getServiceInfoUid(): int|null + { + return $this->attributes['serviceinfo_uid']; + } + final public function getServerInfoUid(): int|null + { + return $this->attributes['serverinfo_uid']; + } public function getCode(): string { return $this->attributes['code'] ?? ""; } - //abstract 선언처리용 - public function getUsed(): int - { - return 0; - } - public function getAvailable(): int - { - return 0; - } } diff --git a/app/Entities/PaymentEntity.php b/app/Entities/PaymentEntity.php index 9f3ce21..6211d10 100644 --- a/app/Entities/PaymentEntity.php +++ b/app/Entities/PaymentEntity.php @@ -9,15 +9,15 @@ class PaymentEntity extends CommonEntity { const PK = PaymentModel::PK; const TITLE = PaymentModel::TITLE; - final public function getUserUID(): int|null + final public function getUserUid(): int|null { return $this->attributes['user_uid'] ?? null; } - final public function getClientInfoUID(): int|null + final public function getClientInfoUid(): int|null { return $this->attributes['clientinfo_uid'] ?? null; } - final public function getServiceInfoUID(): int|null + final public function getServiceInfoUid(): int|null { return $this->attributes['serviceinfo_uid'] ?? null; } diff --git a/app/Forms/CommonForm.php b/app/Forms/CommonForm.php index 7b5678a..3d9c789 100644 --- a/app/Forms/CommonForm.php +++ b/app/Forms/CommonForm.php @@ -117,7 +117,7 @@ abstract class CommonForm return $this->_batchjobButtons; } //Validation용 - public function validate(array $formDatas): void + final public function validate(array $formDatas): void { if ($this->_validation === null) { throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: Validation 서비스가 초기화되지 않았습니다."); @@ -128,7 +128,18 @@ abstract class CommonForm foreach ($this->getFormRules() as $field => $rule) { list($field, $rule) = $this->getValidationRule($field, $rule); $dynamicRules[$field] = $rule; // 규칙만 저장 - $dynamicLabels[$field] = $this->getFormFields()[$field]; + + // role.* 키가 getFormFields()에 없을 확률이 99%이므로 isset 체크를 합니다. + $formFields = $this->getFormFields(); + if (isset($formFields[$field])) { + $dynamicLabels[$field] = $formFields[$field]; + } elseif (str_contains($field, '.*')) { + // role.* 형태라면 부모인 'role'의 레이블을 가져오거나 직접 명시 + $parentField = str_replace('.*', '', $field); + $dynamicLabels[$field] = ($formFields[$parentField] ?? $field) . " 항목"; + } else { + $dynamicLabels[$field] = $field; // 기본값 + } } if (!count($dynamicRules)) { throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: 지정된 Form RULE이 없습니다."); @@ -229,14 +240,12 @@ abstract class CommonForm case 'user_uid': foreach ($this->getFormOption_process(service('userservice'), $action, $field, $formDatas) as $entity) { $tempOptions[$entity->getPK()] = $entity->getTitle(); - // $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())]; } $options['options'] = $tempOptions; break; case 'clientinfo_uid': foreach ($this->getFormOption_process(service('customer_clientservice'), $action, $field, $formDatas) as $entity) { $tempOptions[$entity->getPK()] = $entity->getTitle(); - // $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())]; } $options['options'] = $tempOptions; break; diff --git a/app/Helpers/Customer/ServiceHelper.php b/app/Helpers/Customer/ServiceHelper.php index 3ecad6e..ae30b49 100644 --- a/app/Helpers/Customer/ServiceHelper.php +++ b/app/Helpers/Customer/ServiceHelper.php @@ -85,7 +85,7 @@ class ServiceHelper extends CustomerHelper $label, 'modify_service', [ - "data-src" => "/admin/customer/service/modify/{$viewDatas['entity']->getPK()}?clientinfo_uid={$viewDatas['entity']->getClientInfoUID()}", + "data-src" => "/admin/customer/service/modify/{$viewDatas['entity']->getPK()}?clientinfo_uid={$viewDatas['entity']->getClientInfoUid()}", "data-bs-toggle" => "modal", "data-bs-target" => "#modal_action_form", "class" => "text-primary form-label-sm", diff --git a/app/Services/BoardService.php b/app/Services/BoardService.php index da973ce..15dc20c 100644 --- a/app/Services/BoardService.php +++ b/app/Services/BoardService.php @@ -85,7 +85,7 @@ class BoardService extends CommonService $datas[] = [ 'title' => "", 'created_at' => date('Y-m-d H:m', strtotime($entity->getCreatedAT())), - 'user' => $userEntities[$entity->getUserUID()]->getTitle(), + 'user' => $userEntities[$entity->getUserUid()]->getTitle(), ]; } return $datas; diff --git a/app/Services/CommonService.php b/app/Services/CommonService.php index dab96bf..caaa4a8 100644 --- a/app/Services/CommonService.php +++ b/app/Services/CommonService.php @@ -182,13 +182,14 @@ abstract class CommonService $this->getFormService()->validate($formDatas); // 💡 동적으로 가져온 Entity 클래스 이름으로 instanceof 검사 $entityClass = $this->getEntityClass(); - $entity = new $entityClass($formDatas); + dd($formDatas); + $entity = new $entityClass($formDatas); if (!$entity instanceof $entityClass) { throw new RuntimeException("Return Type은 {$entityClass}만 가능"); } return $this->save_process($entity); } catch (\Throwable $e) { - throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생:" . $e->getMessage() . var_export($entity)); + throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생:" . $e->getMessage()); } } final public function create(array $formDatas): CommonEntity diff --git a/app/Services/Customer/ServiceService.php b/app/Services/Customer/ServiceService.php index 42c839d..1ac08a2 100644 --- a/app/Services/Customer/ServiceService.php +++ b/app/Services/Customer/ServiceService.php @@ -118,7 +118,7 @@ class ServiceService extends CustomerService $entity->getRack(), $entity->getLine(), $entity->getSale(), - $entity->getServerInfoUID() + $entity->getServerInfoUid() ); //총 서비스금액 설정 및 저장 if (!$this->model->save($entity)) { @@ -160,7 +160,7 @@ class ServiceService extends CustomerService throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생:Return Type은 ServiceEntity만 가능"); } //서버정보 연결 - service('equipment_serverservice')->attatchToService($entity, $entity->getServerInfoUID()); + service('equipment_serverservice')->attatchToService($entity, $entity->getServerInfoUid()); //서비스비용 설정 $entity = $this->updateAmount($entity); //결제정보 생성 @@ -185,8 +185,8 @@ class ServiceService extends CustomerService //기존 서비스용 결제비용 과 신규 서버스용으로 결제비용이 다르면 수정 service('paymentservice')->modifyByService($oldEntity, $entity); //서버정보 연결 신규서버로 변경 - if ($oldEntity->getServerInfoUID() !== $entity->getServerInfoUID()) { - // throw new RuntimeException("{$oldEntity->getServerInfoUID()} !== {$entity->getServerInfoUID()}"); + if ($oldEntity->getServerInfoUid() !== $entity->getServerInfoUid()) { + // throw new RuntimeException("{$oldEntity->getServerInfoUid()} !== {$entity->getServerInfoUid()}"); service('equipment_serverservice')->modifyByService($oldEntity, $entity); } return $entity; diff --git a/app/Services/Customer/Wallet/WalletService.php b/app/Services/Customer/Wallet/WalletService.php index f4f8432..b7f5f84 100644 --- a/app/Services/Customer/Wallet/WalletService.php +++ b/app/Services/Customer/Wallet/WalletService.php @@ -63,12 +63,12 @@ abstract class WalletService extends CustomerService final public function withdrawalByPayment(PaymentEntity $paymentEntity): void { //고객 정보 - $clientEntity = service('customer_clientservice')->getEntity($paymentEntity->getClientInfoUID()); + $clientEntity = service('customer_clientservice')->getEntity($paymentEntity->getClientInfoUid()); if (!$clientEntity instanceof ClientEntity) { - throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: {$paymentEntity->getClientInfoUID()}에 해당하는 고객정보를 찾을수 없습니다."); + throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: {$paymentEntity->getClientInfoUid()}에 해당하는 고객정보를 찾을수 없습니다."); } $formDatas = [ - 'clientinfo_uid' => $paymentEntity->getClientInfoUID(), + 'clientinfo_uid' => $paymentEntity->getClientInfoUid(), 'title' => $paymentEntity->getTitle(), 'amount' => $paymentEntity->getAmount(), 'status' => STATUS['WITHDRAWAL'], diff --git a/app/Services/Equipment/CHASSISService.php b/app/Services/Equipment/CHASSISService.php index 919d0ff..0ad2aee 100644 --- a/app/Services/Equipment/CHASSISService.php +++ b/app/Services/Equipment/CHASSISService.php @@ -79,9 +79,9 @@ class CHASSISService extends EquipmentService public function getPartEntityByServer(ServerEntity $serverEntity): CHASSISEntity { //IP정보에서 해당하는 IP가 있으면 가져와서 사용중인지 체크 후 수정 - $entity = $this->getEntity($serverEntity->getChassisInfoUID()); + $entity = $this->getEntity($serverEntity->getChassisInfoUid()); if (!$entity instanceof CHASSISEntity) { - throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 {$serverEntity->getChassisInfoUID()}에 해당하는 샷시정보를 찾을수없습니다."); + throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 {$serverEntity->getChassisInfoUid()}에 해당하는 샷시정보를 찾을수없습니다."); } return $entity; } @@ -89,7 +89,7 @@ class CHASSISService extends EquipmentService { //부품정보가져오기 /** @var CHASSISEntity $entity IDE에 entity type알려주기*/ - $entity = $this->getEntity($serverEntity->getChassisInfoUID()); + $entity = $this->getEntity($serverEntity->getChassisInfoUid()); //파트정보의 사용가능한 갯수 , 사용갯수 비교 if ($entity->getAvailable() < 1) { throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 현재 사용가능한 {$serverEntity->getTitle()} 샷시가 없습니다."); @@ -102,7 +102,7 @@ class CHASSISService extends EquipmentService { //부품정보가져오기 /** @var CHASSISEntity $entity IDE에 entity type알려주기*/ - $entity = $this->getEntity($serverEntity->getChassisInfoUID()); + $entity = $this->getEntity($serverEntity->getChassisInfoUid()); //파트정보의 사용된 갯수 , 회수용 갯수 비교 if ($entity->getUsed() < 1) { throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 현재 사용한 {$serverEntity->getTitle()} 샷시가 없습니다."); diff --git a/app/Services/Equipment/ServerPartService.php b/app/Services/Equipment/ServerPartService.php index adbec35..60ddf0c 100644 --- a/app/Services/Equipment/ServerPartService.php +++ b/app/Services/Equipment/ServerPartService.php @@ -91,16 +91,16 @@ class ServerPartService extends EquipmentService } //서비스정보 가져오기 $serviceEntity = null; - if ($serverEntity->getServiceInfoUID()) { - $serviceEntity = service('customer_serviceservice')->getEntity($serverEntity->getServiceInfoUID()); + if ($serverEntity->getServiceInfoUid()) { + $serviceEntity = service('customer_serviceservice')->getEntity($serverEntity->getServiceInfoUid()); } //각 파트정보 가져오기 $partEntity = $this->getPartService($formDatas['type'])->getEntity($formDatas['part_uid']); if (!$serviceEntity instanceof ServiceEntity) { } //해당 파트정보에 고객번호,서비스번호 설정 - $formDatas['clientinfo_uid'] = $serverEntity->getClientInfoUID(); - $formDatas['serviceinfo_uid'] = $serverEntity->getServiceInfoUID(); + $formDatas['clientinfo_uid'] = $serverEntity->getClientInfoUid(); + $formDatas['serviceinfo_uid'] = $serverEntity->getServiceInfoUid(); //해당 파트정보의 Title을 서버파트정보의 Titlte 설정 $formDatas['title'] = $partEntity->getTitle(); //청구방식에 따른 결제일 설정 @@ -151,7 +151,7 @@ class ServerPartService extends EquipmentService throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생:Return Type은 PaymentEntity만 가능"); } //해당 파트정보가 변경 - if ($oldEntity->getPartUID() != $entity->getPartUID()) { + if ($oldEntity->getPartUid() != $entity->getPartUid()) { $this->getPartService($entity->getType())->detachFromServerPart($oldEntity); $this->getPartService($entity->getType())->attachToServerPart($entity); } @@ -177,11 +177,11 @@ class ServerPartService extends EquipmentService } //서비스가 정의 되어 있으면 //월비용 서버파트 인경우 서비스 금액 재설정 - if ($entity->getServiceInfoUID() !== null && $entity->getBilling() == PAYMENT['BILLING']['MONTH']) { + if ($entity->getServiceInfoUid() !== null && $entity->getBilling() == PAYMENT['BILLING']['MONTH']) { //서비스정보 가져오기 - $serviceEntity = service('customer_serviceservice')->getEntity($entity->getServiceInfoUID()); + $serviceEntity = service('customer_serviceservice')->getEntity($entity->getServiceInfoUid()); if (!$serviceEntity instanceof ServiceEntity) { - throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: {$entity->getServiceInfoUID()}에 해당하는 서비스정보를 찾을 수 없습니다."); + throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: {$entity->getServiceInfoUid()}에 해당하는 서비스정보를 찾을 수 없습니다."); } service('customer_serviceservice')->updateAmount($serviceEntity); } @@ -197,8 +197,8 @@ class ServerPartService extends EquipmentService //*서버의 Title 대소문자구분 필요->서버의 Title로 구분해서 기본부품 추가 foreach (SERVERPART['SERVER_PARTTYPES'] as $parttype) { //해당 서버의 chassis_uid에 해당하는 Default값이 있는지 체크 후 서버파트 추가 - if (array_key_exists($serverEntity->getChassisInfoUID(), SERVERPART[$parttype])) { - foreach (SERVERPART[$parttype][$serverEntity->getChassisInfoUID()] as $part) { + if (array_key_exists($serverEntity->getChassisInfoUid(), SERVERPART[$parttype])) { + foreach (SERVERPART[$parttype][$serverEntity->getChassisInfoUid()] as $part) { //해당 파트정보 가져오기 $partEntity = $this->getPartService($parttype)->getEntity($part['UID']); if (!$partEntity instanceof PartEntity) { diff --git a/app/Services/Equipment/ServerService.php b/app/Services/Equipment/ServerService.php index 0e9c426..2b25c4c 100644 --- a/app/Services/Equipment/ServerService.php +++ b/app/Services/Equipment/ServerService.php @@ -180,19 +180,19 @@ class ServerService extends EquipmentService service('part_ipservice')->attachToServer($entity); } //SWITCH변경 - if ($oldEntity->getSwitchInfoUID() !== $entity->getSwitchInfoUID()) { + if ($oldEntity->getSwitchInfoUid() !== $entity->getSwitchInfoUid()) { service('part_switchservice')->detachFromServer($oldEntity); service('part_switchservice')->attachToServer($entity); } //샷시변경 - if ($oldEntity->getSwitchInfoUID() !== $entity->getSwitchInfoUID()) { + if ($oldEntity->getSwitchInfoUid() !== $entity->getSwitchInfoUid()) { service('equipment_chassisservice')->detachFromServer($oldEntity); service('equipment_chassisservice')->attachToServer($entity); } - if ($entity->getServiceInfoUID() !== null) { //서비스가 정의 되어 있으면 - $serviceEntity = service('customer_serviceservice')->getEntity($entity->getServiceInfoUID()); + if ($entity->getServiceInfoUid() !== null) { //서비스가 정의 되어 있으면 + $serviceEntity = service('customer_serviceservice')->getEntity($entity->getServiceInfoUid()); if (!$serviceEntity instanceof ServiceEntity) { - throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: {$entity->getServiceInfoUID()}에 해당하는 서비스정보을 찾을수 없습니다."); + throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: {$entity->getServiceInfoUid()}에 해당하는 서비스정보을 찾을수 없습니다."); } service('customer_serviceservice')->updateAmount($serviceEntity); } @@ -216,21 +216,21 @@ class ServerService extends EquipmentService throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: {$uid}에 해당하는 서버정보을 찾을수 없습니다."); } $formDatas['serviceinfo_uid'] = $serviceEntity->getPK(); - $formDatas["clientinfo_uid"] = $serviceEntity->getClientInfoUID(); + $formDatas["clientinfo_uid"] = $serviceEntity->getClientInfoUid(); $formDatas['status'] = $formDatas['status'] ?? STATUS['OCCUPIED']; parent::modify_process($entity, $formDatas); } public function modifyByService(ServiceENtity $oldServiceEntity, ServiceEntity $serviceEntity): void { //기존 메인서버 정보 - $oldEntity = $this->getEntity($oldServiceEntity->getServerInfoUID()); + $oldEntity = $this->getEntity($oldServiceEntity->getServerInfoUid()); if (!$oldEntity instanceof ServerEntity) { - throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: {$oldServiceEntity->getServerInfoUID()}에 해당하는 서비스의 기존 메인 서버정보을 찾을수 없습니다."); + throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: {$oldServiceEntity->getServerInfoUid()}에 해당하는 서비스의 기존 메인 서버정보을 찾을수 없습니다."); } //신규 메인서버 정보 - $entity = $this->getEntity($serviceEntity->getServerInfoUID()); + $entity = $this->getEntity($serviceEntity->getServerInfoUid()); if (!$entity instanceof ServerEntity) { - throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: {$serviceEntity->getServerInfoUID()}에 해당하는 서비스의 신규 메인 서버정보을 찾을수 없습니다."); + throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: {$serviceEntity->getServerInfoUid()}에 해당하는 서비스의 신규 메인 서버정보을 찾을수 없습니다."); } //신규 메인서버는 기존 메인서버의 타입으로 설정 식뉴규서버는 메인서버로 추가 $this->attatchToService($serviceEntity, $entity->getPK(), ['type' => $oldEntity->getType()]); diff --git a/app/Services/Part/CPUService.php b/app/Services/Part/CPUService.php index ee94c56..b2fdedf 100644 --- a/app/Services/Part/CPUService.php +++ b/app/Services/Part/CPUService.php @@ -78,9 +78,9 @@ class CPUService extends PartType1Service public function getPartEntityByServerPart(ServerPartEntity $serverPartEntity): CPUEntity { //IP정보에서 해당하는 IP가 있으면 가져와서 사용중인지 체크 후 수정 - $entity = $this->getEntity($serverPartEntity->getPartUID()); + $entity = $this->getEntity($serverPartEntity->getPartUid()); if (!$entity instanceof CPUEntity) { - throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 {$serverPartEntity->getPartUID()}에 해당하는 CPUEntity정보를 찾을수없습니다."); + throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 {$serverPartEntity->getPartUid()}에 해당하는 CPUEntity정보를 찾을수없습니다."); } return $entity; } diff --git a/app/Services/Part/CSService.php b/app/Services/Part/CSService.php index 9d37a85..6df97fb 100644 --- a/app/Services/Part/CSService.php +++ b/app/Services/Part/CSService.php @@ -80,9 +80,9 @@ class CSService extends PartType2Service public function getPartEntityByServerPart(ServerPartEntity $serverPartEntity): CSEntity { //IP정보에서 해당하는 IP가 있으면 가져와서 사용중인지 체크 후 수정 - $entity = $this->getEntity($serverPartEntity->getPartUID()); + $entity = $this->getEntity($serverPartEntity->getPartUid()); if (!$entity instanceof CSEntity) { - throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 {$serverPartEntity->getPartUID()}에 해당하는 CS정보를 찾을수없습니다."); + throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 {$serverPartEntity->getPartUid()}에 해당하는 CS정보를 찾을수없습니다."); } return $entity; } diff --git a/app/Services/Part/DISKService.php b/app/Services/Part/DISKService.php index 6bc26ab..2b9d8c9 100644 --- a/app/Services/Part/DISKService.php +++ b/app/Services/Part/DISKService.php @@ -80,9 +80,9 @@ class DISKService extends PartType1Service public function getPartEntityByServerPart(ServerPartEntity $serverPartEntity): DISKEntity { //IP정보에서 해당하는 IP가 있으면 가져와서 사용중인지 체크 후 수정 - $entity = $this->getEntity($serverPartEntity->getPartUID()); + $entity = $this->getEntity($serverPartEntity->getPartUid()); if (!$entity instanceof DISKEntity) { - throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 {$serverPartEntity->getPartUID()}에 해당하는 DISKEntity정보를 찾을수없습니다."); + throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 {$serverPartEntity->getPartUid()}에 해당하는 DISKEntity정보를 찾을수없습니다."); } return $entity; } diff --git a/app/Services/Part/IPService.php b/app/Services/Part/IPService.php index 7517e11..12c7a6b 100644 --- a/app/Services/Part/IPService.php +++ b/app/Services/Part/IPService.php @@ -96,7 +96,7 @@ class IPService extends PartType3Service { /** @var IPEntity $entity IDE에 entity type알려주기*/ $entity = $this->getPartEntityByServer($serverEntity); - $formDatas['old_clientinfo_uid'] = $entity->getClientInfoUID() ?? $serverEntity->getClientInfoUID(); + $formDatas['old_clientinfo_uid'] = $entity->getClientInfoUid() ?? $serverEntity->getClientInfoUid(); $entity = parent::detachFromServer($serverEntity, $formDatas); return $entity; } @@ -105,9 +105,9 @@ class IPService extends PartType3Service public function getPartEntityByServerPart(ServerPartEntity $serverPartEntity): IPEntity { //IP정보에서 해당하는 IP가 있으면 가져와서 사용중인지 체크 후 수정 - $entity = $this->getEntity($serverPartEntity->getPartUID()); + $entity = $this->getEntity($serverPartEntity->getPartUid()); if (!$entity instanceof IPEntity) { - throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 {$serverPartEntity->getPartUID()}에 해당하는 IP정보를 찾을수없습니다."); + throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 {$serverPartEntity->getPartUid()}에 해당하는 IP정보를 찾을수없습니다."); } return $entity; } @@ -122,7 +122,7 @@ class IPService extends PartType3Service { /** @var IPEntity $entity IDE에 entity type알려주기*/ $entity = $this->getPartEntityByServerPart($serverPartEntity); - $formDatas['old_clientinfo_uid'] = $entity->getClientInfoUID(); + $formDatas['old_clientinfo_uid'] = $entity->getClientInfoUid(); $entity = parent::detachFromServerPart($serverPartEntity, $formDatas); return $entity; } diff --git a/app/Services/Part/PartType2Service.php b/app/Services/Part/PartType2Service.php index 10f8457..dff10fc 100644 --- a/app/Services/Part/PartType2Service.php +++ b/app/Services/Part/PartType2Service.php @@ -16,9 +16,9 @@ abstract class PartType2Service extends PartService //서버파트관련 작업 public function attachToServerPart(ServerPartEntity $serverPartEntity, array $formDatas = []): PartEntity { - $formDatas['clientinfo_uid'] = $serverPartEntity->getClientInfoUID(); - $formDatas['serviceinfo_uid'] = $serverPartEntity->getServiceInfoUID(); - $formDatas['serverinfo_uid'] = $serverPartEntity->getServerInfoUID(); + $formDatas['clientinfo_uid'] = $serverPartEntity->getClientInfoUid(); + $formDatas['serviceinfo_uid'] = $serverPartEntity->getServiceInfoUid(); + $formDatas['serverinfo_uid'] = $serverPartEntity->getServerInfoUid(); $formDatas['status'] = STATUS['OCCUPIED']; //파트정보가져오기 $entity = $this->getPartEntityByServerPart($serverPartEntity); diff --git a/app/Services/Part/PartType3Service.php b/app/Services/Part/PartType3Service.php index 2ac0e0e..4985a61 100644 --- a/app/Services/Part/PartType3Service.php +++ b/app/Services/Part/PartType3Service.php @@ -16,8 +16,8 @@ abstract class PartType3Service extends PartType2Service //서버관련 작업 public function attachToServer(ServerEntity $serverEntity, array $formDatas = []): PartEntity { - $formDatas['clientinfo_uid'] = $serverEntity->getClientInfoUID(); - $formDatas['serviceinfo_uid'] = $serverEntity->getServiceInfoUID(); + $formDatas['clientinfo_uid'] = $serverEntity->getClientInfoUid(); + $formDatas['serviceinfo_uid'] = $serverEntity->getServiceInfoUid(); $formDatas['serverinfo_uid'] = $serverEntity->getPK(); $formDatas['status'] = STATUS['OCCUPIED']; //파트정보가져오기 diff --git a/app/Services/Part/RAMService.php b/app/Services/Part/RAMService.php index ce3b85e..eb7ab93 100644 --- a/app/Services/Part/RAMService.php +++ b/app/Services/Part/RAMService.php @@ -78,9 +78,9 @@ class RAMService extends PartType1Service public function getPartEntityByServerPart(ServerPartEntity $serverPartEntity): RAMEntity { //IP정보에서 해당하는 IP가 있으면 가져와서 사용중인지 체크 후 수정 - $entity = $this->getEntity($serverPartEntity->getPartUID()); + $entity = $this->getEntity($serverPartEntity->getPartUid()); if (!$entity instanceof RAMEntity) { - throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 {$serverPartEntity->getPartUID()}에 해당하는 RAMEntity정보를 찾을수없습니다."); + throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 {$serverPartEntity->getPartUid()}에 해당하는 RAMEntity정보를 찾을수없습니다."); } return $entity; } diff --git a/app/Services/Part/SOFTWAREService.php b/app/Services/Part/SOFTWAREService.php index 0a568a0..60829a3 100644 --- a/app/Services/Part/SOFTWAREService.php +++ b/app/Services/Part/SOFTWAREService.php @@ -79,9 +79,9 @@ class SOFTWAREService extends PartType1Service public function getPartEntityByServerPart(ServerPartEntity $serverPartEntity): SOFTWAREEntity { //IP정보에서 해당하는 IP가 있으면 가져와서 사용중인지 체크 후 수정 - $entity = $this->getEntity($serverPartEntity->getPartUID()); + $entity = $this->getEntity($serverPartEntity->getPartUid()); if (!$entity instanceof SOFTWAREEntity) { - throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 {$serverPartEntity->getPartUID()}에 해당하는 SOFTWAREEntity정보를 찾을수없습니다."); + throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 {$serverPartEntity->getPartUid()}에 해당하는 SOFTWAREEntity정보를 찾을수없습니다."); } return $entity; } diff --git a/app/Services/Part/SWITCHService.php b/app/Services/Part/SWITCHService.php index 520df72..86a4505 100644 --- a/app/Services/Part/SWITCHService.php +++ b/app/Services/Part/SWITCHService.php @@ -81,9 +81,9 @@ class SWITCHService extends PartType3Service public function getPartEntityByServer(ServerEntity $serverEntity): SWITCHEntity { //IP정보에서 해당하는 IP가 있으면 가져와서 사용중인지 체크 후 수정 - $entity = $this->getEntity($serverEntity->getSwitchInfoUID()); + $entity = $this->getEntity($serverEntity->getSwitchInfoUid()); if (!$entity instanceof SWITCHEntity) { - throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 {$serverEntity->getSwitchInfoUID()}에 해당하는 IP정보를 찾을수없습니다."); + throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 {$serverEntity->getSwitchInfoUid()}에 해당하는 IP정보를 찾을수없습니다."); } return $entity; } @@ -104,9 +104,9 @@ class SWITCHService extends PartType3Service public function getPartEntityByServerPart(ServerPartEntity $serverPartEntity): SWITCHEntity { //IP정보에서 해당하는 IP가 있으면 가져와서 사용중인지 체크 후 수정 - $entity = $this->getEntity($serverPartEntity->getPartUID()); + $entity = $this->getEntity($serverPartEntity->getPartUid()); if (!$entity instanceof SWITCHEntity) { - throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 {$serverPartEntity->getPartUID()}에 해당하는 Switch정보를 찾을수없습니다."); + throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 {$serverPartEntity->getPartUid()}에 해당하는 Switch정보를 찾을수없습니다."); } return $entity; } diff --git a/app/Services/PaymentService.php b/app/Services/PaymentService.php index e1904aa..55f3055 100644 --- a/app/Services/PaymentService.php +++ b/app/Services/PaymentService.php @@ -139,7 +139,7 @@ class PaymentService extends CommonService if (!$serviceEntity instanceof ServiceEntity) { throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: {$formDatas['serviceinfo_uid']}에 해당하는 서비스정보를 찾을 수 없습니다."); } - $formDatas['clientinfo_uid'] = $serviceEntity->getClientInfoUID(); + $formDatas['clientinfo_uid'] = $serviceEntity->getClientInfoUid(); $entity = parent::create_process($formDatas); if (!$entity instanceof PaymentEntity) { throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생:Return Type은 PaymentEntity만 가능"); @@ -150,7 +150,7 @@ class PaymentService extends CommonService } //선결제인경우 서비스정보에 결제일 변경용 if ($entity->getBilling() === PAYMENT['BILLING']['PREPAYMENT']) { - service('customer_serviceservice')->updateBillingAt($entity->getServiceInfoUID(), $entity->getBillingAt()); + service('customer_serviceservice')->updateBillingAt($entity->getServiceInfoUid(), $entity->getBillingAt()); } return $entity; } @@ -167,7 +167,7 @@ class PaymentService extends CommonService if (!$serviceEntity instanceof ServiceEntity) { throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: {$formDatas['serviceinfo_uid']}에 해당하는 서비스정보를 찾을 수 없습니다."); } - $formDatas['clientinfo_uid'] = $serviceEntity->getClientInfoUID(); + $formDatas['clientinfo_uid'] = $serviceEntity->getClientInfoUid(); //수정된 결제정보 $entity = parent::modify_process($entity, $formDatas); if (!$entity instanceof PaymentEntity) { @@ -179,7 +179,7 @@ class PaymentService extends CommonService } //선결제인경우 서비스정보에 결제일 변경용 if ($entity->getBilling() === PAYMENT['BILLING']['PREPAYMENT']) { - service('customer_serviceservice')->updateBillingAt($entity->getServiceInfoUID(), $entity->getBillingAt()); + service('customer_serviceservice')->updateBillingAt($entity->getServiceInfoUid(), $entity->getBillingAt()); } return $entity; } @@ -202,9 +202,9 @@ class PaymentService extends CommonService ]; } if (!array_key_exists($serviceEntity->getPK(), $rows[$clientEntity->getPK()]['services'])) { - $serverEntity = service('equipment_serverservice')->getEntity($serviceEntity->getServerInfoUID()); + $serverEntity = service('equipment_serverservice')->getEntity($serviceEntity->getServerInfoUid()); if (!$serverEntity instanceof ServerEntity) { - throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생:[{$serviceEntity->getServerInfoUID()}]에 대한 서버정보를 찾을 수 없습니다."); + throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생:[{$serviceEntity->getServerInfoUid()}]에 대한 서버정보를 찾을 수 없습니다."); } $rows[$clientEntity->getPK()]['services'][$serviceEntity->getPK()] = [ 'ip' => $serverEntity->getIP(), @@ -227,7 +227,7 @@ class PaymentService extends CommonService private function getFormDatasFromService(ServiceEntity $serviceEntity, array $formDatas = []): array { $formDatas['serviceinfo_uid'] = $serviceEntity->getPK(); - $formDatas["clientinfo_uid"] = $serviceEntity->getClientInfoUID(); + $formDatas["clientinfo_uid"] = $serviceEntity->getClientInfoUid(); $formDatas['amount'] = $serviceEntity->getAmount(); $formDatas['billing'] = $formDatas['billing'] ?? PAYMENT['BILLING']['MONTH']; $formDatas['billing_at'] = $serviceEntity->getBillingAt(); @@ -270,11 +270,11 @@ class PaymentService extends CommonService //서버파트별 일회성 관련 private function getFormDatasFromServerPart(ServerPartEntity $serverPartEntity, array $formDatas = []): array { - if ($serverPartEntity->getServiceInfoUID() === null) { + if ($serverPartEntity->getServiceInfoUid() === null) { throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: 서비스정보가 정의되지 않아 일회성 상품을 설정하실수 없습니다."); } - $formDatas['serviceinfo_uid'] = $serverPartEntity->getServiceInfoUID(); - $formDatas["clientinfo_uid"] = $serverPartEntity->getClientInfoUID(); + $formDatas['serviceinfo_uid'] = $serverPartEntity->getServiceInfoUid(); + $formDatas["clientinfo_uid"] = $serverPartEntity->getClientInfoUid(); $formDatas["serverpartinfo_uid"] = $serverPartEntity->getPK(); $formDatas['amount'] = $serverPartEntity->getAmount(); $formDatas['billing'] = $formDatas['billing'] ?? PAYMENT['BILLING']['ONETIME']; @@ -286,7 +286,7 @@ class PaymentService extends CommonService } public function createByServerPart(ServerPartEntity $serverPartEntity): PaymentEntity { - if ($serverPartEntity->getServiceInfoUID() === null) { + if ($serverPartEntity->getServiceInfoUid() === null) { throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: 서비스정보가 정의되지 않아 일회성 상품을 설정하실수 없습니다."); } $formDatas = $this->getFormDatasFromServerPart($serverPartEntity); @@ -294,13 +294,13 @@ class PaymentService extends CommonService } public function modifyByServerPart(ServerPartEntity $oldServerPartEntity, ServerPartEntity $serverPartEntity): PaymentEntity { - if ($serverPartEntity->getServiceInfoUID() === null) { + if ($serverPartEntity->getServiceInfoUid() === null) { throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: 서비스정보가 정의되지 않아 일회성 상품을 설정하실수 없습니다."); } //서버파트정보의 서비스번호가 같고, 청구방식이 onetime이고 상태가 UNPAID인 결제정보 가져와서 결제정보 수정 $entity = $this->getEntity([ 'serverpartinfo_uid' => $oldServerPartEntity->getPK(), - 'serviceinfo_uid' => $oldServerPartEntity->getServiceInfoUID(), + 'serviceinfo_uid' => $oldServerPartEntity->getServiceInfoUid(), 'billing' => $oldServerPartEntity->getBilling(), 'billing_at' => $oldServerPartEntity->getBillingAt(), 'status' => STATUS['UNPAID'] diff --git a/app/Views/admin/welcome/new_service.php b/app/Views/admin/welcome/new_service.php index 062d505..2a3e07c 100644 --- a/app/Views/admin/welcome/new_service.php +++ b/app/Views/admin/welcome/new_service.php @@ -24,9 +24,9 @@ getSite()] ?> - getFieldView('clientinfo_uid', $entity->getClientInfoUID(), $viewDatas) ?> - getFieldView('serverinfo_uid', $entity->getServerInfoUID(), $viewDatas) ?> - getFieldView('user_uid', $entity->getUserUID(), $viewDatas) ?> + getFieldView('clientinfo_uid', $entity->getClientInfoUid(), $viewDatas) ?> + getFieldView('serverinfo_uid', $entity->getServerInfoUid(), $viewDatas) ?> + getFieldView('user_uid', $entity->getUserUid(), $viewDatas) ?> diff --git a/app/Views/cells/payment/detail.php b/app/Views/cells/payment/detail.php index 9f40818..acafe58 100644 --- a/app/Views/cells/payment/detail.php +++ b/app/Views/cells/payment/detail.php @@ -17,7 +17,7 @@ - getFieldView('serviceinfo_uid', $entity->getServiceInfoUID(), $paymentCellDatas) ?> + getFieldView('serviceinfo_uid', $entity->getServiceInfoUid(), $paymentCellDatas) ?> getFieldView('title', $entity->getTitle(), $paymentCellDatas) ?>
getFieldView('content', $entity->getContent(), $paymentCellDatas) ?>
@@ -26,7 +26,7 @@ getFieldView('billing', $entity->getBilling(), $paymentCellDatas) ?> getFieldView('pay', $entity->getPay(), $paymentCellDatas) ?> getFieldView('create_at', $entity->getCreatedAt(), $paymentCellDatas) ?> - getFieldView('user_uid', $entity->getUserUID(), $paymentCellDatas) ?> + getFieldView('user_uid', $entity->getUserUid(), $paymentCellDatas) ?> getListButton('paid', "", $paymentCellDatas) ?> diff --git a/app/Views/cells/server/detail.php b/app/Views/cells/server/detail.php index 18036f8..3b373f8 100644 --- a/app/Views/cells/server/detail.php +++ b/app/Views/cells/server/detail.php @@ -3,7 +3,7 @@ - getServerInfoUID() == $entity->getPK() ? "📌" : "getPK()}?serverinfo_uid={$entity->getPK()}\">✔️" ?> + getServerInfoUid() == $entity->getPK() ? "📌" : "getPK()}?serverinfo_uid={$entity->getPK()}\">✔️" ?> getFieldView('SERVER', "", ['serverEntity' => $entity]) ?> getPK()}?serverinfo_uid={$entity->getPK()}\">❌" ?> @@ -17,7 +17,7 @@ -
getFieldView('switchinfo_uid', $entity->getSwitchInfoUID(), $serverCellDatas) ?>
+
getFieldView('switchinfo_uid', $entity->getSwitchInfoUid(), $serverCellDatas) ?>
getTitle() ?>
getIP() ?>
getOS() ?>
diff --git a/app/Views/cells/server/servicelist.php b/app/Views/cells/server/servicelist.php index 1c9894d..47bcb4d 100644 --- a/app/Views/cells/server/servicelist.php +++ b/app/Views/cells/server/servicelist.php @@ -5,7 +5,7 @@ $part = sprintf( "%s / %s / %s / %s / %s", $entity->getTitle(), - $serverCellDatas['helper']->getFieldView('switchinfo_uid', $entity->getSwitchInfoUID(), $serverCellDatas), + $serverCellDatas['helper']->getFieldView('switchinfo_uid', $entity->getSwitchInfoUid(), $serverCellDatas), $serverCellDatas['helper']->getFieldView('ip', $entity->getIP(), $serverCellDatas), $serverCellDatas['helper']->getFieldView('os', $entity->getOS(), $serverCellDatas), view_cell("\App\Cells\Equipment\ServerPartCell::parttable", [ @@ -20,7 +20,7 @@ "📋%s%s", $entity->getCode() . ' / ' . $part, $part, - $serverCellDatas['serviceEntity']->getServerInfoUID() == $entity->getPK() ? "📌" : "✔️", + $serverCellDatas['serviceEntity']->getServerInfoUid() == $entity->getPK() ? "📌" : "✔️", $html ) ?>