dbms_init...1

This commit is contained in:
최준흠 2025-05-07 15:57:41 +09:00
parent bbbdb92ccf
commit e00c030dd6
47 changed files with 2457 additions and 212 deletions

View File

@ -94,4 +94,97 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
$routes->get('download/(:alpha)', 'PointController::download/$1');
});
});
$routes->group('device', ['namespace' => 'App\Controllers\Admin\Device'], function ($routes) {
$routes->group('rack', ['namespace' => 'App\Controllers\Admin\Device'], function ($routes) {
$routes->get('/', 'RackController::index', []);
$routes->get('create', 'RackController::create_form');
$routes->post('create', 'RackController::create');
$routes->get('modify/(:num)', 'RackController::modify_form/$1');
$routes->post('modify/(:num)', 'RackController::modify/$1');
$routes->get('view/(:num)', 'RackController::view/$1');
$routes->get('delete/(:num)', 'RackController::delete/$1');
$routes->get('toggle/(:num)/(:any)', 'RackController::toggle/$1/$2');
$routes->post('batchjob', 'RackController::batchjob');
$routes->post('batchjob_delete', 'RackController::batchjob_delete');
$routes->get('download/(:alpha)', 'RackController::download/$1');
});
$routes->group('line', ['namespace' => 'App\Controllers\Admin\Dvice'], function ($routes) {
$routes->get('/', 'LineController::index', []);
$routes->get('create', 'LineController::create_form');
$routes->post('create', 'LineController::create');
$routes->get('modify/(:num)', 'LineController::modify_form/$1');
$routes->post('modify/(:num)', 'LineController::modify/$1');
$routes->get('view/(:num)', 'LineController::view/$1');
$routes->get('delete/(:num)', 'LineController::delete/$1');
$routes->get('toggle/(:num)/(:any)', 'LineController::toggle/$1/$2');
$routes->post('batchjob', 'LineController::batchjob');
$routes->post('batchjob_delete', 'LineController::batchjob_delete');
$routes->get('download/(:alpha)', 'LineController::download/$1');
});
$routes->group('ip', ['namespace' => 'App\Controllers\Admin\Device'], function ($routes) {
$routes->get('/', 'IpController::index', []);
$routes->get('create', 'IpController::create_form');
$routes->post('create', 'IpController::create');
$routes->get('modify/(:num)', 'IpController::modify_form/$1');
$routes->post('modify/(:num)', 'IpController::modify/$1');
$routes->get('view/(:num)', 'IpController::view/$1');
$routes->get('delete/(:num)', 'IpController::delete/$1');
$routes->get('toggle/(:num)/(:any)', 'IpController::toggle/$1/$2');
$routes->post('batchjob', 'IpController::batchjob');
$routes->post('batchjob_delete', 'IpController::batchjob_delete');
$routes->get('download/(:alpha)', 'IpController::download/$1');
});
$routes->group('network', ['namespace' => 'App\Controllers\Admin\Device'], function ($routes) {
$routes->get('/', 'NetworkController::index', []);
$routes->get('create', 'NetworkController::create_form');
$routes->post('create', 'NetworkController::create');
$routes->get('modify/(:num)', 'NetworkController::modify_form/$1');
$routes->post('modify/(:num)', 'NetworkController::modify/$1');
$routes->get('view/(:num)', 'NetworkController::view/$1');
$routes->get('delete/(:num)', 'NetworkController::delete/$1');
$routes->get('toggle/(:num)/(:any)', 'NetworkController::toggle/$1/$2');
$routes->post('batchjob', 'NetworkController::batchjob');
$routes->post('batchjob_delete', 'NetworkController::batchjob_delete');
$routes->get('download/(:alpha)', 'NetworkController::download/$1');
});
$routes->group('server', ['namespace' => 'App\Controllers\Admin\Device'], function ($routes) {
$routes->get('/', 'ServerController::index', []);
$routes->get('create', 'ServerController::create_form');
$routes->post('create', 'ServerController::create');
$routes->get('modify/(:num)', 'ServerController::modify_form/$1');
$routes->post('modify/(:num)', 'ServerController::modify/$1');
$routes->get('view/(:num)', 'ServerController::view/$1');
$routes->get('delete/(:num)', 'ServerController::delete/$1');
$routes->get('toggle/(:num)/(:any)', 'ServerController::toggle/$1/$2');
$routes->post('batchjob', 'ServerController::batchjob');
$routes->post('batchjob_delete', 'ServerController::batchjob_delete');
$routes->get('download/(:alpha)', 'ServerController::download/$1');
});
$routes->group('part', ['namespace' => 'App\Controllers\Admin\Device'], function ($routes) {
$routes->get('/', 'PartController::index', []);
$routes->get('create', 'PartController::create_form');
$routes->post('create', 'PartController::create');
$routes->get('modify/(:num)', 'PartController::modify_form/$1');
$routes->post('modify/(:num)', 'PartController::modify/$1');
$routes->get('view/(:num)', 'PartController::view/$1');
$routes->get('delete/(:num)', 'PartController::delete/$1');
$routes->get('toggle/(:num)/(:any)', 'PartController::toggle/$1/$2');
$routes->post('batchjob', 'PartController::batchjob');
$routes->post('batchjob_delete', 'PartController::batchjob_delete');
$routes->get('download/(:alpha)', 'PartController::download/$1');
});
$routes->group('software', ['namespace' => 'App\Controllers\Admin\Device'], function ($routes) {
$routes->get('/', 'SoftwareController::index', []);
$routes->get('create', 'SoftwareController::create_form');
$routes->post('create', 'SoftwareController::create');
$routes->get('modify/(:num)', 'SoftwareController::modify_form/$1');
$routes->post('modify/(:num)', 'SoftwareController::modify/$1');
$routes->get('view/(:num)', 'SoftwareController::view/$1');
$routes->get('delete/(:num)', 'SoftwareController::delete/$1');
$routes->get('toggle/(:num)/(:any)', 'SoftwareController::toggle/$1/$2');
$routes->post('batchjob', 'SoftwareController::batchjob');
$routes->post('batchjob_delete', 'SoftwareController::batchjob_delete');
$routes->get('download/(:alpha)', 'SoftwareController::download/$1');
});
});
});

View File

@ -10,20 +10,19 @@ use App\Services\Customer\ClientService;
abstract class CustomerController extends AdminController
{
private $_clientrService = null;
private $_clientService = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->uri_path .= 'customer/';
$this->uri_path .= "customer/";
// $this->view_path .= "customer" . DIRECTORY_SEPARATOR;
}
final public function getClientService(): ClientService
{
if (!$this->_clientrService) {
$this->_clientrService = new ClientService($this->request);
if (!$this->_clientService) {
$this->_clientService = new ClientService($this->request);
}
return $this->_clientrService;
return $this->_clientService;
}
//Index,FieldForm관련
protected function getFormFieldOption(string $field, array $options = []): array

View File

@ -0,0 +1,43 @@
<?php
namespace App\Controllers\Admin\Device;
use App\Controllers\Admin\AdminController;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Services\Device\ServerService;
abstract class DeviceController extends AdminController
{
private $_serverService = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->uri_path .= 'device/';
// $this->view_path .= "device" . DIRECTORY_SEPARATOR;
}
final public function getServerService(): ServerService
{
if (!$this->_serverService) {
$this->_serverService = new ServerService($this->request);
}
return $this->_serverService;
}
//Index,FieldForm관련
protected function getFormFieldOption(string $field, array $options = []): array
{
switch ($field) {
case 'serverinfo_uid':
$options[$field] = $this->getServerService()->getFormFieldOption($field);
// echo $this->getUserModel()->getLastQuery();
// dd($options);
break;
default:
$options = parent::getFormFieldOption($field, $options);
break;
}
return $options;
}
//Index,FieldForm관련
}

View File

@ -0,0 +1,52 @@
<?php
namespace App\Controllers\Admin\Device;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\Validation\Validation;
use Psr\Log\LoggerInterface;
use App\Helpers\Device\IpHelper;
use App\Services\Device\IpService;
class IpController extends DeviceController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->uri_path .= strtolower($this->getService()->getClassName()) . '/';
$this->class_path = $this->getService()->getClassPath();
$this->title = lang("{$this->getService()->getClassPath()}.title");
$this->helper = $this->getHelper();
}
public function getService(): IpService
{
if (!$this->_service) {
$this->_service = new IpService($this->request);
}
return $this->_service;
}
public function getHelper(): mixed
{
if (!$this->_helper) {
$this->_helper = new IpHelper($this->request);
}
return $this->_helper;
}
//Index,FieldForm관련
protected function setValidation(Validation $validation, string $action, string $field, ?string $rule = null): Validation
{
switch ($field) {
case 'role':
//아래 Rule Array는 필드명.* checkbox를 사용
$validation->setRule("{$field}.*", $field, $rule);
break;
default:
$validation = parent::setValidation($validation, $action, $field, $rule);
break;
}
return $validation;
}
//Index,FieldForm관련.
}

View File

@ -0,0 +1,52 @@
<?php
namespace App\Controllers\Admin\Device;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\Validation\Validation;
use Psr\Log\LoggerInterface;
use App\Helpers\Device\LineHelper;
use App\Services\Device\LineService;
class LineController extends DeviceController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->uri_path .= strtolower($this->getService()->getClassName()) . '/';
$this->class_path = $this->getService()->getClassPath();
$this->title = lang("{$this->getService()->getClassPath()}.title");
$this->helper = $this->getHelper();
}
public function getService(): LineService
{
if (!$this->_service) {
$this->_service = new LineService($this->request);
}
return $this->_service;
}
public function getHelper(): mixed
{
if (!$this->_helper) {
$this->_helper = new LineHelper($this->request);
}
return $this->_helper;
}
//Index,FieldForm관련
protected function setValidation(Validation $validation, string $action, string $field, ?string $rule = null): Validation
{
switch ($field) {
case 'role':
//아래 Rule Array는 필드명.* checkbox를 사용
$validation->setRule("{$field}.*", $field, $rule);
break;
default:
$validation = parent::setValidation($validation, $action, $field, $rule);
break;
}
return $validation;
}
//Index,FieldForm관련.
}

View File

@ -0,0 +1,52 @@
<?php
namespace App\Controllers\Admin\Device;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\Validation\Validation;
use Psr\Log\LoggerInterface;
use App\Helpers\Device\NetworkHelper;
use App\Services\Device\NetworkService;
class NetworkController extends DeviceController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->uri_path .= strtolower($this->getService()->getClassName()) . '/';
$this->class_path = $this->getService()->getClassPath();
$this->title = lang("{$this->getService()->getClassPath()}.title");
$this->helper = $this->getHelper();
}
public function getService(): NetworkService
{
if (!$this->_service) {
$this->_service = new NetworkService($this->request);
}
return $this->_service;
}
public function getHelper(): mixed
{
if (!$this->_helper) {
$this->_helper = new NetworkHelper($this->request);
}
return $this->_helper;
}
//Index,FieldForm관련
protected function setValidation(Validation $validation, string $action, string $field, ?string $rule = null): Validation
{
switch ($field) {
case 'role':
//아래 Rule Array는 필드명.* checkbox를 사용
$validation->setRule("{$field}.*", $field, $rule);
break;
default:
$validation = parent::setValidation($validation, $action, $field, $rule);
break;
}
return $validation;
}
//Index,FieldForm관련.
}

View File

@ -0,0 +1,52 @@
<?php
namespace App\Controllers\Admin\Device;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\Validation\Validation;
use Psr\Log\LoggerInterface;
use App\Helpers\Device\PartHelper;
use App\Services\Device\PartService;
class PartController extends DeviceController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->uri_path .= strtolower($this->getService()->getClassName()) . '/';
$this->class_path = $this->getService()->getClassPath();
$this->title = lang("{$this->getService()->getClassPath()}.title");
$this->helper = $this->getHelper();
}
public function getService(): PartService
{
if (!$this->_service) {
$this->_service = new PartService($this->request);
}
return $this->_service;
}
public function getHelper(): mixed
{
if (!$this->_helper) {
$this->_helper = new PartHelper($this->request);
}
return $this->_helper;
}
//Index,FieldForm관련
protected function setValidation(Validation $validation, string $action, string $field, ?string $rule = null): Validation
{
switch ($field) {
case 'role':
//아래 Rule Array는 필드명.* checkbox를 사용
$validation->setRule("{$field}.*", $field, $rule);
break;
default:
$validation = parent::setValidation($validation, $action, $field, $rule);
break;
}
return $validation;
}
//Index,FieldForm관련.
}

View File

@ -0,0 +1,52 @@
<?php
namespace App\Controllers\Admin\Device;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\Validation\Validation;
use Psr\Log\LoggerInterface;
use App\Helpers\Device\RackHelper;
use App\Services\Device\RackService;
class RackController extends DeviceController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->uri_path .= strtolower($this->getService()->getClassName()) . '/';
$this->class_path = $this->getService()->getClassPath();
$this->title = lang("{$this->getService()->getClassPath()}.title");
$this->helper = $this->getHelper();
}
public function getService(): RackService
{
if (!$this->_service) {
$this->_service = new RackService($this->request);
}
return $this->_service;
}
public function getHelper(): mixed
{
if (!$this->_helper) {
$this->_helper = new RackHelper($this->request);
}
return $this->_helper;
}
//Index,FieldForm관련
protected function setValidation(Validation $validation, string $action, string $field, ?string $rule = null): Validation
{
switch ($field) {
case 'role':
//아래 Rule Array는 필드명.* checkbox를 사용
$validation->setRule("{$field}.*", $field, $rule);
break;
default:
$validation = parent::setValidation($validation, $action, $field, $rule);
break;
}
return $validation;
}
//Index,FieldForm관련.
}

View File

@ -0,0 +1,52 @@
<?php
namespace App\Controllers\Admin\Device;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\Validation\Validation;
use Psr\Log\LoggerInterface;
use App\Helpers\Device\ServerHelper;
use App\Services\Device\ServerService;
class ServerController extends DeviceController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->uri_path .= strtolower($this->getService()->getClassName()) . '/';
$this->class_path = $this->getService()->getClassPath();
$this->title = lang("{$this->getService()->getClassPath()}.title");
$this->helper = $this->getHelper();
}
public function getService(): ServerService
{
if (!$this->_service) {
$this->_service = new ServerService($this->request);
}
return $this->_service;
}
public function getHelper(): mixed
{
if (!$this->_helper) {
$this->_helper = new ServerHelper($this->request);
}
return $this->_helper;
}
//Index,FieldForm관련
protected function setValidation(Validation $validation, string $action, string $field, ?string $rule = null): Validation
{
switch ($field) {
case 'role':
//아래 Rule Array는 필드명.* checkbox를 사용
$validation->setRule("{$field}.*", $field, $rule);
break;
default:
$validation = parent::setValidation($validation, $action, $field, $rule);
break;
}
return $validation;
}
//Index,FieldForm관련.
}

View File

@ -0,0 +1,52 @@
<?php
namespace App\Controllers\Admin\Device;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\Validation\Validation;
use Psr\Log\LoggerInterface;
use App\Helpers\Device\SoftwareHelper;
use App\Services\Device\SoftwareService;
class SoftwareController extends DeviceController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->uri_path .= strtolower($this->getService()->getClassName()) . '/';
$this->class_path = $this->getService()->getClassPath();
$this->title = lang("{$this->getService()->getClassPath()}.title");
$this->helper = $this->getHelper();
}
public function getService(): SoftwareService
{
if (!$this->_service) {
$this->_service = new SoftwareService($this->request);
}
return $this->_service;
}
public function getHelper(): mixed
{
if (!$this->_helper) {
$this->_helper = new SoftwareHelper($this->request);
}
return $this->_helper;
}
//Index,FieldForm관련
protected function setValidation(Validation $validation, string $action, string $field, ?string $rule = null): Validation
{
switch ($field) {
case 'role':
//아래 Rule Array는 필드명.* checkbox를 사용
$validation->setRule("{$field}.*", $field, $rule);
break;
default:
$validation = parent::setValidation($validation, $action, $field, $rule);
break;
}
return $validation;
}
//Index,FieldForm관련.
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,18 @@
<?php
namespace App\Entities\Device;
use App\Entities\CommonEntity;
abstract class DeviceEntity extends CommonEntity
{
public function __construct(array|null $data = null)
{
parent::__construct($data);
}
public function getServer()
{
return $this->attributes['serverinfo_uid'];
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace App\Entities\Device;
use App\Models\Device\IpModel;
class IpEntity extends DeviceEntity
{
const PK = IpModel::PK;
const TITLE = IpModel::TITLE;
public function getAmount()
{
return $this->attributes['amount'];
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace App\Entities\Device;
use App\Models\Device\LineModel;
class LineEntity extends DeviceEntity
{
const PK = LineModel::PK;
const TITLE = LineModel::TITLE;
public function getAmount()
{
return $this->attributes['amount'];
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace App\Entities\Device;
use App\Models\Device\NetworkModel;
class NetworkEntity extends DeviceEntity
{
const PK = NetworkModel::PK;
const TITLE = NetworkModel::TITLE;
public function getAmount()
{
return $this->attributes['amount'];
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace App\Entities\Device;
use App\Models\Device\PartModel;
class PartEntity extends DeviceEntity
{
const PK = PartModel::PK;
const TITLE = PartModel::TITLE;
public function getAmount()
{
return $this->attributes['amount'];
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace App\Entities\Device;
use App\Models\Device\RackModel;
class RackEntity extends DeviceEntity
{
const PK = RackModel::PK;
const TITLE = RackModel::TITLE;
public function getAmount()
{
return $this->attributes['amount'];
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace App\Entities\Device;
use App\Models\Device\ServerModel;
class ServerEntity extends DeviceEntity
{
const PK = ServerModel::PK;
const TITLE = ServerModel::TITLE;
public function getAmount()
{
return $this->attributes['amount'];
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace App\Entities\Device;
use App\Models\Device\SoftwareModel;
class SoftwareEntity extends DeviceEntity
{
const PK = SoftwareModel::PK;
const TITLE = SoftwareModel::TITLE;
public function getAmount()
{
return $this->attributes['amount'];
}
}

View File

@ -0,0 +1,42 @@
<?php
namespace App\Helpers\Device;
use App\Helpers\CommonHelper;
use CodeIgniter\HTTP\IncomingRequest;
class DeviceHelper extends CommonHelper
{
public function __construct(?IncomingRequest $request = null)
{
parent::__construct($request);
}
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
{
if (in_array($viewDatas['action'], ['create', 'modify'])) {
$extras = (strpos($viewDatas['field_rules'][$field], 'required') !== false) ? ["class" => "form-control", "required" => "", ...$extras] : ["class" => "form-control", ...$extras];
}
$value = $value ?: DEFAULTS['EMPTY'];
switch ($field) {
case "serverinfo_uid":
if (!is_array($viewDatas['field_options'][$field])) {
echo var_dump($viewDatas['field_options']);
exit;
}
$formOptions = array_merge(
["" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택'],
$viewDatas['field_options'][$field]
);
$form = form_dropdown($field, $formOptions, $value, $extras);
break;
default:
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
break;
}
return $form;
} //
public function getListRowColor(mixed $entity, string $field = 'status', string $value = 'in'): string
{
return $entity->isMatched($field, $value) ? "" : 'class="table-danger"';
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace App\Helpers\Device;
use App\Models\Device\IpModel;
use CodeIgniter\HTTP\IncomingRequest;
class IpHelper extends DeviceHelper
{
protected ?IncomingRequest $request = null;
public function __construct(?IncomingRequest $request = null)
{
parent::__construct($request);
$this->setTitleField(field: IpModel::TITLE);
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace App\Helpers\Device;
use App\Models\Device\LineModel;
use CodeIgniter\HTTP\IncomingRequest;
class LineHelper extends DeviceHelper
{
protected ?IncomingRequest $request = null;
public function __construct(?IncomingRequest $request = null)
{
parent::__construct($request);
$this->setTitleField(field: LineModel::TITLE);
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace App\Helpers\Device;
use App\Models\Device\NetworkModel;
use CodeIgniter\HTTP\IncomingRequest;
class NetworkHelper extends DeviceHelper
{
protected ?IncomingRequest $request = null;
public function __construct(?IncomingRequest $request = null)
{
parent::__construct($request);
$this->setTitleField(field: NetworkModel::TITLE);
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace App\Helpers\Device;
use App\Models\Device\PartModel;
use CodeIgniter\HTTP\IncomingRequest;
class PartHelper extends DeviceHelper
{
protected ?IncomingRequest $request = null;
public function __construct(?IncomingRequest $request = null)
{
parent::__construct($request);
$this->setTitleField(field: PartModel::TITLE);
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace App\Helpers\Device;
use App\Models\Device\RackModel;
use CodeIgniter\HTTP\IncomingRequest;
class RackHelper extends DeviceHelper
{
protected ?IncomingRequest $request = null;
public function __construct(?IncomingRequest $request = null)
{
parent::__construct($request);
$this->setTitleField(field: RackModel::TITLE);
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace App\Helpers\Device;
use App\Models\Device\ServerModel;
use CodeIgniter\HTTP\IncomingRequest;
class ServerHelper extends DeviceHelper
{
protected ?IncomingRequest $request = null;
public function __construct(?IncomingRequest $request = null)
{
parent::__construct($request);
$this->setTitleField(field: ServerModel::TITLE);
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace App\Helpers\Device;
use App\Models\Device\SoftwareModel;
use CodeIgniter\HTTP\IncomingRequest;
class SoftwareHelper extends DeviceHelper
{
protected ?IncomingRequest $request = null;
public function __construct(?IncomingRequest $request = null)
{
parent::__construct($request);
$this->setTitleField(field: SoftwareModel::TITLE);
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace App\Models\Device;
use App\Models\CommonModel;
abstract class DeviceModel extends CommonModel
{
protected function __construct()
{
parent::__construct();
}
}

View File

@ -0,0 +1,62 @@
<?php
namespace App\Models\Device;
use App\Entities\Device\IpEntity;
class IpModel extends DeviceModel
{
const TABLE = "ipinfo";
const PK = "uid";
const TITLE = "title";
protected $table = self::TABLE;
protected $primaryKey = self::PK;
protected $returnType = IpEntity::class;
protected $allowedFields = [
"clientinfo_uid",
"status",
"title",
"amount",
];
public function __construct()
{
parent::__construct();
}
public function getFilterFields(): array
{
return ["clientinfo_uid", 'status'];
}
public function getBatchJobFields(): array
{
return ['status'];
}
public function getFieldRule(string $action, string $field): string
{
if (is_array($field)) {
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
}
switch ($field) {
case "clientinfo_uid":
case "amount":
$rule = "required|number";
break;
case "title":
$rule = "required|trim|string";
break;
case "status":
$rule = "required|in_list[in,out]";
break;
default:
$rule = parent::getFieldRule($action, $field);
break;
}
return $rule;
}
//List 검색용
public function setList_WordFilter(string $word): void
{
$this->orLike(self::TABLE . "." . self::TITLE, $word, 'both');
$this->orLike(self::TABLE . '.alias', $word, 'both');
}
}

View File

@ -0,0 +1,62 @@
<?php
namespace App\Models\Device;
use App\Entities\Device\LineEntity;
class LineModel extends DeviceModel
{
const TABLE = "lineinfo";
const PK = "uid";
const TITLE = "title";
protected $table = self::TABLE;
protected $primaryKey = self::PK;
protected $returnType = LineEntity::class;
protected $allowedFields = [
"clientinfo_uid",
"status",
"title",
"amount",
];
public function __construct()
{
parent::__construct();
}
public function getFilterFields(): array
{
return ["clientinfo_uid", 'status'];
}
public function getBatchJobFields(): array
{
return ['status'];
}
public function getFieldRule(string $action, string $field): string
{
if (is_array($field)) {
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
}
switch ($field) {
case "clientinfo_uid":
case "amount":
$rule = "required|number";
break;
case "title":
$rule = "required|trim|string";
break;
case "status":
$rule = "required|in_list[in,out]";
break;
default:
$rule = parent::getFieldRule($action, $field);
break;
}
return $rule;
}
//List 검색용
public function setList_WordFilter(string $word): void
{
$this->orLike(self::TABLE . "." . self::TITLE, $word, 'both');
$this->orLike(self::TABLE . '.alias', $word, 'both');
}
}

View File

@ -0,0 +1,62 @@
<?php
namespace App\Models\Device;
use App\Entities\Device\NetworkEntity;
class NetworkModel extends DeviceModel
{
const TABLE = "networkinfo";
const PK = "uid";
const TITLE = "title";
protected $table = self::TABLE;
protected $primaryKey = self::PK;
protected $returnType = NetworkEntity::class;
protected $allowedFields = [
"clientinfo_uid",
"status",
"title",
"amount",
];
public function __construct()
{
parent::__construct();
}
public function getFilterFields(): array
{
return ["clientinfo_uid", 'status'];
}
public function getBatchJobFields(): array
{
return ['status'];
}
public function getFieldRule(string $action, string $field): string
{
if (is_array($field)) {
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
}
switch ($field) {
case "clientinfo_uid":
case "amount":
$rule = "required|number";
break;
case "title":
$rule = "required|trim|string";
break;
case "status":
$rule = "required|in_list[in,out]";
break;
default:
$rule = parent::getFieldRule($action, $field);
break;
}
return $rule;
}
//List 검색용
public function setList_WordFilter(string $word): void
{
$this->orLike(self::TABLE . "." . self::TITLE, $word, 'both');
$this->orLike(self::TABLE . '.alias', $word, 'both');
}
}

View File

@ -0,0 +1,62 @@
<?php
namespace App\Models\Device;
use App\Entities\Device\PartEntity;
class PartModel extends DeviceModel
{
const TABLE = "partinfo";
const PK = "uid";
const TITLE = "title";
protected $table = self::TABLE;
protected $primaryKey = self::PK;
protected $returnType = PartEntity::class;
protected $allowedFields = [
"clientinfo_uid",
"status",
"title",
"amount",
];
public function __construct()
{
parent::__construct();
}
public function getFilterFields(): array
{
return ["clientinfo_uid", 'status'];
}
public function getBatchJobFields(): array
{
return ['status'];
}
public function getFieldRule(string $action, string $field): string
{
if (is_array($field)) {
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
}
switch ($field) {
case "clientinfo_uid":
case "amount":
$rule = "required|number";
break;
case "title":
$rule = "required|trim|string";
break;
case "status":
$rule = "required|in_list[in,out]";
break;
default:
$rule = parent::getFieldRule($action, $field);
break;
}
return $rule;
}
//List 검색용
public function setList_WordFilter(string $word): void
{
$this->orLike(self::TABLE . "." . self::TITLE, $word, 'both');
$this->orLike(self::TABLE . '.alias', $word, 'both');
}
}

View File

@ -0,0 +1,62 @@
<?php
namespace App\Models\Device;
use App\Entities\Device\RackEntity;
class RackModel extends DeviceModel
{
const TABLE = "rackinfo";
const PK = "uid";
const TITLE = "title";
protected $table = self::TABLE;
protected $primaryKey = self::PK;
protected $returnType = RackEntity::class;
protected $allowedFields = [
"clientinfo_uid",
"status",
"title",
"amount",
];
public function __construct()
{
parent::__construct();
}
public function getFilterFields(): array
{
return ["clientinfo_uid", 'status'];
}
public function getBatchJobFields(): array
{
return ['status'];
}
public function getFieldRule(string $action, string $field): string
{
if (is_array($field)) {
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
}
switch ($field) {
case "clientinfo_uid":
case "amount":
$rule = "required|number";
break;
case "title":
$rule = "required|trim|string";
break;
case "status":
$rule = "required|in_list[in,out]";
break;
default:
$rule = parent::getFieldRule($action, $field);
break;
}
return $rule;
}
//List 검색용
public function setList_WordFilter(string $word): void
{
$this->orLike(self::TABLE . "." . self::TITLE, $word, 'both');
$this->orLike(self::TABLE . '.alias', $word, 'both');
}
}

View File

@ -0,0 +1,62 @@
<?php
namespace App\Models\Device;
use App\Entities\Device\ServerEntity;
class ServerModel extends DeviceModel
{
const TABLE = "serverinfo";
const PK = "uid";
const TITLE = "title";
protected $table = self::TABLE;
protected $primaryKey = self::PK;
protected $returnType = ServerEntity::class;
protected $allowedFields = [
"clientinfo_uid",
"status",
"title",
"amount",
];
public function __construct()
{
parent::__construct();
}
public function getFilterFields(): array
{
return ["clientinfo_uid", 'status'];
}
public function getBatchJobFields(): array
{
return ['status'];
}
public function getFieldRule(string $action, string $field): string
{
if (is_array($field)) {
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
}
switch ($field) {
case "clientinfo_uid":
case "amount":
$rule = "required|number";
break;
case "title":
$rule = "required|trim|string";
break;
case "status":
$rule = "required|in_list[in,out]";
break;
default:
$rule = parent::getFieldRule($action, $field);
break;
}
return $rule;
}
//List 검색용
public function setList_WordFilter(string $word): void
{
$this->orLike(self::TABLE . "." . self::TITLE, $word, 'both');
$this->orLike(self::TABLE . '.alias', $word, 'both');
}
}

View File

@ -0,0 +1,62 @@
<?php
namespace App\Models\Device;
use App\Entities\Device\SoftwareEntity;
class SoftwareModel extends DeviceModel
{
const TABLE = "serverinfo";
const PK = "uid";
const TITLE = "title";
protected $table = self::TABLE;
protected $primaryKey = self::PK;
protected $returnType = SoftwareEntity::class;
protected $allowedFields = [
"clientinfo_uid",
"status",
"title",
"amount",
];
public function __construct()
{
parent::__construct();
}
public function getFilterFields(): array
{
return ["clientinfo_uid", 'status'];
}
public function getBatchJobFields(): array
{
return ['status'];
}
public function getFieldRule(string $action, string $field): string
{
if (is_array($field)) {
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
}
switch ($field) {
case "clientinfo_uid":
case "amount":
$rule = "required|number";
break;
case "title":
$rule = "required|trim|string";
break;
case "status":
$rule = "required|in_list[in,out]";
break;
default:
$rule = parent::getFieldRule($action, $field);
break;
}
return $rule;
}
//List 검색용
public function setList_WordFilter(string $word): void
{
$this->orLike(self::TABLE . "." . self::TITLE, $word, 'both');
$this->orLike(self::TABLE . '.alias', $word, 'both');
}
}

View File

@ -20,7 +20,7 @@ abstract class CustomerService extends CommonService
}
public function getClassName(): string
{
return "Customer" . DIRECTORY_SEPARATOR;
return "Customer";
}
final public function getAccountService(): AccountService

View File

@ -0,0 +1,18 @@
<?php
namespace App\Services\Device;
use App\Services\CommonService;
use CodeIgniter\HTTP\IncomingRequest;
abstract class DeviceService extends CommonService
{
public function __construct(?IncomingRequest $request = null)
{
parent::__construct($request);
}
public function getClassName(): string
{
return "Device";
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Services\Device;
use App\Entities\Device\IpEntity;
use App\Models\Device\IpModel;
use CodeIgniter\HTTP\IncomingRequest;
class IpService extends DeviceService
{
protected ?IncomingRequest $request = null;
public function __construct(?IncomingRequest $request = null)
{
parent::__construct($request);
}
public function getClassName(): string
{
return parent::getClassName() . DIRECTORY_SEPARATOR . "Ip";
}
public function getModelClass(): IpModel
{
return new IpModel();
}
public function getEntityClass(): IpEntity
{
return new IpEntity();
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Services\Device;
use App\Entities\Device\LineEntity;
use App\Models\Device\LineModel;
use CodeIgniter\HTTP\IncomingRequest;
class LineService extends DeviceService
{
protected ?IncomingRequest $request = null;
public function __construct(?IncomingRequest $request = null)
{
parent::__construct($request);
}
public function getClassName(): string
{
return parent::getClassName() . DIRECTORY_SEPARATOR . "Line";
}
public function getModelClass(): LineModel
{
return new LineModel();
}
public function getEntityClass(): LineEntity
{
return new LineEntity();
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Services\Device;
use App\Entities\Device\NetworkEntity;
use App\Models\Device\NetworkModel;
use CodeIgniter\HTTP\IncomingRequest;
class NetworkService extends DeviceService
{
protected ?IncomingRequest $request = null;
public function __construct(?IncomingRequest $request = null)
{
parent::__construct($request);
}
public function getClassName(): string
{
return parent::getClassName() . DIRECTORY_SEPARATOR . "Network";
}
public function getModelClass(): NetworkModel
{
return new NetworkModel();
}
public function getEntityClass(): NetworkEntity
{
return new NetworkEntity();
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Services\Device;
use App\Entities\Device\PartEntity;
use App\Models\Device\PartModel;
use CodeIgniter\HTTP\IncomingRequest;
class PartService extends DeviceService
{
protected ?IncomingRequest $request = null;
public function __construct(?IncomingRequest $request = null)
{
parent::__construct($request);
}
public function getClassName(): string
{
return parent::getClassName() . DIRECTORY_SEPARATOR . "Part";
}
public function getModelClass(): PartModel
{
return new PartModel();
}
public function getEntityClass(): PartEntity
{
return new PartEntity();
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Services\Device;
use App\Entities\Device\RackEntity;
use App\Models\Device\RackModel;
use CodeIgniter\HTTP\IncomingRequest;
class RackService extends DeviceService
{
protected ?IncomingRequest $request = null;
public function __construct(?IncomingRequest $request = null)
{
parent::__construct($request);
}
public function getClassName(): string
{
return parent::getClassName() . DIRECTORY_SEPARATOR . "Rack";
}
public function getModelClass(): RackModel
{
return new RackModel();
}
public function getEntityClass(): RackEntity
{
return new RackEntity();
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Services\Device;
use App\Entities\Device\ServerEntity;
use App\Models\Device\ServerModel;
use CodeIgniter\HTTP\IncomingRequest;
class ServerService extends DeviceService
{
protected ?IncomingRequest $request = null;
public function __construct(?IncomingRequest $request = null)
{
parent::__construct($request);
}
public function getClassName(): string
{
return parent::getClassName() . DIRECTORY_SEPARATOR . "Server";
}
public function getModelClass(): ServerModel
{
return new ServerModel();
}
public function getEntityClass(): ServerEntity
{
return new ServerEntity();
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace App\Services\Device;
use App\Entities\Device\SoftwareEntity;
use App\Models\Device\SoftwareModel;
use CodeIgniter\HTTP\IncomingRequest;
class SoftwareService extends DeviceService
{
protected ?IncomingRequest $request = null;
public function __construct(?IncomingRequest $request = null)
{
parent::__construct($request);
}
public function getClassName(): string
{
return parent::getClassName() . DIRECTORY_SEPARATOR . "Software";
}
public function getModelClass(): SoftwareModel
{
return new SoftwareModel();
}
public function getEntityClass(): SoftwareEntity
{
return new SoftwareEntity();
}
}

View File

@ -4,7 +4,7 @@
aria-controls="flush-client"><b><?= ICONS['CLOUD'] ?> 고객관리 </b>
</button>
</h2>
<div id="flush-client" class="accordion-collapse collapse show" aria-labelledby="flush-client">
<div id="flush-client" class="accordion-collapse collapse" aria-labelledby="flush-client">
<div class="accordion-item">
<a href="/admin/customer/client"><?= ICONS['SIGNPOST'] ?>고객정보</a>
</div>

View File

@ -4,7 +4,7 @@
aria-controls="flush-device"><b><?= ICONS['SETUP'] ?> 장비관리 </b>
</button>
</h2>
<div id="flush-device" class="accordion-collapse collapse show" aria-labelledby="flush-device">
<div id="flush-device" class="accordion-collapse collapse" aria-labelledby="flush-device">
<div class="accordion-item">
<a href="/admin/device/rack"><?= ICONS['BOXS'] ?>상면정보</a>
</div>

View File

@ -1,13 +0,0 @@
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#flush-heading2" aria-expanded="false"
aria-controls="flush-heading2"><b>사이트관리</b></button>
</h2>
<div id="flush-heading2" class="accordion-collapse collapse show" aria-labelledby="flush-heading2">
<div class="accordion-item">
<a href="/admin/board"> 게시글 관리</a>
</div>
<div class="accordion-item">
<a href="/admin/sitepage"> SitePage 관리</a>
</div>
</div>