From 7849b10ed6e9c33ada0ceb8a5ea0a01078579f9f Mon Sep 17 00:00:00 2001 From: "choi.jh" Date: Fri, 22 Aug 2025 11:00:49 +0900 Subject: [PATCH] dbmsv2 init...1 --- app/Controllers/CommonController.php | 21 ++++--- app/Language/en/Customer/Account.php | 10 +++- app/Language/en/Customer/Coupon.php | 2 +- app/Services/Auth/LocalService.php | 20 ++++++- app/Services/CommonService.php | 20 +++---- app/Services/Customer/AccountService.php | 49 +++++++++++----- app/Services/Customer/ClientService.php | 53 ++++++++++++++---- app/Services/Customer/CouponService.php | 38 +++++++++---- app/Services/Customer/PaymentService.php | 60 +++++++++++++------- app/Services/Customer/PointService.php | 38 +++++++++---- app/Services/Customer/ServiceService.php | 71 +++++++++++++++++------- app/Services/Equipment/CSService.php | 55 ++++++++++++------ app/Services/Equipment/IPService.php | 52 ++++++++++++----- app/Services/Equipment/LineService.php | 47 +++++++++++----- app/Services/Equipment/PartService.php | 41 +++++++++----- app/Services/Equipment/ServerService.php | 4 ++ app/Services/Equipment/SwitchService.php | 45 ++++++++++----- app/Services/MyLogService.php | 44 ++++++++++----- app/Services/UserSNSService.php | 50 ++++++++++++----- app/Services/UserService.php | 67 +++++++++++++++++----- 20 files changed, 563 insertions(+), 224 deletions(-) diff --git a/app/Controllers/CommonController.php b/app/Controllers/CommonController.php index 67de602..a9857df 100644 --- a/app/Controllers/CommonController.php +++ b/app/Controllers/CommonController.php @@ -130,23 +130,26 @@ abstract class CommonController extends BaseController return array_key_exists($field, $this->_control['default_values']) ? $this->_control['default_values'][$field] : null; } - final protected function initAction(string $action, $formFields = []): void + final protected function initAction(string $action, $actionFields = []): void { //각 Field 초기화 $this->setAction($action); switch ($action) { case 'view': - $fields = $this->_control['view_fields'] = array_key_exists('fields', $formFields) ? $formFields['fields'] : $this->getService()->getViewFields()['fields'] ?? []; - $filters = $this->_control['filter_fields'] = array_key_exists('filters', $formFields) ? $formFields['filters'] : $this->getService()->getViewFields()['filters'] ?? []; + $actionFields = array_key_exists('view_fields', $actionFields) ? $actionFields : $this->getService()->getViewFields(); + $fields = $this->_control['view_fields'] = $actionFields['fields'] ?? []; + $filters = $this->_control['filter_fields'] = $actionFields['filters'] ?? []; break; case 'index': - $fields = $this->_control['index_fields'] = array_key_exists('fields', $formFields) ? $formFields['fields'] : $this->getService()->getIndexFields()['fields'] ?? []; - $filters = $this->_control['filter_fields'] = array_key_exists('filters', $formFields) ? $formFields['filters'] : $this->getService()->getIndexFields()['filters'] ?? []; - $this->_control['batchjob_fields'] = array_key_exists('batchjobFields', $formFields) ? $formFields['batchjobFields'] : $this->getService()->getIndexFields()['batchjob_fields'] ?? []; - $this->_control['batchjob_buttions'] = array_key_exists('batchjobButtions', $formFields) ? $formFields['batchjobFields'] : $this->getService()->getIndexFields()['batchjob_buttions'] ?? []; + $actionFields = array_key_exists('index_fields', $actionFields) ? $actionFields : $this->getService()->getIndexFields(); + $fields = $this->_control['index_fields'] = $actionFields['fields'] ?? []; + $filters = $this->_control['filter_fields'] = $actionFields['filters'] ?? []; + $this->_control['batchjob_fields'] = $actionFields['batchjob_fields'] ?? []; + $this->_control['batchjob_buttions'] = $actionFields['batchjob_buttions'] ?? []; break; default: - $fields = $this->_control['form_fields'] = array_key_exists('fields', $formFields) ? $formFields['fields'] : $this->getService()->getFormFields()['fields'] ?? []; - $filters = $this->_control['filter_fields'] = array_key_exists('filters', $formFields) ? $formFields['filters'] : $this->getService()->getFormFields()['filters'] ?? []; + $actionFields = array_key_exists('form_fields', $actionFields) ? $actionFields : $this->getService()->getFormFields(); + $fields = $this->_control['form_fields'] = $actionFields['fields'] ?? []; + $filters = $this->_control['filter_fields'] = $actionFields['filters'] ?? []; break; } $this->_control['field_rules'] = []; diff --git a/app/Language/en/Customer/Account.php b/app/Language/en/Customer/Account.php index 1ad7533..a78d36a 100644 --- a/app/Language/en/Customer/Account.php +++ b/app/Language/en/Customer/Account.php @@ -6,14 +6,20 @@ return [ 'clientinfo_uid' => "고객명", 'bank' => "은행", 'title' => "제목", - 'alias' => "입/출금자명", + 'alias' => "입출금자명", 'amount' => "금액", 'status' => "상태", - 'issue_at' => "수정일", + 'issue_at' => "입출금일", 'updated_at' => "수정일", 'created_at' => "작성일", 'deleted_at' => "삭제일", ], + "BANK" => [ + '국민은행' => "국민은행", + "하나은행" => "하나은행", + "신한은행" => "신한은행", + "농협" => "농협", + ], "STATUS" => [ 'deposit' => "입금", "withdrawal" => "출금", diff --git a/app/Language/en/Customer/Coupon.php b/app/Language/en/Customer/Coupon.php index 603125c..5696a6e 100644 --- a/app/Language/en/Customer/Coupon.php +++ b/app/Language/en/Customer/Coupon.php @@ -4,7 +4,7 @@ return [ 'label' => [ 'clientinfo_uid' => "고객명", 'title' => "제목", - 'amount' => "갯수", + 'cnt' => "갯수", 'status' => "추가/사용", 'updated_at' => "수정일", 'created_at' => "작성일", diff --git a/app/Services/Auth/LocalService.php b/app/Services/Auth/LocalService.php index 902631a..e6fba80 100644 --- a/app/Services/Auth/LocalService.php +++ b/app/Services/Auth/LocalService.php @@ -15,8 +15,24 @@ class LocalService extends AuthService public function getFormFields(): array { return [ - "id", - "passwd", + 'fields' => [ + "id", + "passwd", + ], + 'filters' => [], + ]; + } + public function getIndexFields(): array + { + return [ + 'fields' => [ + "id", + "passwd", + "status", + ], + 'filters' => [], + 'batchjob_fields' => ['status'], + 'batchjob_buttions' => [] ]; } diff --git a/app/Services/CommonService.php b/app/Services/CommonService.php index 910d0b1..938e467 100644 --- a/app/Services/CommonService.php +++ b/app/Services/CommonService.php @@ -16,21 +16,11 @@ abstract class CommonService $this->_model = $model; } abstract public function getFormFields(): array; + abstract public function getIndexFields(): array; public function getViewFields(): array { return $this->getFormFields(); } - public function getIndexFields(): array - { - return $this->getFormFields(); - } - public function getBatchJobButtons(): array - { - return [ - 'batchjob' => '일괄 처리', - 'batchjob_delete' => '일괄 삭제', - ]; - } //기본 기능부분 final public function __get($name) { @@ -126,14 +116,18 @@ abstract class CommonService { switch ($field) { default: + $formOptionDatas = lang($this->getClassName() . '.' . strtoupper($field)); + if (!is_array($formOptionDatas)) { + throw new \Exception(__FUNCTION__ . "에서 {$field}}의 formOptionDatas 값이 array가 아닙니다.\n" . var_export($formOptionDatas, true)); + } $options = []; - foreach (lang($this->getClassName() . '.' . strtoupper($field)) as $key => $value) { + foreach ($formOptionDatas as $key => $value) { $options[$key] = new FormOptionEntity(['uid' => $key, 'title' => $value]); } break; } if (!is_array($options)) { - throw new \Exception(__FUNCTION__ . "에서 field의 options 값이 array가 아닙니다.\n" . var_export($options, true)); + throw new \Exception(__FUNCTION__ . "에서 {$field}의 options 값이 array가 아닙니다.\n" . var_export($options, true)); } return $options; } diff --git a/app/Services/Customer/AccountService.php b/app/Services/Customer/AccountService.php index b6ba523..face71b 100644 --- a/app/Services/Customer/AccountService.php +++ b/app/Services/Customer/AccountService.php @@ -16,22 +16,45 @@ class AccountService extends CustomerService public function getFormFields(): array { return [ - "clientinfo_uid", - "bank", - "title", - "alias", - "issue_at", - "amount", - "status", + 'fields' => [ + "clientinfo_uid", + "bank", + "title", + "alias", + "issue_at", + "amount", + "status", + ], + 'filters' => [ + "clientinfo_uid", + "bank", + "status", + ], ]; } - public function getFilterFields(): array + public function getIndexFields(): array { - return ["clientinfo_uid", 'status']; - } - public function getBatchJobFields(): array - { - return ['status']; + return [ + 'fields' => [ + "clientinfo_uid", + "bank", + "title", + "alias", + "issue_at", + "amount", + "status", + ], + 'filters' => [ + "clientinfo_uid", + "bank", + "status", + ], + 'batchjob_fields' => ['status'], + 'batchjob_buttions' => [ + 'batchjob' => '일괄 처리', + 'batchjob_delete' => '일괄 삭제', + ] + ]; } //기본 기능부분 diff --git a/app/Services/Customer/ClientService.php b/app/Services/Customer/ClientService.php index aa64d4b..bd072d1 100644 --- a/app/Services/Customer/ClientService.php +++ b/app/Services/Customer/ClientService.php @@ -14,19 +14,52 @@ class ClientService extends CustomerService } public function getFormFields(): array { - return ['site', 'name', 'email', 'phone', 'role']; - } - public function getFilterFields(): array - { - return ['site', 'role', 'status']; - } - public function getBatchJobFields(): array - { - return ['site', 'role', 'status']; + return [ + 'fields' => [ + 'site', + 'name', + 'email', + 'phone', + 'role', + ], + 'filters' => [ + 'site', + 'role', + 'status', + ], + ]; } public function getIndexFields(): array { - return ['site', 'name', 'email', 'phone', 'role', 'account_balance', 'coupon_balance', 'point_balance', 'status', 'created_at', 'updated_at']; + return [ + 'fields' => [ + 'site', + 'name', + 'email', + 'phone', + 'role', + 'account_balance', + 'coupon_balance', + 'point_balance', + 'status', + 'created_at', + 'updated_at', + ], + 'filters' => [ + 'site', + 'role', + 'status', + ], + 'batchjob_fields' => [ + 'site', + 'role', + 'status', + ], + 'batchjob_buttions' => [ + 'batchjob' => '일괄 처리', + 'batchjob_delete' => '일괄 삭제', + ] + ]; } //기본 기능부분 diff --git a/app/Services/Customer/CouponService.php b/app/Services/Customer/CouponService.php index cfec26f..bc4a310 100644 --- a/app/Services/Customer/CouponService.php +++ b/app/Services/Customer/CouponService.php @@ -16,19 +16,37 @@ class CouponService extends CustomerService public function getFormFields(): array { return [ - "clientinfo_uid", - "title", - "cnt", - "status", + 'fields' => [ + "clientinfo_uid", + "title", + "cnt", + "status", + ], + 'filters' => [ + "clientinfo_uid", + "status", + ], ]; } - public function getFilterFields(): array + public function getIndexFields(): array { - return ["clientinfo_uid", 'status']; - } - public function getBatchJobFields(): array - { - return ['status']; + return [ + 'fields' => [ + "clientinfo_uid", + "title", + "cnt", + "status", + ], + 'filters' => [ + "clientinfo_uid", + "status", + ], + 'batchjob_fields' => ['status'], + 'batchjob_buttions' => [ + 'batchjob' => '일괄 처리', + 'batchjob_delete' => '일괄 삭제', + ] + ]; } //기본 기능부분 diff --git a/app/Services/Customer/PaymentService.php b/app/Services/Customer/PaymentService.php index dda6717..6da0597 100644 --- a/app/Services/Customer/PaymentService.php +++ b/app/Services/Customer/PaymentService.php @@ -25,32 +25,50 @@ class PaymentService extends CustomerService public function getFormFields(): array { return [ - "clientinfo_uid", - "serviceinfo_uid", - "title", - "amount", - "billing_method", - "billing_at", - "pay_method", - "status" + 'fields' => [ + "clientinfo_uid", + "serviceinfo_uid", + "title", + "amount", + "billing_method", + "billing_at", + "pay_method", + "status" + ], + 'filters' => [ + 'clientinfo_uid', + 'billing_method', + 'pay_method', + 'status', + 'user_uid' + ], ]; } - public function getFilterFields(): array - { - return ['clientinfo_uid', 'billing_method', 'pay_method', 'status', 'user_uid']; - } - public function getBatchJobFields(): array - { - return ['clientinfo_uid', 'billing_method', 'pay_method', 'status']; - } public function getIndexFields(): array - { - return ['clientinfo_uid', 'billing_method', 'title', 'amount', 'billing_at', 'pay_method', 'status', 'countdown', 'user_uid']; - } - public function getBatchJobButtons(): array { return [ - 'invoice' => '청구서 발행', + 'fields' => [ + 'clientinfo_uid', + 'billing_method', + 'title', + 'amount', + 'billing_at', + 'pay_method', + 'status', + 'countdown', + 'user_uid' + ], + 'filters' => [ + 'clientinfo_uid', + 'billing_method', + 'pay_method', + 'status', + 'user_uid' + ], + 'batchjob_fields' => ['clientinfo_uid', 'billing_method', 'pay_method', 'status'], + 'batchjob_buttions' => [ + 'invoice' => '청구서 발행', + ], ]; } //기본 기능부분 diff --git a/app/Services/Customer/PointService.php b/app/Services/Customer/PointService.php index dd3510b..3483065 100644 --- a/app/Services/Customer/PointService.php +++ b/app/Services/Customer/PointService.php @@ -16,19 +16,37 @@ class PointService extends CustomerService public function getFormFields(): array { return [ - "clientinfo_uid", - "title", - "amount", - "status", + 'fields' => [ + "clientinfo_uid", + "title", + "amount", + "status", + ], + 'filters' => [ + "clientinfo_uid", + "status", + ], ]; } - public function getFilterFields(): array + public function getIndexFields(): array { - return ["clientinfo_uid", 'status']; - } - public function getBatchJobFields(): array - { - return ['status']; + return [ + 'fields' => [ + "clientinfo_uid", + "title", + "amount", + "status", + ], + 'filters' => [ + "clientinfo_uid", + "status", + ], + 'batchjob_fields' => ['status'], + 'batchjob_buttions' => [ + 'batchjob' => '일괄 처리', + 'batchjob_delete' => '일괄 삭제', + ] + ]; } //기본 기능부분 diff --git a/app/Services/Customer/ServiceService.php b/app/Services/Customer/ServiceService.php index f06583f..8f68652 100644 --- a/app/Services/Customer/ServiceService.php +++ b/app/Services/Customer/ServiceService.php @@ -17,31 +17,62 @@ class ServiceService extends CustomerService public function getFormFields(): array { return [ - "clientinfo_uid", - "type", - "location", - "serverinfo_uid", - "billing_at", - "amount", - "start_at", - "end_at", - "history", - "status", + 'fields' => [ + "clientinfo_uid", + "type", + "location", + "serverinfo_uid", + "billing_at", + "amount", + "start_at", + "end_at", + "history", + "status", + ], + 'filters' => [ + 'site', + 'clientinfo_uid', + 'serverinfo_uid', + 'type', + 'location', + 'status' + ], ]; } - public function getFilterFields(): array - { - return ['site', 'clientinfo_uid', 'serverinfo_uid', 'type', 'location', 'status']; - } - public function getBatchJobFields(): array - { - return ['site', 'clientinfo_uid', 'status']; - } public function getIndexFields(): array { - return ['site', 'clientinfo_uid', 'type', 'location', 'serverinfo_uid', 'billing_at', 'amount', 'start_at', 'end_at', 'updated_at', 'status', 'user_uid']; + return [ + 'fields' => [ + 'site', + 'clientinfo_uid', + 'type', + 'location', + 'serverinfo_uid', + 'billing_at', + 'amount', + 'start_at', + 'end_at', + 'updated_at', + 'status', + 'user_uid' + ], + 'filters' => [ + 'site', + 'clientinfo_uid', + 'serverinfo_uid', + 'type', + 'location', + 'status' + ], + 'batchjob_fields' => ['site', 'clientinfo_uid', 'status'], + 'batchjob_buttions' => [ + 'batchjob' => '일괄 처리', + 'batchjob_delete' => '일괄 삭제', + ] + ]; } - //Entity의 관련객체정의용 + //기본 기능부분 + //검색용 public function setSearchIp(string $ip): void { $this->_searchIP = $ip; diff --git a/app/Services/Equipment/CSService.php b/app/Services/Equipment/CSService.php index c5043f5..9ef4a7c 100644 --- a/app/Services/Equipment/CSService.php +++ b/app/Services/Equipment/CSService.php @@ -15,27 +15,50 @@ class CSService extends EquipmentService public function getFormFields(): array { return [ - "serverinfo_uid", - "type", - "ip", - "accountid", - "domain", - "price", - "status", + 'fields' => [ + "serverinfo_uid", + "type", + "ip", + "accountid", + "domain", + "price", + "status", + ], + 'filters' => [ + "clientinfo_uid", + 'serverinfo_uid', + 'type', + 'status' + ], ]; } - public function getFilterFields(): array - { - return ["clientinfo_uid", 'serverinfo_uid', 'type', 'status']; - } - public function getBatchJobFields(): array - { - return ["type", 'status']; - } public function getIndexFields(): array { - return ["clientinfo_uid", 'serverinfo_uid', 'type', 'ip', 'accountid', 'domain', 'price', 'status']; + return [ + 'fields' => [ + "clientinfo_uid", + 'serverinfo_uid', + 'type', + 'ip', + 'accountid', + 'domain', + 'price', + 'status' + ], + 'filters' => [ + "clientinfo_uid", + 'serverinfo_uid', + 'type', + 'status' + ], + 'batchjob_fields' => ["type", 'status'], + 'batchjob_buttions' => [ + 'batchjob' => '일괄 처리', + 'batchjob_delete' => '일괄 삭제', + ] + ]; } + //기본 기능부분 //List 검색용 //OrderBy 처리 public function setOrderBy(mixed $field = null, mixed $value = null): void diff --git a/app/Services/Equipment/IPService.php b/app/Services/Equipment/IPService.php index 0130b4e..2d8b2ec 100644 --- a/app/Services/Equipment/IPService.php +++ b/app/Services/Equipment/IPService.php @@ -19,24 +19,48 @@ class IPService extends EquipmentService public function getFormFields(): array { return [ - "lineinfo_uid", - "serverinfo_uid", - "ip", - "price", - "status", + 'fields' => [ + "lineinfo_uid", + "serverinfo_uid", + "ip", + "price", + "status", + ], + 'filters' => [ + 'old_clientinfo_uid', + 'clientinfo_uid', + 'serverinfo_uid', + "lineinfo_uid", + 'status' + ], ]; } - public function getFilterFields(): array - { - return ['old_clientinfo_uid', 'clientinfo_uid', 'serverinfo_uid', "lineinfo_uid", 'status']; - } - public function getBatchJobFields(): array - { - return ['status']; - } public function getIndexFields(): array { - return ['lineinfo_uid', 'ip', 'price', 'amount', 'status', 'clientinfo_uid', 'serverinfo_uid', 'old_clientinfo_uid']; + return [ + 'fields' => [ + 'lineinfo_uid', + 'ip', + 'price', + 'amount', + 'status', + 'clientinfo_uid', + 'serverinfo_uid', + 'old_clientinfo_uid' + ], + 'filters' => [ + 'old_clientinfo_uid', + 'clientinfo_uid', + 'serverinfo_uid', + "lineinfo_uid", + 'status' + ], + 'batchjob_fields' => ['status'], + 'batchjob_buttions' => [ + 'batchjob' => '일괄 처리', + 'batchjob_delete' => '일괄 삭제', + ] + ]; } final public function getLineService(): LineService { diff --git a/app/Services/Equipment/LineService.php b/app/Services/Equipment/LineService.php index 9c47c22..308da2b 100644 --- a/app/Services/Equipment/LineService.php +++ b/app/Services/Equipment/LineService.php @@ -14,24 +14,41 @@ class LineService extends EquipmentService public function getFormFields(): array { return [ - "type", - "title", - "bandwith", - "start_at", - "end_at", - "status", + 'fields' => [ + "type", + "title", + "bandwith", + "start_at", + "end_at", + "status", + ], + 'filters' => [ + "type", + 'status', + ], ]; } - public function getFilterFields(): array - { - return ["type", 'status',]; - } - public function getBatchJobFields(): array - { - return ['status']; - } public function getIndexFields(): array { - return ['type', 'title', 'bandwith', "start_at", "end_at", 'status']; + return [ + 'fields' => [ + 'type', + 'title', + 'bandwith', + "start_at", + "end_at", + 'status' + ], + 'filters' => [ + "type", + 'status', + ], + 'batchjob_fields' => ['status'], + 'batchjob_buttions' => [ + 'batchjob' => '일괄 처리', + 'batchjob_delete' => '일괄 삭제', + ], + ]; } + //기본 기능부분} } diff --git a/app/Services/Equipment/PartService.php b/app/Services/Equipment/PartService.php index 9cfe45f..1be226d 100644 --- a/app/Services/Equipment/PartService.php +++ b/app/Services/Equipment/PartService.php @@ -14,23 +14,38 @@ class PartService extends EquipmentService public function getFormFields(): array { return [ - "type", - "title", - "price", - "status", + 'fields' => [ + "type", + "title", + "price", + "status", + ], + 'filters' => [ + "type", + 'status', + ], ]; } - public function getFilterFields(): array - { - return ["type", 'status',]; - } - public function getBatchJobFields(): array - { - return ['status']; - } public function getIndexFields(): array { - return ['type', 'title', 'price', 'status', 'created_at']; + return [ + 'fields' => [ + 'type', + 'title', + 'price', + 'status', + 'created_at' + ], + 'filters' => [ + "type", + 'status', + ], + 'batchjob_fields' => ['status'], + 'batchjob_buttions' => [ + 'batchjob' => '일괄 처리', + 'batchjob_delete' => '일괄 삭제', + ] + ]; } //기본 기능부분 //FieldForm관련용 diff --git a/app/Services/Equipment/ServerService.php b/app/Services/Equipment/ServerService.php index c316958..9825b3b 100644 --- a/app/Services/Equipment/ServerService.php +++ b/app/Services/Equipment/ServerService.php @@ -61,6 +61,10 @@ class ServerService extends EquipmentService ], 'filters' => ['clientinfo_uid', 'serviceinfo_uid', 'type', 'status'], 'batchjob_fields' => ['clientinfo_uid', 'type', 'status'], + 'batchjob_buttions' => [ + 'batchjob' => '일괄 처리', + 'batchjob_delete' => '일괄 삭제', + ] ]; } final public function getPartService(): PartService diff --git a/app/Services/Equipment/SwitchService.php b/app/Services/Equipment/SwitchService.php index f6db7e2..c4a4251 100644 --- a/app/Services/Equipment/SwitchService.php +++ b/app/Services/Equipment/SwitchService.php @@ -16,24 +16,43 @@ class SwitchService extends EquipmentService public function getFormFields(): array { return [ - "serverinfo_uid", - "code", - "status", + 'fields' => [ + "serverinfo_uid", + "code", + "status", + ], + 'filters' => [ + 'clientinfo_uid', + 'serviceinfo_uid', + 'serverinfo_uid', + 'status' + ], ]; } - public function getFilterFields(): array - { - return ['clientinfo_uid', 'serviceinfo_uid', 'serverinfo_uid', 'status']; - } - public function getBatchJobFields(): array - { - return ['clientinfo_uid', 'serverinfo_uid', 'status']; - } public function getIndexFields(): array { - return ['code', 'status', 'clientinfo_uid', 'serviceinfo_uid', 'serverinfo_uid']; + return [ + 'fields' => [ + 'code', + 'status', + 'clientinfo_uid', + 'serviceinfo_uid', + 'serverinfo_uid' + ], + 'filters' => [ + 'clientinfo_uid', + 'serviceinfo_uid', + 'serverinfo_uid', + 'status' + ], + 'batchjob_fields' => ['clientinfo_uid', 'serverinfo_uid', 'status'], + 'batchjob_buttions' => [ + 'batchjob' => '일괄 처리', + 'batchjob_delete' => '일괄 삭제', + ] + ]; } - //기본기능 + //기본 기능부분 //FieldForm관련용 //상태변경 public function setStatus(string $code, string $status): SwitchEntity diff --git a/app/Services/MyLogService.php b/app/Services/MyLogService.php index 89ec3bd..a782f44 100644 --- a/app/Services/MyLogService.php +++ b/app/Services/MyLogService.php @@ -17,24 +17,38 @@ class MyLogService extends CommonService } public function getFormFields(): array { - return [ - "user_uid", - "title", - "content", - "status", + return [ + 'fields' => [ + "user_uid", + "title", + "content", + "status", + ], + 'filters' => [ + 'user_uid', + 'status' + ], ]; } - public function getFilterFields(): array - { - return ['user_uid', 'status']; - } - public function getBatchJobFields(): array - { - return ['status']; - } public function getIndexFields(): array { - return ['user_uid', 'title', 'status', 'created_at']; + return [ + 'fields' => [ + 'user_uid', + 'title', + 'status', + 'created_at' + ], + 'filters' => [ + 'user_uid', + 'status' + ], + 'batchjob_fields' => ['status'], + 'batchjob_buttions' => [ + 'batchjob' => '일괄 처리', + 'batchjob_delete' => '일괄 삭제', + ] + ]; } public function getUserService(): UserService { @@ -43,7 +57,7 @@ class MyLogService extends CommonService } return $this->_userService; } - //기본기능 + //기본 기능부분 //FieldForm관련용 public function getFormFieldOption(string $field, array $options = []): array { diff --git a/app/Services/UserSNSService.php b/app/Services/UserSNSService.php index f2d7be0..55cbcf1 100644 --- a/app/Services/UserSNSService.php +++ b/app/Services/UserSNSService.php @@ -16,21 +16,45 @@ class UserSNSService extends CommonService public function getFormFields(): array { return [ - "site", - "user_uid", - "id", - "name", - "email", - "detail", - "status", + 'fields' => [ + "site", + "user_uid", + "id", + "name", + "email", + "detail", + "status", + ], + 'filters' => [ + "site", + "user_uid", + "status", + ], ]; } - public function getFilterFields(): array + public function getIndexFields(): array { - return []; - } - public function getBatchJobFields(): array - { - return []; + return [ + 'fields' => [ + "site", + "user_uid", + "id", + "name", + "email", + "detail", + "status", + ], + 'filters' => [ + "site", + "user_uid", + "status", + ], + 'batchjob_fields' => ['status'], + 'batchjob_buttions' => [ + 'batchjob' => '일괄 처리', + 'batchjob_delete' => '일괄 삭제', + ] + ]; } + //기본 기능부분 } diff --git a/app/Services/UserService.php b/app/Services/UserService.php index 651e353..f78d0f1 100644 --- a/app/Services/UserService.php +++ b/app/Services/UserService.php @@ -14,24 +14,63 @@ class UserService extends CommonService } public function getFormFields(): array { - return ['id', 'passwd', 'confirmpassword', 'name', 'email', 'mobile', 'role']; - } - public function getFilterFields(): array - { - return ['role', 'status']; - } - public function getBatchJobFields(): array - { - return ['status']; - } - public function getIndexFields(): array - { - return ['id', 'name', 'email', 'mobile', 'role', 'status']; + return [ + 'fields' => [ + 'id', + 'passwd', + 'confirmpassword', + 'name', + 'email', + 'mobile', + 'role' + ], + 'filters' => [ + 'role', + 'status' + ], + ]; } public function getViewFields(): array { - return ['id', 'name', 'email', 'mobile', 'role', 'status']; + return [ + 'fields' => [ + 'id', + 'name', + 'email', + 'mobile', + 'role', + 'status' + ], + 'filters' => [ + 'role', + 'status' + ], + ]; } + public function getIndexFields(): array + { + return [ + 'fields' => [ + 'id', + 'name', + 'email', + 'mobile', + 'role', + 'status' + ], + 'filters' => [ + 'role', + 'status' + ], + 'batchjob_fields' => ['status'], + 'batchjob_buttions' => [ + 'batchjob' => '일괄 처리', + 'batchjob_delete' => '일괄 삭제', + ] + ]; + } + //기본 기능부분 + public function create(array $formDatas): UserEntity { $formDatas['role'] = implode(DEFAULTS["DELIMITER_ROLE"], $formDatas['role']);