dbms_init...1

This commit is contained in:
최준흠 2025-05-28 19:00:28 +09:00
parent 4ad3a18494
commit 6a4d1fb792
7 changed files with 9919 additions and 290 deletions

View File

@ -2,21 +2,15 @@
namespace App\Controllers\Admin\Customer; namespace App\Controllers\Admin\Customer;
use App\Helpers\Customer\ServiceHelper;
use App\Services\Customer\ServiceService;
use App\Services\Equipment\IpService;
use App\Services\Equipment\LineService;
use App\Services\Equipment\ServerService;
use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface; use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use App\Helpers\Customer\ServiceHelper;
use App\Services\Customer\ServiceService;
class ServiceController extends CustomerController class ServiceController extends CustomerController
{ {
private ?LineService $_lineService = null;
private ?ServerService $_serverService = null;
private ?IpService $_ipService = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{ {
parent::initController($request, $response, $logger); parent::initController($request, $response, $logger);
@ -41,27 +35,6 @@ class ServiceController extends CustomerController
// dd($this->_helper); // dd($this->_helper);
return $this->_helper; return $this->_helper;
} }
final public function getLineService(): LineService
{
if (!$this->_lineService) {
$this->_lineService = new LineService();
}
return $this->_lineService;
}
final public function getServerService(): ServerService
{
if (!$this->_serverService) {
$this->_serverService = new ServerService();
}
return $this->_serverService;
}
final public function getIpService(): IpService
{
if (!$this->_ipService) {
$this->_ipService = new IpService();
}
return $this->_ipService;
}
//Index,FieldForm관련 //Index,FieldForm관련
// protected function create_process(): mixed // protected function create_process(): mixed
@ -74,7 +47,7 @@ class ServiceController extends CustomerController
protected function index_process(): array protected function index_process(): array
{ {
$fields = [ $fields = [
'fields' => ['clientinfo_uid', 'type', 'billing_at', 'rack', 'LINE', 'SERVER', 'IP', 'CPU', 'RAM', 'DISK', 'SOFTWARE', 'DEFENCE', 'start_at', 'status'], 'fields' => ['clientinfo_uid', 'item_type', 'billing_at', 'rack', 'LINE', 'SERVER', 'IP', 'CPU', 'RAM', 'DISK', 'SOFTWARE', 'DEFENCE', 'start_at', 'status'],
]; ];
$this->init('index', $fields); $this->init('index', $fields);
return parent::index_process(); return parent::index_process();

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@ return [
'label' => [ 'label' => [
'clientinfo_uid' => "고객명", 'clientinfo_uid' => "고객명",
'rack' => "Rack", 'rack' => "Rack",
'type' => "종류", 'item_type' => "종류",
'billing_at' => "청구일", 'billing_at' => "청구일",
'start_at' => "개통일", 'start_at' => "개통일",
'end_at' => "해지일", 'end_at' => "해지일",
@ -19,15 +19,23 @@ return [
'RAM' => "RAM", 'RAM' => "RAM",
'DISK' => "DISK", 'DISK' => "DISK",
'SOFTWARE' => "SOFTWARE", 'SOFTWARE' => "SOFTWARE",
'DEFENCE' => "방어", 'DEFENCE' => "방어(CS)",
'DOMAIN' => "도메인",
], ],
'DEFAULTS' => [ 'DEFAULTS' => [
'type' => "hosting", 'type' => "hosting",
'status' => 'default' 'status' => 'default'
], ],
"TYPE" => [ "ITEM_TYPE" => [
"hosting" => "서버호스팅", "LINE" => "회선",
"colocation" => "코로케이션", "IP" => "IP",
"SERVER" => "서버",
"CPU" => "CPU",
"RAM" => "RAM",
"DISK" => "DISK",
"DEFENCE" => "방어(CS)",
"SOFTWARE" => "소프트웨어",
"DOMAIN" => "도메인",
], ],
"STATUS" => [ "STATUS" => [
'default' => "사용중", 'default' => "사용중",

View File

@ -14,11 +14,9 @@ class ServiceModel extends CustomerModel
protected $returnType = ServiceEntity::class; protected $returnType = ServiceEntity::class;
protected $allowedFields = [ protected $allowedFields = [
"clientinfo_uid", "clientinfo_uid",
"rack", "item_type",
"type", "item_uid",
"billing_at", "title",
"start_at",
"end_at",
"status", "status",
"updated_at" "updated_at"
]; ];
@ -35,19 +33,10 @@ class ServiceModel extends CustomerModel
case "clientinfo_uid": case "clientinfo_uid":
$rule = "required|numeric"; $rule = "required|numeric";
break; break;
case "rack": case "item_type":
$rule = "required|trim|min_length[4]|max_length[20]"; case "status":
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
break;
case "type":
$rule = "required|trim|string"; $rule = "required|trim|string";
break; break;
case "billing_at":
case "start_at":
$rule = "required|valid_date";
break;
case "end_at":
$rule = "if_exist|valid_date";
default: default:
$rule = parent::getFieldRule($action, $field); $rule = parent::getFieldRule($action, $field);
break; break;

View File

@ -26,20 +26,18 @@ class ServiceService extends CustomerService
{ {
return [ return [
"clientinfo_uid", "clientinfo_uid",
"type", "item_type",
"rack", "item_uid",
"billing_at", "title",
"start_at",
"end_at",
"status", "status",
]; ];
} }
public function getFilterFields(): array public function getFilterFields(): array
{ {
return ["clientinfo_uid", 'type', 'status']; return ["clientinfo_uid", 'item_type', 'status'];
} }
public function getBatchJobFields(): array public function getBatchJobFields(): array
{ {
return ['type', 'status']; return ['item_type', 'status'];
} }
} }