mirror of
https://devops.lemonos.cn/lawson/FendxPHP.git
synced 2026-06-15 23:12:49 +08:00
38 lines
885 B
PHP
38 lines
885 B
PHP
|
|
<?php
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace App\Controller;
|
||
|
|
|
||
|
|
use Fendx\Core\Context\Context;
|
||
|
|
|
||
|
|
class HomeController
|
||
|
|
{
|
||
|
|
public function index(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'code' => 200,
|
||
|
|
'message' => 'Welcome to FendxPHP Framework',
|
||
|
|
'data' => [
|
||
|
|
'framework' => 'FendxPHP',
|
||
|
|
'version' => '1.0.0',
|
||
|
|
'traceId' => Context::getTraceId(),
|
||
|
|
'timestamp' => date('Y-m-d H:i:s'),
|
||
|
|
]
|
||
|
|
];
|
||
|
|
}
|
||
|
|
|
||
|
|
public function health(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'code' => 200,
|
||
|
|
'message' => 'Health check passed',
|
||
|
|
'data' => [
|
||
|
|
'status' => 'healthy',
|
||
|
|
'php_version' => PHP_VERSION,
|
||
|
|
'memory_usage' => memory_get_usage(true),
|
||
|
|
'traceId' => Context::getTraceId(),
|
||
|
|
]
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|