166940d5a6
Made-with: Cursor
38 lines
703 B
PHP
38 lines
703 B
PHP
<?php
|
|
declare (strict_types = 1);
|
|
|
|
namespace app\api\controller;
|
|
|
|
/**
|
|
* API 示例控制器
|
|
*/
|
|
class Index extends BaseController
|
|
{
|
|
/**
|
|
* 首页接口
|
|
* @return \think\response\Json
|
|
*/
|
|
public function index()
|
|
{
|
|
$data = [
|
|
'name' => 'ThinkPHP API',
|
|
'version' => app()->version(),
|
|
'message' => 'Welcome to ThinkPHP API Application',
|
|
];
|
|
|
|
return $this->success($data);
|
|
}
|
|
|
|
/**
|
|
* 健康检查接口
|
|
* @return \think\response\Json
|
|
*/
|
|
public function health()
|
|
{
|
|
return $this->success([
|
|
'status' => 'ok',
|
|
'timestamp' => date('Y-m-d H:i:s'),
|
|
]);
|
|
}
|
|
}
|