Initial commit: ThinkPHP refactor (tp)
Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?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'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user