daemon-idc init
This commit is contained in:
parent
5328c4f744
commit
86e82321a1
@ -6,6 +6,7 @@ use App\Entities\BoardEntity;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use RuntimeException;
|
||||
|
||||
class BoardController extends AdminController
|
||||
{
|
||||
@ -28,6 +29,10 @@ class BoardController extends AdminController
|
||||
public function reqeusttask(): ResponseInterface
|
||||
{
|
||||
$this->action_init_process(__FUNCTION__);
|
||||
return $this->response->setJSON($this->service->getRequestTaskCount($this->getAuthContext()->getUID()));
|
||||
$auth_uid = $this->getAuthContext()->getUID();
|
||||
if ($auth_uid === null) {
|
||||
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생:로그인을 하지 않으셨습니다.");
|
||||
}
|
||||
return $this->response->setJSON($this->service->getRequestTaskCount($auth_uid));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,9 +2,10 @@
|
||||
|
||||
namespace App\Controllers\Admin;
|
||||
|
||||
use RuntimeException;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class Welcome extends AdminController
|
||||
{
|
||||
@ -32,7 +33,11 @@ class Welcome extends AdminController
|
||||
$action = __FUNCTION__;
|
||||
$this->action_init_process($action);
|
||||
//요청업무
|
||||
$this->addViewDatas('boardRequestTaskCount', service('boardservice')->getRequestTaskCount($this->getAuthContext()->getUID()));
|
||||
$auth_uid = $this->getAuthContext()->getUID();
|
||||
if ($auth_uid === null) {
|
||||
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생:로그인을 하지 않으셨습니다.");
|
||||
}
|
||||
$this->addViewDatas('boardRequestTaskCount', service('boardservice')->getRequestTaskCount($auth_uid));
|
||||
//Total 서버 현황
|
||||
//interval을 기준으로 최근 신규 서비스정보 가져오기
|
||||
// $interval = intval($this->request->getVar('interval') ?? 7);
|
||||
|
||||
@ -38,15 +38,9 @@ class AuthContext
|
||||
// Public Accessors (AuthService에서 이동)
|
||||
// ----------------------------------------------------
|
||||
|
||||
public function getUID(): int
|
||||
public function getUID(): int|null
|
||||
{
|
||||
$uid = $this->getAuthInfo('uid');
|
||||
|
||||
if ($uid === null || $uid === '') {
|
||||
throw new \RuntimeException('Not logged in');
|
||||
}
|
||||
|
||||
return (int) $uid;
|
||||
return $this->getAuthInfo('uid');
|
||||
}
|
||||
|
||||
public function getID(): string|null
|
||||
|
||||
@ -286,7 +286,7 @@ abstract class CommonService
|
||||
final public function create(array $formDatas): CommonEntity
|
||||
{
|
||||
return $this->dbTransaction(function () use ($formDatas) {
|
||||
$formDatas['user_uid'] = (int) $this->getAuthContext()->getUID();
|
||||
$formDatas['user_uid'] = $this->getAuthContext()->getUID();
|
||||
return $this->create_process($formDatas);
|
||||
}, __FUNCTION__);
|
||||
}
|
||||
@ -332,7 +332,7 @@ abstract class CommonService
|
||||
if (!$entity) {
|
||||
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: {$uid}에 해당하는 정보을 찾을수 없습니다.");
|
||||
}
|
||||
$formDatas['user_uid'] = (int) $this->getAuthContext()->getUID();
|
||||
$formDatas['user_uid'] = $this->getAuthContext()->getUID();
|
||||
return $this->modify_process($entity, $formDatas);
|
||||
}, __FUNCTION__);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user