From 3bea89dbb99a9c6a443ab6acbdb1ade0c12fc472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Fri, 19 Dec 2025 09:09:51 +0900 Subject: [PATCH] dbmsv4 init...3 --- app/DTOs/MylogDTO.php | 6 +++--- app/DTOs/PaymentDTO.php | 16 ++++++++-------- app/DTOs/UserDTO.php | 20 +++++++------------- app/Entities/MylogEntity.php | 9 +++++++++ app/Entities/PaymentEntity.php | 26 ++++++++++++++++++++------ app/Entities/UserEntity.php | 14 +++++++++++++- app/Entities/UserSNSEntity.php | 9 +++++++++ 7 files changed, 69 insertions(+), 31 deletions(-) diff --git a/app/DTOs/MylogDTO.php b/app/DTOs/MylogDTO.php index 11d822c..fb6e82b 100644 --- a/app/DTOs/MylogDTO.php +++ b/app/DTOs/MylogDTO.php @@ -6,9 +6,9 @@ class MylogDTO extends CommonDTO { public ?int $uid = null; public ?int $user_uid = null; - public ?string $title = null; - public ?string $content = null; - public ?string $status = null; + public string $title = null; + public string $content = ''; + public string $status = STATUS['AVAILABLE']; public function __construct(array $datas = []) { diff --git a/app/DTOs/PaymentDTO.php b/app/DTOs/PaymentDTO.php index 65c59cc..5371691 100644 --- a/app/DTOs/PaymentDTO.php +++ b/app/DTOs/PaymentDTO.php @@ -9,14 +9,14 @@ class PaymentDTO extends CommonDTO public ?int $clientinfo_uid = null; public ?int $serviceinfo_uid = null; public ?int $serverpartinfo_uid = null; - public ?string $title = null; - public ?string $content = null; - public ?int $amount = null; - public ?string $billing = null; - public ?string $billing_at = null; - public ?int $billing_month = 0; - public ?string $pay = null; - public ?string $status = null; + public string $title = ''; + public int $amount = 0; + public string $billing = ''; + public string $billing_at = ''; + public int $billing_month = 0; + public string $pay = ''; + public string $status = STATUS['UNPAID']; + public string $content = null; public function __construct(array $datas = []) { diff --git a/app/DTOs/UserDTO.php b/app/DTOs/UserDTO.php index dc49687..454126c 100644 --- a/app/DTOs/UserDTO.php +++ b/app/DTOs/UserDTO.php @@ -5,20 +5,14 @@ namespace App\DTOs; class UserDTO extends CommonDTO { public ?int $uid = null; - public ?string $id = null; - public ?string $passwd = null; - public ?string $confirmpassword = null; - public ?string $name = null; - public ?string $email = null; - public ?string $mobile = null; - - /** - * 검증(is_array) 통과를 위해 public array로 선언합니다. - * get_object_vars($this) 호출 시 배열 형태로 추출됩니다. - */ + public string $id = ''; + public string $passwd = ''; + public string $confirmpassword = ''; + public string $name = ''; + public string $email = ''; + public string $mobile = ''; public array $role = []; - - public ?string $status = null; + public string $status = STATUS['AVAILABLE']; public function __construct(array $datas = []) { diff --git a/app/Entities/MylogEntity.php b/app/Entities/MylogEntity.php index f30a641..18f8e72 100644 --- a/app/Entities/MylogEntity.php +++ b/app/Entities/MylogEntity.php @@ -8,6 +8,15 @@ class MylogEntity extends CommonEntity { const PK = Model::PK; const TITLE = Model::TITLE; + protected $attributes = [ + 'title' => '', + 'status' => STATUS['AVAILABLE'], + 'content' => '' + ]; + public function __construct(array|null $data = null) + { + parent::__construct($data); + } //공통부분 //Common Function } diff --git a/app/Entities/PaymentEntity.php b/app/Entities/PaymentEntity.php index 6211d10..4765f1b 100644 --- a/app/Entities/PaymentEntity.php +++ b/app/Entities/PaymentEntity.php @@ -9,6 +9,20 @@ class PaymentEntity extends CommonEntity { const PK = PaymentModel::PK; const TITLE = PaymentModel::TITLE; + protected $attributes = [ + 'title' => '', + 'amount' => 0, + 'billing' => "", + 'billing_at' => "", + 'billing_month' => 0, + 'pay' => "", + '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; @@ -28,15 +42,15 @@ class PaymentEntity extends CommonEntity } public function getBilling(): string { - return $this->attributes['billing']; + return $this->attributes['billing'] ?? ""; } public function getAmount(): int { - return $this->attributes['amount']; + return $this->attributes['amount'] ?? 0; } public function getBillingAt(): string { - return $this->attributes['billing_at']; + return $this->attributes['billing_at'] ?? ""; } public function getBillingMonth(): int { @@ -44,11 +58,11 @@ class PaymentEntity extends CommonEntity } public function getPay(): string { - return $this->attributes['pay']; + return $this->attributes['pay'] ?? ""; } - public function getContent(): string|null + public function getContent(): string { - return $this->attributes['content']; + return $this->attributes['content'] ?? ""; } public function getCountDueAt(): string { diff --git a/app/Entities/UserEntity.php b/app/Entities/UserEntity.php index fffb15a..603d9cb 100644 --- a/app/Entities/UserEntity.php +++ b/app/Entities/UserEntity.php @@ -15,7 +15,19 @@ class UserEntity extends CommonEntity protected $casts = [ // 'role' => 'json-array', // 🚫 CSV 형식 저장을 위해 제거 ]; - + protected $attributes = [ + 'id' => '', + 'passwd' => '', + 'name' => "", + 'email' => "", + 'mobile' => '', + 'role' => "", + 'status' => STATUS['AVAILABLE'], + ]; + public function __construct(array|null $data = null) + { + parent::__construct($data); + } public function getID(): string { return (string) $this->attributes['id']; diff --git a/app/Entities/UserSNSEntity.php b/app/Entities/UserSNSEntity.php index 48b84e9..a59ea45 100644 --- a/app/Entities/UserSNSEntity.php +++ b/app/Entities/UserSNSEntity.php @@ -9,6 +9,15 @@ class UserSNSEntity extends CommonEntity { const PK = Model::PK; const TITLE = Model::TITLE; + protected $attributes = [ + 'id' => '', + 'site' => '', + 'email' => "", + ]; + public function __construct(array|null $data = null) + { + parent::__construct($data); + } //Common Function public function getParent(): int|null {