From 23a230a9f3cce695f6fc8c85a61da4730c9aa288 Mon Sep 17 00:00:00 2001 From: Nick Zeng Date: Wed, 12 Nov 2025 09:35:20 +0800 Subject: [PATCH] update index controller, add health check --- backend/app/Controller/IndexController.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/backend/app/Controller/IndexController.php b/backend/app/Controller/IndexController.php index 9be020b..d39403c 100644 --- a/backend/app/Controller/IndexController.php +++ b/backend/app/Controller/IndexController.php @@ -12,16 +12,34 @@ declare(strict_types=1); namespace App\Controller; +use Hyperf\HttpServer\Annotation\Controller; +use Hyperf\HttpServer\Annotation\RequestMapping; + +#[Controller] class IndexController extends AbstractController { + // #[RequestMapping('/', methods: ['GET', 'POST'])] public function index() { - $user = $this->request->input('user', 'Hyperf'); $method = $this->request->getMethod(); return [ 'method' => $method, - 'message' => "Hello {$user}.", + 'message' => "Dataflow App", + ]; + } + + #[RequestMapping('/favicon.ico', methods: ['GET', 'POST'])] + public function favicon() + { + return []; + } + + #[RequestMapping('/health', methods: 'GET')] + public function health() + { + return [ + 'message' => "System status ok", ]; } }