From ecf4565fd5f6b8146284d62292b73a4cb3174457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Mon, 20 May 2024 17:25:35 +0900 Subject: [PATCH] vhost init...4 --- app/Cells/ProductCell.php | 14 +- app/Controllers/Admin/BillingController.php | 5 +- app/Controllers/Admin/BoardController.php | 13 +- app/Controllers/Admin/CategoryController.php | 2 +- app/Controllers/Admin/DeviceController.php | 4 +- app/Controllers/Admin/OrderController.php | 5 +- app/Controllers/Admin/ProductController.php | 69 +++++----- app/Controllers/Admin/SitepageController.php | 2 +- app/Controllers/Admin/UserController.php | 2 +- app/Controllers/Admin/UserSNSController.php | 2 +- app/Controllers/CommonController.php | 126 +++++++++--------- .../Front/Billing/BillingController.php | 4 +- .../Front/Billing/CardController.php | 16 --- app/Controllers/Front/BoardController.php | 8 +- app/Controllers/Front/FrontController.php | 8 +- app/Controllers/Front/OrderController.php | 11 +- app/Controllers/Front/ProductController.php | 8 +- app/Controllers/Front/SitepageController.php | 6 +- app/Controllers/Front/UserController.php | 4 +- app/Entities/ProductDeviceEntity.php | 19 +++ app/Entities/ProductEntity.php | 9 ++ app/Helpers/Product_helper.php | 2 +- app/Models/BaseHierarchyModel.php | 7 +- app/Models/BaseModel.php | 81 +++++------ app/Models/BillingModel.php | 4 +- app/Models/BoardModel.php | 4 +- app/Models/CategoryModel.php | 6 +- app/Models/DeviceModel.php | 22 +-- app/Models/OrderBillingModel.php | 4 +- app/Models/OrderModel.php | 4 +- app/Models/ProductDeviceModel.php | 32 +++-- app/Models/ProductModel.php | 4 +- app/Models/SitepageModel.php | 4 +- app/Models/UserModel.php | 4 +- app/Models/UserSNSModel.php | 4 +- app/Views/admin/board/index.php | 1 + app/Views/cells/product/beremetal.php | 24 ---- app/Views/cells/product/device.php | 23 ++++ app/Views/cells/product/virtual.php | 111 ++++----------- app/Views/cells/product/virtual_caculator.php | 87 ++++++++++++ 40 files changed, 396 insertions(+), 369 deletions(-) create mode 100644 app/Entities/ProductDeviceEntity.php delete mode 100644 app/Views/cells/product/beremetal.php create mode 100644 app/Views/cells/product/device.php create mode 100644 app/Views/cells/product/virtual_caculator.php diff --git a/app/Cells/ProductCell.php b/app/Cells/ProductCell.php index ddfcb56..b93e897 100644 --- a/app/Cells/ProductCell.php +++ b/app/Cells/ProductCell.php @@ -13,18 +13,10 @@ class ProductCell extends BaseCell return $this->_deviceModel = $this->_deviceModel ?: new DeviceModel(); } - public function virtual(array $cellDatas = []) - { - return view( - 'Views/cells/product/' . __FUNCTION__, - ['cellDatas' => $cellDatas] - ); - } - - public function beremetal(array $cellDatas = []) + public function device(array $cellDatas = []) { $cellDatas['device'] = []; - $cellDatas['device']['categorys'] = ['server', 'memory', 'disk']; + $cellDatas['device']['categorys'] = ['server', 'cpu', 'memory', 'disk', 'nic', 'publicip', 'os']; $cellDatas['device']['options'] = $this->getDeviceModel()->getOptions(); return view( 'Views/cells/product/' . __FUNCTION__, @@ -32,7 +24,7 @@ class ProductCell extends BaseCell ); } - public function beremetal_calulator(array $cellDatas = []): string + public function device_calulator(array $cellDatas = []): string { $cellDatas['device'] = []; $cellDatas['device']['categorys'] = ['server', 'cpu', 'memory', 'disk', 'nic', 'publicip', 'os']; diff --git a/app/Controllers/Admin/BillingController.php b/app/Controllers/Admin/BillingController.php index 9f733f9..0d7c71e 100644 --- a/app/Controllers/Admin/BillingController.php +++ b/app/Controllers/Admin/BillingController.php @@ -17,14 +17,13 @@ class BillingController extends AdminController public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) { parent::initController($request, $response, $logger); - $this->_model = new BillingModel(); + $this->initModel(new BillingModel()); $this->_viewDatas['className'] = 'Billing'; $this->_viewPath .= strtolower($this->_viewDatas['className']); $this->_viewDatas['title'] = lang($this->_viewDatas['className'] . '.title'); $this->_viewDatas['class_icon'] = CLASS_ICONS[strtoupper($this->_viewDatas['className'])]; helper($this->_viewDatas['className']); } - final protected function getOrderModel(): OrderModel { return $this->_orderModel = $this->_orderModel ?: new OrderModel(); @@ -78,7 +77,7 @@ class BillingController extends AdminController } //View 관련 - protected function view_process($entity) + protected function view_process($entity): BillingEntity { $entity = parent::view_process($entity); //청구서 연결 주문정보 가져오기 diff --git a/app/Controllers/Admin/BoardController.php b/app/Controllers/Admin/BoardController.php index 758bccf..5c97570 100644 --- a/app/Controllers/Admin/BoardController.php +++ b/app/Controllers/Admin/BoardController.php @@ -3,6 +3,7 @@ namespace App\Controllers\Admin; use App\Controllers\Trait\UpDownloadTrait; +use App\Entities\BoardEntity; use App\Models\BoardModel; use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\ResponseInterface; @@ -15,7 +16,7 @@ class BoardController extends AdminController public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) { parent::initController($request, $response, $logger); - $this->_model = new BoardModel(); + $this->initModel(new BoardModel()); $this->_viewDatas['className'] = 'Board'; $this->_viewPath .= strtolower($this->_viewDatas['className']);; $this->_viewDatas['title'] = lang($this->_viewDatas['className'] . '.title'); @@ -66,7 +67,7 @@ class BoardController extends AdminController private function build_notice() { - $entitys = $this->_model->getEntitys(['category' => $this->_category_notice, 'status' => DEFAULTS['STATUS']]); + $entitys = $this->getModel()->getEntitys(['category' => $this->_category_notice, 'status' => DEFAULTS['STATUS']]); $temps = array("