|
|
@@ -0,0 +1,35 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+declare(strict_types=1);
|
|
|
+/**
|
|
|
+ * This file is part of Hyperf.
|
|
|
+ *
|
|
|
+ * @link https://www.hyperf.io
|
|
|
+ * @document https://hyperf.wiki
|
|
|
+ * @contact group@hyperf.io
|
|
|
+ * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
|
|
+ *
|
|
|
+ */
|
|
|
+namespace App\Controller\Api;
|
|
|
+
|
|
|
+use App\Model\User;
|
|
|
+use App\Controller\Resource\ApiResource;
|
|
|
+use Hyperf\HttpServer\Annotation\AutoController;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Class IndexController
|
|
|
+ * @package App\Controller
|
|
|
+ * @AutoController(prefix="api")
|
|
|
+ */
|
|
|
+class IndexController extends BaseController
|
|
|
+{
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
+ public function test(){
|
|
|
+ $user = User::where(['id'=> 1])->first();
|
|
|
+ return ApiResource::success(1008, $user);
|
|
|
+ }
|
|
|
+}
|