bt-trader/app/Controllers/Admin/BoardController.php
2026-02-24 18:58:30 +09:00

39 lines
1.2 KiB
PHP

<?php
namespace App\Controllers\Admin;
use App\Entities\BoardEntity;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use RuntimeException;
class BoardController extends AdminController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
if ($this->service === null) {
$this->service = service('boardservice');
}
$this->addActionPaths('board');
}
//Action작업관련
//기본 함수 작업
//Custom 추가 함수
public function latest(string $category): ResponseInterface
{
$this->action_init_process(__FUNCTION__);
return $this->response->setJSON($this->service->getLatest($category));
}
public function reqeusttask(): ResponseInterface
{
$this->action_init_process(__FUNCTION__);
$auth_uid = $this->getAuthContext()->getUID();
if ($auth_uid === null) {
throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생:로그인을 하지 않으셨습니다.");
}
return $this->response->setJSON($this->service->getRequestTaskCount($auth_uid));
}
}