trafficmonitor init...2
This commit is contained in:
parent
2489c426e2
commit
b886f2dc30
@ -31,13 +31,6 @@ abstract class AdminController extends CommonController
|
||||
{
|
||||
parent::action_init_process($action);
|
||||
$this->addViewDatas('layout', $this->getLayout());
|
||||
$this->addViewDatas('helper', $this->service->getHelper($action, $this->getViewDatas()));
|
||||
$formFields = $this->service->getFormService()->getFormFields($action);
|
||||
$formFilters = $this->service->getFormService()->getFormFilters($action);
|
||||
$this->addViewDatas('formFields', $formFields);
|
||||
$this->addViewDatas('formFilters', $formFilters);
|
||||
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules($action, array_keys($formFields)));
|
||||
$this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions($action, $formFilters));
|
||||
}
|
||||
abstract protected function create_form_process(string $action): void;
|
||||
final public function create_form(): string
|
||||
@ -250,8 +243,6 @@ abstract class AdminController extends CommonController
|
||||
$this->addViewDatas('entities', $this->index_process());
|
||||
helper(['form']);
|
||||
$this->addViewDatas('formDatas', $this->request->getGet());
|
||||
$this->addViewDatas('index_batchjobFields', $this->service->getFormService()->getBatchjobFields($action));
|
||||
$this->addViewDatas('index_batchjobButtions', $this->service->getFormService()->getBatchjobButtons($action));
|
||||
} catch (\Exception $e) {
|
||||
session()->setFlashdata('message', $e->getMessage());
|
||||
}
|
||||
|
||||
@ -19,6 +19,35 @@ class CollectorController extends AdminController
|
||||
}
|
||||
$this->addActionPaths($this::PATH);
|
||||
}
|
||||
protected function action_init_process(string $action): void
|
||||
{
|
||||
$fields = ['trafficinfo_uid', 'in', 'out', 'raw_in', 'raw_out',];
|
||||
$filters = ['trafficinfo_uid'];
|
||||
parent::action_init_process($action);
|
||||
switch ($action) {
|
||||
case 'create':
|
||||
case 'create_form':
|
||||
case 'modify':
|
||||
case 'modify_form':
|
||||
break;
|
||||
case 'view':
|
||||
$fields = [...$fields, 'created_at'];
|
||||
break;
|
||||
case 'index':
|
||||
$fields = [...$fields, 'created_at'];
|
||||
$this->addViewDatas('index_batchjobFields', $this->service->getFormService()->getBatchjobFields($filters));
|
||||
$this->addViewDatas('index_batchjobButtions', $this->service->getFormService()->getBatchjobButtons());
|
||||
break;
|
||||
default:
|
||||
throw new \Exception("지원하지 않는 action입니다.({$action})");
|
||||
// break;
|
||||
}
|
||||
$this->addViewDatas('helper', $this->service->getHelper());
|
||||
$this->addViewDatas('formFields', $this->service->getFormService()->getFormFields($action, $fields));
|
||||
$this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters($action, $filters));
|
||||
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules($action, $fields));
|
||||
$this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions($action, $filters));
|
||||
}
|
||||
//Action작업관련
|
||||
protected function create_form_process(string $action): void
|
||||
{
|
||||
|
||||
@ -19,7 +19,35 @@ class MylogController extends AdminController
|
||||
}
|
||||
$this->addActionPaths($this::PATH);
|
||||
}
|
||||
|
||||
protected function action_init_process(string $action): void
|
||||
{
|
||||
$fields = ['title', 'content'];
|
||||
$filters = [];
|
||||
parent::action_init_process($action);
|
||||
switch ($action) {
|
||||
case 'create':
|
||||
case 'create_form':
|
||||
case 'modify':
|
||||
case 'modify_form':
|
||||
break;
|
||||
case 'view':
|
||||
$fields = [...$fields, 'created_at'];
|
||||
break;
|
||||
case 'index':
|
||||
$fields = [...$fields, 'created_at'];
|
||||
$this->addViewDatas('index_batchjobFields', $this->service->getFormService()->getBatchjobFields($filters));
|
||||
$this->addViewDatas('index_batchjobButtions', $this->service->getFormService()->getBatchjobButtons());
|
||||
break;
|
||||
default:
|
||||
throw new \Exception("지원하지 않는 action입니다.({$action})");
|
||||
// break;
|
||||
}
|
||||
$this->addViewDatas('helper', $this->service->getHelper());
|
||||
$this->addViewDatas('formFields', $this->service->getFormService()->getFormFields($action, $fields));
|
||||
$this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters($action, $filters));
|
||||
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules($action, $fields));
|
||||
$this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions($action, $filters));
|
||||
}
|
||||
//Action작업관련
|
||||
protected function create_form_process(string $action): void
|
||||
{
|
||||
|
||||
@ -19,6 +19,35 @@ class TrafficController extends AdminController
|
||||
}
|
||||
$this->addActionPaths($this::PATH);
|
||||
}
|
||||
protected function action_init_process(string $action): void
|
||||
{
|
||||
$fields = ['client', 'switch', 'ip', 'interface', 'status'];
|
||||
$filters = ['status'];
|
||||
parent::action_init_process($action);
|
||||
switch ($action) {
|
||||
case 'create':
|
||||
case 'create_form':
|
||||
case 'modify':
|
||||
case 'modify_form':
|
||||
break;
|
||||
case 'view':
|
||||
$fields = [...$fields, 'created_at'];
|
||||
break;
|
||||
case 'index':
|
||||
$fields = [...$fields, 'created_at'];
|
||||
$this->addViewDatas('index_batchjobFields', $this->service->getFormService()->getBatchjobFields($filters));
|
||||
$this->addViewDatas('index_batchjobButtions', $this->service->getFormService()->getBatchjobButtons());
|
||||
break;
|
||||
default:
|
||||
throw new \Exception("지원하지 않는 action입니다.({$action})");
|
||||
// break;
|
||||
}
|
||||
$this->addViewDatas('helper', $this->service->getHelper());
|
||||
$this->addViewDatas('formFields', $this->service->getFormService()->getFormFields($action, $fields));
|
||||
$this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters($action, $filters));
|
||||
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules($action, $fields));
|
||||
$this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions($action, $filters));
|
||||
}
|
||||
//Action작업관련
|
||||
protected function create_form_process(string $action): void
|
||||
{
|
||||
|
||||
@ -19,16 +19,45 @@ class UserController extends AdminController
|
||||
}
|
||||
$this->addActionPaths($this::PATH);
|
||||
}
|
||||
protected function getFormRule(string $action, string $field, string $rule): array
|
||||
protected function getFormRule_process(string $action, string $field, string $rule): array
|
||||
{
|
||||
switch ($field) {
|
||||
case 'role':
|
||||
$field = "{$field}.*";
|
||||
break;
|
||||
}
|
||||
return parent::getFormRule($action, $field, $rule);
|
||||
return parent::getFormRule_process($action, $field, $rule);
|
||||
}
|
||||
//Action작업관련
|
||||
protected function action_init_process(string $action): void
|
||||
{
|
||||
parent::action_init_process($action);
|
||||
$fields = ['id', 'passwd', 'confirmpassword', 'name', 'email', 'mobile', 'role'];
|
||||
$filters = ['role', 'status'];
|
||||
switch ($action) {
|
||||
case 'create':
|
||||
case 'create_form':
|
||||
case 'modify':
|
||||
case 'modify_form':
|
||||
break;
|
||||
case 'view':
|
||||
$fields = ['id', 'name', 'email', 'mobile', 'role', 'status', 'created_at'];
|
||||
break;
|
||||
case 'index':
|
||||
$fields = ['id', 'name', 'email', 'mobile', 'role', 'status', 'created_at'];
|
||||
$this->addViewDatas('index_batchjobFields', $this->service->getFormService()->getBatchjobFields($filters));
|
||||
$this->addViewDatas('index_batchjobButtions', $this->service->getFormService()->getBatchjobButtons());
|
||||
break;
|
||||
default:
|
||||
throw new \Exception("지원하지 않는 action입니다.({$action})");
|
||||
// break;
|
||||
}
|
||||
$this->addViewDatas('helper', $this->service->getHelper());
|
||||
$this->addViewDatas('formFields', $this->service->getFormService()->getFormFields($action, $fields));
|
||||
$this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters($action, $filters));
|
||||
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules($action, $fields));
|
||||
$this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions($action, $filters));
|
||||
}
|
||||
protected function create_form_process(string $action): void
|
||||
{
|
||||
//Form Default값 설정
|
||||
|
||||
@ -19,9 +19,6 @@ abstract class AuthController extends CommonController
|
||||
parent::initController($request, $response, $logger);
|
||||
$this->addActionPaths(self::PATH);
|
||||
}
|
||||
abstract protected function login_process(): UserEntity;
|
||||
abstract protected function logout_process(): void;
|
||||
|
||||
//로그인화면
|
||||
final public function login_form(): string|RedirectResponse
|
||||
{
|
||||
@ -36,6 +33,7 @@ abstract class AuthController extends CommonController
|
||||
return $this->action_render_process($this->getActionPaths(), $action, $this->getViewDatas());
|
||||
}
|
||||
//로그인처리
|
||||
abstract protected function login_process(): UserEntity;
|
||||
final public function login(): RedirectResponse
|
||||
{
|
||||
$action = __FUNCTION__;
|
||||
@ -55,6 +53,7 @@ abstract class AuthController extends CommonController
|
||||
}
|
||||
}
|
||||
//로그아웃
|
||||
abstract protected function logout_process(): void;
|
||||
final public function logout(): RedirectResponse
|
||||
{
|
||||
try {
|
||||
|
||||
@ -19,6 +19,25 @@ class GoogleController extends AuthController
|
||||
}
|
||||
$this->addActionPaths(self::PATH);
|
||||
}
|
||||
protected function action_init_process(string $action): void
|
||||
{
|
||||
parent::action_init_process($action);
|
||||
$fields = ['access_code'];
|
||||
$filters = [];
|
||||
switch ($action) {
|
||||
case 'login':
|
||||
case 'login_form':
|
||||
break;
|
||||
default:
|
||||
throw new \Exception("지원하지 않는 action입니다.({$action})");
|
||||
// break;
|
||||
}
|
||||
$this->addViewDatas('helper', $this->service->getHelper());
|
||||
$this->addViewDatas('formFields', $this->service->getFormService()->getFormFields($action, $fields));
|
||||
$this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters($action, $filters));
|
||||
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules($action, $fields));
|
||||
$this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions($action, $filters));
|
||||
}
|
||||
public function login_form_process(): void
|
||||
{
|
||||
//구글 로그인 BUTTON용
|
||||
|
||||
@ -24,6 +24,25 @@ class LocalController extends AuthController
|
||||
}
|
||||
$this->addActionPaths(self::PATH);
|
||||
}
|
||||
protected function action_init_process(string $action): void
|
||||
{
|
||||
parent::action_init_process($action);
|
||||
$fields = ['id', 'passwd'];
|
||||
$filters = [];
|
||||
switch ($action) {
|
||||
case 'login':
|
||||
case 'login_form':
|
||||
break;
|
||||
default:
|
||||
throw new \Exception("지원하지 않는 action입니다.({$action})");
|
||||
// break;
|
||||
}
|
||||
$this->addViewDatas('helper', $this->service->getHelper());
|
||||
$this->addViewDatas('formFields', $this->service->getFormService()->getFormFields($action, $fields));
|
||||
$this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters($action, $filters));
|
||||
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules($action, $fields));
|
||||
$this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions($action, $filters));
|
||||
}
|
||||
//로그인처리
|
||||
protected function login_process(): UserEntity
|
||||
{
|
||||
|
||||
@ -24,19 +24,19 @@ abstract class CommonController extends BaseController
|
||||
{
|
||||
return service('myauth')->getAuthContext();
|
||||
}
|
||||
final public function addActionPaths(string $path)
|
||||
final protected function addActionPaths(string $path)
|
||||
{
|
||||
$this->_action_paths[] = $path;
|
||||
}
|
||||
final public function getActionPaths($isArray = true, $delimeter = DIRECTORY_SEPARATOR): array|string
|
||||
final protected function getActionPaths($isArray = true, $delimeter = DIRECTORY_SEPARATOR): array|string
|
||||
{
|
||||
return $isArray ? $this->_action_paths : implode($delimeter, $this->_action_paths);
|
||||
}
|
||||
final public function addViewDatas(string $key, mixed $value)
|
||||
final protected function addViewDatas(string $key, mixed $value)
|
||||
{
|
||||
$this->_viewDatas[$key] = $value;
|
||||
}
|
||||
final public function getViewDatas(?string $key = null): mixed
|
||||
final protected function getViewDatas(?string $key = null): mixed
|
||||
{
|
||||
if ($key === null) {
|
||||
return $this->_viewDatas;
|
||||
@ -44,11 +44,12 @@ abstract class CommonController extends BaseController
|
||||
return $this->_viewDatas[$key] ?? null;
|
||||
}
|
||||
//공통 필수기능
|
||||
protected function doValidation(string $action): array
|
||||
final protected function doValidation(string $action): array
|
||||
{
|
||||
$dynamicRules = [];
|
||||
foreach ($this->service->getFormRules($action) as $field => $rule) {
|
||||
list($field, $rule) = $this->getFormRule($action, $field, $rule);
|
||||
//field별 추가 커스텀 룰 적용
|
||||
list($field, $rule) = $this->getFormRule_process($action, $field, $rule);
|
||||
$dynamicRules[$field] = $rule;
|
||||
}
|
||||
//변경할 값 확인 : Upload된 파일 검증시 $this->request->getPOST()보다 먼처 체크필요
|
||||
@ -60,7 +61,9 @@ abstract class CommonController extends BaseController
|
||||
}
|
||||
return $this->validator->getValidated();
|
||||
}
|
||||
protected function getFormRule(string $action, string $field, string $rule): array
|
||||
//필수함수
|
||||
//사용자정의 함수
|
||||
protected function getFormRule_process(string $action, string $field, string $rule): array
|
||||
{
|
||||
switch ($field) {
|
||||
default:
|
||||
|
||||
@ -11,18 +11,6 @@ class GoogleForm extends CommonForm
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function getFormFields(string $action, ?array $fields = null): array
|
||||
{
|
||||
return $fields ?? ["access_code"];
|
||||
}
|
||||
public function getFormFilters(string $action, ?array $fields = null): array
|
||||
{
|
||||
return $fields ?? [];
|
||||
}
|
||||
public function getBatchjobButtons(string $action = 'index', ?array $buttions = null): array
|
||||
{
|
||||
return $buttions ?? [];
|
||||
}
|
||||
public function getFormRule(string $action, string $field, array $rules = []): array
|
||||
{
|
||||
$rules = parent::getFormRule($action, $field, $rules);
|
||||
|
||||
@ -11,18 +11,6 @@ class LocalForm extends CommonForm
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function getFormFields(string $action, ?array $fields = null): array
|
||||
{
|
||||
return $fields ?? ["id", "passwd"];
|
||||
}
|
||||
public function getFormFilters(string $action, ?array $fields = null): array
|
||||
{
|
||||
return $fields ?? [];
|
||||
}
|
||||
public function getBatchjobButtons(string $action = 'index', ?array $buttions = null): array
|
||||
{
|
||||
return $buttions ?? [];
|
||||
}
|
||||
public function getFormRule(string $action, string $field, array $rules = []): array
|
||||
{
|
||||
$rules = parent::getFormRule($action, $field, $rules);
|
||||
|
||||
@ -11,60 +11,6 @@ class CollectorForm extends CommonForm
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function getFormFields(string $action, array $fields = []): array
|
||||
{
|
||||
switch ($action) {
|
||||
case 'create':
|
||||
case 'create_form':
|
||||
$fields = [
|
||||
...$fields,
|
||||
'trafficinfo_uid',
|
||||
'in',
|
||||
'out',
|
||||
'raw_in',
|
||||
'raw_out',
|
||||
];
|
||||
break;
|
||||
case 'modify':
|
||||
case 'modify_form':
|
||||
$fields = [
|
||||
...$fields,
|
||||
'trafficinfo_uid',
|
||||
'in',
|
||||
'out',
|
||||
'raw_in',
|
||||
'raw_out',
|
||||
];
|
||||
break;
|
||||
case 'view':
|
||||
$fields = [
|
||||
...$fields,
|
||||
'trafficinfo_uid',
|
||||
'in',
|
||||
'out',
|
||||
'raw_in',
|
||||
'raw_out',
|
||||
'created_at',
|
||||
];
|
||||
break;
|
||||
default:
|
||||
$fields = [
|
||||
...$fields,
|
||||
'trafficinfo_uid',
|
||||
'in',
|
||||
'out',
|
||||
'raw_in',
|
||||
'raw_out',
|
||||
'created_at',
|
||||
];
|
||||
break;
|
||||
}
|
||||
return parent::getFormFields($action, $fields);
|
||||
}
|
||||
public function getFormFilters(string $action, array $fields = []): array
|
||||
{
|
||||
return parent::getFormFilters($action, [...$fields, 'trafficinfo_uid']);
|
||||
}
|
||||
public function getFormRule(string $action, string $field, array $rules = []): array
|
||||
{
|
||||
switch ($field) {
|
||||
|
||||
@ -20,6 +20,17 @@ abstract class CommonForm
|
||||
}
|
||||
return $this->_attributes[$key];
|
||||
}
|
||||
final public function getFormFields(string $action, array $fields, $tempFormFields = []): array
|
||||
{
|
||||
foreach ($fields as $field) {
|
||||
$tempFormFields = $this->getFormField($action, $field, $tempFormFields);
|
||||
}
|
||||
return $tempFormFields;
|
||||
}
|
||||
final public function getFormFilters(string $action, array $fields = []): array
|
||||
{
|
||||
return $fields;
|
||||
}
|
||||
final public function getFormRules(string $action, array $fields, array $rules = []): array
|
||||
{
|
||||
foreach ($fields as $field) {
|
||||
@ -34,30 +45,27 @@ abstract class CommonForm
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
final public function getBatchjobFields(array $fields = []): array
|
||||
{
|
||||
return $fields;
|
||||
}
|
||||
final public function getBatchjobButtons(array $buttions = [
|
||||
'batchjob' => '일괄 처리',
|
||||
'batchjob_delete' => '일괄 삭제',
|
||||
]): array
|
||||
{
|
||||
return $buttions;
|
||||
}
|
||||
//필수함수
|
||||
public function getFormFields(string $action, array $fields = []): array
|
||||
//사용자정의 함수
|
||||
public function getFormField(string $action, string $field, array $tempFormFields = []): array
|
||||
{
|
||||
$temps = [];
|
||||
foreach ($fields as $field) {
|
||||
$temps[$field] = lang("{$this->getAttribute('class_path')}.label.{$field}");
|
||||
switch ($field) {
|
||||
default:
|
||||
$tempFormFields[$field] = lang("{$this->getAttribute('class_path')}.label.{$field}");
|
||||
break;
|
||||
}
|
||||
return $temps;
|
||||
}
|
||||
public function getFormFilters(string $action, array $fields = []): array
|
||||
{
|
||||
return $fields;
|
||||
}
|
||||
public function getBatchjobFields(string $action, array $fields = []): array
|
||||
{
|
||||
return $fields;
|
||||
}
|
||||
public function getBatchjobButtons(string $action, array $buttions = []): array
|
||||
{
|
||||
return [
|
||||
...$buttions,
|
||||
'batchjob' => '일괄 처리',
|
||||
'batchjob_delete' => '일괄 삭제',
|
||||
];
|
||||
return $tempFormFields;
|
||||
}
|
||||
public function getFormRule(string $action, string $field, array $rules = []): array
|
||||
{
|
||||
|
||||
@ -11,43 +11,6 @@ class MylogForm extends CommonForm
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function getFormFields(string $action, array $fields = []): array
|
||||
{
|
||||
switch ($action) {
|
||||
case 'create':
|
||||
case 'create_form':
|
||||
$fields = [
|
||||
...$fields,
|
||||
'title',
|
||||
'content',
|
||||
];
|
||||
break;
|
||||
case 'modify':
|
||||
case 'modify_form':
|
||||
$fields = [
|
||||
...$fields,
|
||||
'title',
|
||||
'content',
|
||||
];
|
||||
break;
|
||||
case 'view':
|
||||
$fields = [
|
||||
...$fields,
|
||||
'title',
|
||||
'content',
|
||||
'created_at',
|
||||
];
|
||||
break;
|
||||
default:
|
||||
$fields = [
|
||||
...$fields,
|
||||
'title',
|
||||
'created_at',
|
||||
];
|
||||
break;
|
||||
}
|
||||
return parent::getFormFields($action, $fields);
|
||||
}
|
||||
public function getFormRule(string $action, string $field, array $rules = []): array
|
||||
{
|
||||
switch ($field) {
|
||||
|
||||
@ -10,61 +10,6 @@ class TrafficForm extends CommonForm
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function getFormFields(string $action, array $fields = []): array
|
||||
{
|
||||
switch ($action) {
|
||||
case 'create':
|
||||
case 'create_form':
|
||||
$fields = [
|
||||
...$fields,
|
||||
'client',
|
||||
'switch',
|
||||
'ip',
|
||||
'interface',
|
||||
'status',
|
||||
];
|
||||
break;
|
||||
case 'modify':
|
||||
case 'modify_form':
|
||||
$fields = [
|
||||
...$fields,
|
||||
'client',
|
||||
'switch',
|
||||
'ip',
|
||||
'interface',
|
||||
'status',
|
||||
];
|
||||
break;
|
||||
case 'view':
|
||||
$fields = [
|
||||
...$fields,
|
||||
'client',
|
||||
'switch',
|
||||
'ip',
|
||||
'interface',
|
||||
'status',
|
||||
'created_at',
|
||||
];
|
||||
break;
|
||||
default:
|
||||
$fields = [
|
||||
...$fields,
|
||||
'client',
|
||||
'switch',
|
||||
'ip',
|
||||
'interface',
|
||||
'status',
|
||||
'created_at',
|
||||
];
|
||||
break;
|
||||
}
|
||||
return parent::getFormFields($action, $fields);
|
||||
}
|
||||
public function getFormFilters(string $action, array $fields = []): array
|
||||
{
|
||||
return parent::getFormFilters($action, [...$fields, 'status']);
|
||||
}
|
||||
public function getFormRule(string $action, string $field, array $rules = []): array
|
||||
{
|
||||
switch ($field) {
|
||||
|
||||
@ -11,68 +11,14 @@ class UserForm extends CommonForm
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function getFormFields(string $action, array $fields = []): array
|
||||
public function getFormField(string $action, string $field, array $tempFormFields = []): array
|
||||
{
|
||||
switch ($action) {
|
||||
case 'create':
|
||||
case 'create_form':
|
||||
$fields = [
|
||||
...$fields,
|
||||
'id',
|
||||
'passwd',
|
||||
'confirmpassword',
|
||||
'name',
|
||||
'email',
|
||||
'mobile',
|
||||
'role',
|
||||
];
|
||||
break;
|
||||
case 'modify':
|
||||
case 'modify_form':
|
||||
$fields = [
|
||||
...$fields,
|
||||
'id',
|
||||
'passwd',
|
||||
'confirmpassword',
|
||||
'name',
|
||||
'email',
|
||||
'mobile',
|
||||
'role',
|
||||
'status',
|
||||
];
|
||||
break;
|
||||
case 'view':
|
||||
$fields = [
|
||||
...$fields,
|
||||
'id',
|
||||
'name',
|
||||
'email',
|
||||
'mobile',
|
||||
'role',
|
||||
'status',
|
||||
];
|
||||
break;
|
||||
switch ($field) {
|
||||
default:
|
||||
$fields = [
|
||||
...$fields,
|
||||
'id',
|
||||
'name',
|
||||
'email',
|
||||
'mobile',
|
||||
'role',
|
||||
'status'
|
||||
];
|
||||
$tempFormFields = parent::getFormField($action, $field, $tempFormFields);
|
||||
break;
|
||||
}
|
||||
return parent::getFormFields($action, $fields);
|
||||
}
|
||||
public function getFormFilters(string $action, array $fields = []): array
|
||||
{
|
||||
return parent::getFormFilters($action, [...$fields, 'role', 'status']);
|
||||
}
|
||||
public function getBatchjobFields(string $action, array $fields = []): array
|
||||
{
|
||||
return parent::getBatchjobFields($action, [...$fields, 'status']);
|
||||
return $tempFormFields;
|
||||
}
|
||||
public function getFormRule(string $action, string $field, array $rules = []): array
|
||||
{
|
||||
|
||||
@ -105,6 +105,7 @@ abstract class AuthService
|
||||
public function login(AuthDTO $dto): UserEntity
|
||||
{
|
||||
$formDatas = (array)$dto;
|
||||
// dd($formDatas);
|
||||
//입력값 검증
|
||||
$validation = service('validation')->setRules($this->getValidationRules(__FUNCTION__));
|
||||
if (!$validation->run($formDatas)) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user