dbms_init...1

This commit is contained in:
최준흠 2025-06-04 13:31:08 +09:00
parent 28d4639b45
commit 903160e124
35 changed files with 154 additions and 107 deletions

View File

@ -60,7 +60,7 @@ class DomainController extends EquipmentController
protected function index_process(): array
{
$fields = [
'fields' => ['domain', 'price', 'status'],
'fields' => ['clientinfo_uid', 'domain', 'status'],
];
$this->init('index', $fields);
return parent::index_process();
@ -72,7 +72,7 @@ class DomainController extends EquipmentController
// 현재 URL을 스택에 저장
$this->getMyAuth()->pushCurrentUrl($this->request->getUri()->getPath() . ($this->request->getUri()->getQuery() ? "?" . $this->request->getUri()->getQuery() : ""));
helper(['form']);
$this->init(__FUNCTION__, ['fields' => ['domain', 'price', 'status'],]);
$this->init(__FUNCTION__, ['fields' => ['clientinfo_uid', 'domain', 'price', 'status'],]);
$this->entities = parent::index_process();
return $this->getResultPageByActon($this->action);
} catch (\Exception $e) {

View File

@ -3,15 +3,41 @@
namespace App\Controllers\Admin\Equipment;
use App\Controllers\Admin\AdminController;
use App\Services\Customer\ClientService;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
abstract class EquipmentController extends AdminController
{
private ?ClientService $_clientService = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
}
final public function getClientService(): ClientService
{
if (!$this->_clientService) {
$this->_clientService = new ClientService($this->request);
}
return $this->_clientService;
}
//Index,FieldForm관련
protected function getFormFieldOption(string $field, array $options): array
{
switch ($field) {
case 'clientinfo_uid':
$temps = [];
foreach ($this->getClientService()->getEntities() as $entity) {
$temps[$entity->getPK()] = $entity->getTitle();
}
$options[$field] = $temps;
// dd($options);
break;
default:
$options = parent::getFormFieldOption($field, $options);
break;
}
return $options;
}
}

View File

@ -35,7 +35,7 @@ class CpuController extends PartController
return $this->_helper;
}
//Index,FieldForm관련
protected function setOrderByForList()
protected function setOrderByForList(): void
{
//OrderBy 처리
$this->getService()->getModel()->orderBy('model', 'ASC', false);
@ -44,7 +44,7 @@ class CpuController extends PartController
protected function index_process(): array
{
$fields = [
'fields' => ['model', 'price', 'status'],
'fields' => ['model', 'status'],
];
$this->init('index', $fields);
return parent::index_process();

View File

@ -36,7 +36,7 @@ class DefenceController extends PartController
}
//Index,FieldForm관련
protected function setOrderByForList()
protected function setOrderByForList(): void
{
//OrderBy 처리
$this->getService()->getModel()->orderBy('INET_ATON(ip)', 'ASC', false);
@ -46,7 +46,7 @@ class DefenceController extends PartController
protected function index_process(): array
{
$fields = [
'fields' => ['type', 'ip', 'price', 'accountid', 'domain', 'status'],
'fields' => ['type', 'ip', 'accountid', 'domain', 'status'],
];
$this->init('index', $fields);
return parent::index_process();

View File

@ -71,7 +71,7 @@ class IpController extends PartController
protected function index_process(): array
{
$fields = [
'fields' => ['lineinfo_uid', 'ip', 'price', 'status', 'updated_at', 'created_at'],
'fields' => ['lineinfo_uid', 'ip', 'status'],
];
$this->init('index', $fields);
return parent::index_process();

View File

@ -65,7 +65,7 @@ class LineController extends PartController
protected function view_process($uid): mixed
{
$fields = [
'fields' => ['clientinfo_uid', 'type', 'title', 'bandwith', 'price', 'status', "start_at", 'created_at'],
'fields' => ['clientinfo_uid', 'type', 'title', 'bandwith', 'status', "start_at"],
];
$this->init('view', $fields);
return parent::view_process($uid);
@ -74,7 +74,7 @@ class LineController extends PartController
protected function index_process(): array
{
$fields = [
'fields' => ['clientinfo_uid', 'type', 'title', 'bandwith', 'price', 'status', "start_at", 'created_at'],
'fields' => ['clientinfo_uid', 'type', 'title', 'bandwith', 'status', "start_at"],
];
$this->init('index', $fields);
return parent::index_process();

View File

@ -8,23 +8,12 @@ use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Services\Customer\ClientService;
abstract class PartController extends EquipmentController
{
private ?ClientService $_clientService = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
}
final public function getClientService(): ClientService
{
if (!$this->_clientService) {
$this->_clientService = new ClientService($this->request);
}
return $this->_clientService;
}
protected function getFormFieldOption(string $field, array $options): array
{
switch ($field) {

View File

@ -35,7 +35,7 @@ class RamController extends PartController
return $this->_helper;
}
//Index,FieldForm관련
protected function setOrderByForList()
protected function setOrderByForList(): void
{
//OrderBy 처리
$this->getService()->getModel()->orderBy('model', 'ASC', false);
@ -44,7 +44,7 @@ class RamController extends PartController
protected function index_process(): array
{
$fields = [
'fields' => ['model', 'price', 'status'],
'fields' => ['model', 'status'],
];
$this->init('index', $fields);
return parent::index_process();

View File

@ -36,10 +36,16 @@ class SoftwareController extends PartController
return $this->_helper;
}
//Index,FieldForm관련
protected function setOrderByForList(): void
{
//OrderBy 처리
$this->getService()->getModel()->orderBy('model', 'ASC', false);
parent::setOrderByForList();
}
protected function index_process(): array
{
$fields = [
'fields' => ['type', 'model', 'price', 'status', 'description'],
'fields' => ['type', 'model', 'status'],
];
$this->init('index', $fields);
return parent::index_process();

View File

@ -35,7 +35,7 @@ class StorageController extends PartController
return $this->_helper;
}
//Index,FieldForm관련
protected function setOrderByForList()
protected function setOrderByForList(): void
{
//OrderBy 처리
$this->getService()->getModel()->orderBy('model', 'ASC', false);
@ -44,7 +44,7 @@ class StorageController extends PartController
protected function index_process(): array
{
$fields = [
'fields' => ['model', 'price', 'status'],
'fields' => ['model', 'status'],
];
$this->init('index', $fields);
return parent::index_process();

View File

@ -34,12 +34,17 @@ class ServerController extends EquipmentController
}
return $this->_helper;
}
//Index,FieldForm관련
protected function setOrderByForList(): void
{
//OrderBy 처리
$this->getService()->getModel()->orderBy('model', 'ASC', false);
parent::setOrderByForList();
}
protected function index_process(): array
{
$fields = [
'fields' => ['model', 'price', 'status', 'created_at'],
'fields' => ['clientinfo_uid', 'model', 'status'],
];
$this->init('index', $fields);
// $this->modal_type = 'modal_fetch_v2'; //기본은 modal_iframe임

File diff suppressed because one or more lines are too long

View File

@ -4,13 +4,13 @@
"settings": {
"width": 3000,
"height": 3000,
"scrollTop": -665.0987,
"scrollLeft": -549,
"zoomLevel": 0.79,
"scrollTop": -895.2786,
"scrollLeft": -1742,
"zoomLevel": 0.76,
"show": 511,
"database": 4,
"databaseName": "",
"canvasType": "ERD",
"canvasType": "@dineug/erd-editor/builtin-schema-sql",
"language": 1,
"tableNameCase": 4,
"columnNameCase": 2,
@ -64,7 +64,8 @@
"6Gx9n7rUrSbXGbvE39xnm",
"anhMCXytE7rcE_drKBPWz",
"Wma86GpS3BhikEaHSamgX",
"1rYupb5yiEWocrmmCxTAV"
"1rYupb5yiEWocrmmCxTAV",
"I80TuGxKm3tXIO_EO2PSm"
],
"indexIds": [],
"memoIds": []
@ -208,7 +209,6 @@
"F9EPb6nsDx6Tf3GG8rvP1",
"TA8YG5vV7QmJxAXVpP8Tc",
"9F6QpQqxeEggZ0FHM81O1",
"C_yfBNgyfir7swSSCwZIF",
"54iuIW4knok06vP4JH-oN",
"bh-W1plz0vCW2rURDnfDR",
"hmZlcR-Pw2C_ife1zzo5o",
@ -254,7 +254,7 @@
"color": ""
},
"meta": {
"updateAt": 1748855802973,
"updateAt": 1749008061426,
"createAt": 1745819764137
}
},
@ -266,7 +266,6 @@
"2HB01q46-mugMjuOz85YG",
"4acJag7ORjUzX7FP-gnhZ",
"1q8jG5dQKdD35_XYimkSk",
"lwe5PLEmpyTipKEVSCHRJ",
"P84ZMnZu1nZtRhDY18T5o",
"VycsOgeM1SXkcq_5XYUMS",
"k4vpMNZ75fNUjX-hrjXzs",
@ -294,7 +293,7 @@
"color": ""
},
"meta": {
"updateAt": 1748826323861,
"updateAt": 1749008110893,
"createAt": 1745819764138
}
},
@ -308,7 +307,6 @@
"oc5quhO8E3mqrBZKbIy_G",
"lZQAY89JoyOHoTQEHeS1Y",
"fiQBfXvw-4tj42PuGiDAk",
"bkFCshlGApXD4wNeEKiJp",
"PHhRG4nKR6k_CQF9B8xS1",
"wb9_XvPZHAOrpH-s0B0YN",
"ltPYBs_iNuZJM6wTnK0H-",
@ -343,7 +341,7 @@
"color": ""
},
"meta": {
"updateAt": 1748510670069,
"updateAt": 1749008043378,
"createAt": 1745819764138
}
},
@ -355,7 +353,6 @@
"Id0h8QbOdlhPj9P1zTm5o",
"f7_MGvRjkwL1xkCWrAgDR",
"6qd6rcTkraI_AbHcVbp6T",
"2-mxsDaVU45SAAkg_CmAZ",
"nDoaVrEhO8hLuHbgZV4il",
"Vm1-FnoJLcJ0GRnTp0vnn",
"R-UjmO-S2UeQdddVNwH5M"
@ -385,7 +382,7 @@
"color": ""
},
"meta": {
"updateAt": 1748508767804,
"updateAt": 1749008087739,
"createAt": 1745819764138
}
},
@ -522,7 +519,6 @@
"columnIds": [
"Jh6e_-9QYe1Tqve0PE3kT",
"DC7TvFFpBT7vY0UKKHt-W",
"AdK-ftiebHNTIjlPzqGxQ",
"SS4ajcFiKSKICjz18GbiR",
"3nwgqrQd_qDGdg6Fe3kEp",
"mwVYv9PaJFpoxYvTRJ223"
@ -557,7 +553,7 @@
"color": ""
},
"meta": {
"updateAt": 1748508786381,
"updateAt": 1749007994136,
"createAt": 1746783410914
}
},
@ -569,7 +565,6 @@
"zBz4vBOZSIA8vKmfqXckO",
"YqInlreLnga0pOXtaP8GF",
"ixoWg1kPLrUYL069d75Kq",
"tTTzHZFvoMJ0RzAexXY2L",
"BvHyGw9Xf_gz7bEkZhLbk",
"0STHSEXiceoCa6a7jGXV5",
"j2hkudsfMKexNL6P7SM8R",
@ -601,7 +596,7 @@
"color": ""
},
"meta": {
"updateAt": 1748826229846,
"updateAt": 1749008115517,
"createAt": 1747374666215
}
},
@ -612,7 +607,6 @@
"columnIds": [
"203b3hUKUQ_Gu5wKShBgZ",
"kohhWoNuei3x97SzgQUF4",
"Tuyrnk-V3RykdGluC-86m",
"SzD5tmOIoZodU1wBH56I4",
"EEerVyCwkEAuiRc-gon8s",
"uki_QcviBOFJ57v1IbbPX"
@ -638,7 +632,7 @@
"color": ""
},
"meta": {
"updateAt": 1748508788150,
"updateAt": 1749007999752,
"createAt": 1747808112554
}
},
@ -649,7 +643,6 @@
"columnIds": [
"WaCB3uNZYFReAPiBqQ97v",
"tn-GhYT445kEh1tzf8Lf1",
"vzqaqaPuF4guI7nUCRFIE",
"FOr_RCEoaL3a0M7smSYRC",
"cMe_lKgwfS-LNTHhHIYrk",
"ixmBlLhmVt4et6tZEwLPC"
@ -672,7 +665,7 @@
"color": ""
},
"meta": {
"updateAt": 1748847303457,
"updateAt": 1749008012233,
"createAt": 1747808548333
}
},
@ -682,9 +675,8 @@
"comment": "도메인 정보",
"columnIds": [
"XnNj7H0bnTxo_NuZm7BOs",
"U3pGwK2LVZA4wQ1xa6EcF",
"w404_rDrrYyt26iqY8Eur",
"yqa1YWYVe9ZH-gXAdHtFU",
"EcVzL-sPHB3OIUYfPrAs6",
"E8iokQ-rKyw43cNe746kt",
"SeMtkfNiltpn4j-M-XkG-",
"6T7sNUPqpTPJm6TI7Qbbe"
@ -693,6 +685,7 @@
"XnNj7H0bnTxo_NuZm7BOs",
"skdAqnMsTEE6ZKbCD14VX",
"rK1V9ccYa0gxVE2W98dGH",
"U3pGwK2LVZA4wQ1xa6EcF",
"w404_rDrrYyt26iqY8Eur",
"gHKfQQEPUr_YKqvm5K_gd",
"ftF3nsGwio93Yhy60Pn99",
@ -715,7 +708,7 @@
"color": ""
},
"meta": {
"updateAt": 1748938285017,
"updateAt": 1749008231523,
"createAt": 1748218895681
}
},
@ -6473,6 +6466,26 @@
"updateAt": 1748856654152,
"createAt": 1748856612028
}
},
"U3pGwK2LVZA4wQ1xa6EcF": {
"id": "U3pGwK2LVZA4wQ1xa6EcF",
"tableId": "GRBrbb1hqwKSRMfod3I7U",
"name": "clientinfo_uid",
"comment": "",
"dataType": "INT",
"default": "",
"options": 0,
"ui": {
"keys": 2,
"widthName": 73,
"widthComment": 60,
"widthDataType": 60,
"widthDefault": 60
},
"meta": {
"updateAt": 1749009006732,
"createAt": 1749008230147
}
}
},
"relationshipEntities": {
@ -6487,7 +6500,7 @@
"_AcWUYKzNJd-V0fRHq8Cx"
],
"x": 2146.2084,
"y": 757.4081333333332,
"y": 744.0748,
"direction": 2
},
"end": {
@ -6543,7 +6556,7 @@
"_AcWUYKzNJd-V0fRHq8Cx"
],
"x": 2146.2084,
"y": 970.7414666666665,
"y": 904.0748,
"direction": 2
},
"end": {
@ -6571,7 +6584,7 @@
"_AcWUYKzNJd-V0fRHq8Cx"
],
"x": 2146.2084,
"y": 864.0747999999999,
"y": 824.0748,
"direction": 2
},
"end": {
@ -6599,7 +6612,7 @@
"7B0zaLoZnOoMNW8OHZlrQ"
],
"x": 938.42,
"y": 1606.0408,
"y": 1594.0408,
"direction": 1
},
"end": {
@ -6608,7 +6621,7 @@
"f7_MGvRjkwL1xkCWrAgDR"
],
"x": 655.5581999999999,
"y": 1924.2726,
"y": 1912.2726,
"direction": 2
},
"meta": {
@ -6636,7 +6649,7 @@
"Z2KizkUFrIaV_R_Quv4Ho"
],
"x": 1454.42,
"y": 1606.0408,
"y": 1594.0408,
"direction": 2
},
"meta": {
@ -6811,6 +6824,34 @@
"updateAt": 1748508421471,
"createAt": 1748508421471
}
},
"I80TuGxKm3tXIO_EO2PSm": {
"id": "I80TuGxKm3tXIO_EO2PSm",
"identification": false,
"relationshipType": 16,
"startRelationshipType": 1,
"start": {
"tableId": "6ajvOCaGuXU9pzV0Y9jEi",
"columnIds": [
"_AcWUYKzNJd-V0fRHq8Cx"
],
"x": 2146.2084,
"y": 984.0748,
"direction": 2
},
"end": {
"tableId": "GRBrbb1hqwKSRMfod3I7U",
"columnIds": [
"U3pGwK2LVZA4wQ1xa6EcF"
],
"x": 2396.448,
"y": 1119.4062,
"direction": 1
},
"meta": {
"updateAt": 1749008230148,
"createAt": 1749008230148
}
}
},
"indexEntities": {},

View File

@ -10,8 +10,4 @@ abstract class EquipmentEntity extends CommonEntity
{
parent::__construct($data);
}
final public function getPrice(): int
{
return intval($this->attributes['price']);
}
}

View File

@ -2,7 +2,7 @@
return [
'title' => "Domain정보",
'label' => [
'clientinfo_uid' => "고객",
'clientinfo_uid' => "고객",
'domain' => "도메인",
'expired_at' => "종료일",
'price' => "금액",

View File

@ -2,6 +2,7 @@
return [
'title' => "서버장비정보",
'label' => [
'clientinfo_uid' => "고객명",
'model' => "모델",
'price' => "금액",
'description' => "설명",

View File

@ -13,8 +13,8 @@ class DomainModel extends EquipmentModel
protected $primaryKey = self::PK;
protected $returnType = DomainEntity::class;
protected $allowedFields = [
'clientinfo_uid',
"domain",
"price",
"status",
"updated_at"
];
@ -28,6 +28,9 @@ class DomainModel extends EquipmentModel
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
}
switch ($field) {
case "clientinfo_uid":
$rule = "if_exist|numeric";
break;
case "price":
$rule = "required|numeric";
break;

View File

@ -14,7 +14,6 @@ class CpuModel extends PartModel
protected $returnType = CpuEntity::class;
protected $allowedFields = [
"model",
"price",
"status",
"updated_at"
];

View File

@ -15,7 +15,6 @@ class DefenceModel extends PartModel
protected $allowedFields = [
"type",
"ip",
"price",
"accountid",
"domain",
"description",

View File

@ -15,7 +15,6 @@ class IpModel extends PartModel
protected $allowedFields = [
"lineinfo_uid",
"ip",
"price",
"status",
"updated_at"
];

View File

@ -17,7 +17,6 @@ class LineModel extends PartModel
"type",
"title",
"bandwith",
"price",
"status",
"start_at",
"updated_at"

View File

@ -15,7 +15,6 @@ class RamModel extends PartModel
protected $allowedFields = [
"model",
"price",
"status",
"updated_at"
];

View File

@ -15,7 +15,6 @@ class SoftwareModel extends PartModel
protected $allowedFields = [
"type",
"model",
"price",
"status",
"description",
"updated_at"

View File

@ -14,7 +14,6 @@ class StorageModel extends PartModel
protected $returnType = StorageEntity::class;
protected $allowedFields = [
"model",
"price",
"status",
"updated_at"
];

View File

@ -13,8 +13,8 @@ class ServerModel extends EquipmentModel
protected $primaryKey = self::PK;
protected $returnType = ServerEntity::class;
protected $allowedFields = [
'clientinfo_uid',
"model",
"price",
"description",
"status",
"updated_at"
@ -29,6 +29,9 @@ class ServerModel extends EquipmentModel
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
}
switch ($field) {
case "clientinfo_uid":
$rule = "if_exist|numeric";
break;
case "model":
$rule = "required|trim|string";
break;

View File

@ -25,14 +25,14 @@ class DomainService extends EquipmentService
public function getFields(): array
{
return [
"clientinfo_uid",
"domain",
"price",
"status",
];
}
public function getFilterFields(): array
{
return ['status',];
return ["clientinfo_uid", 'status',];
}
public function getBatchJobFields(): array
{

View File

@ -26,7 +26,6 @@ class CpuService extends PartService
{
return [
"model",
"price",
"status",
];
}

View File

@ -27,7 +27,6 @@ class DefenceService extends PartService
return [
"type",
"ip",
"price",
"accountid",
"domain",
"status",

View File

@ -28,7 +28,6 @@ class IpService extends PartService
return [
"lineinfo_uid",
"ip",
"price",
"status",
];
}

View File

@ -29,7 +29,6 @@ class LineService extends PartService
"type",
"title",
"bandwith",
"price",
"start_at",
"status",
];

View File

@ -26,7 +26,6 @@ class RamService extends PartService
{
return [
"model",
"price",
"status",
];
}

View File

@ -27,7 +27,6 @@ class SoftwareService extends PartService
return [
"type",
"model",
"price",
"status",
"description",
];

View File

@ -26,7 +26,6 @@ class StorageService extends PartService
{
return [
"model",
"price",
"status",
];
}

View File

@ -26,15 +26,15 @@ class ServerService extends EquipmentService
public function getFields(): array
{
return [
"clientinfo_uid",
"model",
"price",
"status",
"description",
];
}
public function getFilterFields(): array
{
return ['model', 'status'];
return ["clientinfo_uid", 'model', 'status'];
}
public function getBatchJobFields(): array
{

View File

@ -49,7 +49,6 @@
</table>
<?= $this->include("templates/{$viewDatas['layout']}/index_content_bottom"); ?>
<?= form_close() ?>
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div>
</div>
<div class="index_bottom"><?= $this->include("templates/common/" . (isset($viewDatas['modal_type']) ? $viewDatas['modal_type'] : 'modal_iframe')); ?></div>
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>/index.js"></script>