diff --git a/app/Controller/TestController.php b/app/Controller/TestController.php index 4551b9b..8b855bb 100644 --- a/app/Controller/TestController.php +++ b/app/Controller/TestController.php @@ -14,10 +14,21 @@ use Hyperf\HttpServer\Annotation\AutoController; */ class TestController extends AbstractController { + private $name = 'default action'; + public function index1(RequestInterface $request) + { + $this->name = 'index1 action'; + return $this->name; + } + + public function index2(RequestInterface $request) + { + $this->name = 'index2 action'; + return $this->name; + } - public function index(RequestInterface $request) + public function index3(RequestInterface $request) { - $id = $request->input('id',2); - return (string)$id; + return $this->name; } } \ No newline at end of file diff --git a/config/autoload/file.php b/config/autoload/file.php new file mode 100644 index 0000000..59cd236 --- /dev/null +++ b/config/autoload/file.php @@ -0,0 +1,94 @@ + 'local', + 'storage' => [ + 'local' => [ + 'driver' => \Hyperf\Filesystem\Adapter\LocalAdapterFactory::class, + 'root' => __DIR__ . '/../../runtime', + ], + 'ftp' => [ + 'driver' => \Hyperf\Filesystem\Adapter\FtpAdapterFactory::class, + 'host' => 'ftp.example.com', + 'username' => 'username', + 'password' => 'password', + // 'port' => 21, + // 'root' => '/path/to/root', + // 'passive' => true, + // 'ssl' => true, + // 'timeout' => 30, + // 'ignorePassiveAddress' => false, + ], + 'memory' => [ + 'driver' => \Hyperf\Filesystem\Adapter\MemoryAdapterFactory::class, + ], + 's3' => [ + 'driver' => \Hyperf\Filesystem\Adapter\S3AdapterFactory::class, + 'credentials' => [ + 'key' => env('S3_KEY'), + 'secret' => env('S3_SECRET'), + ], + 'region' => env('S3_REGION'), + 'version' => 'latest', + 'bucket_endpoint' => false, + 'use_path_style_endpoint' => false, + 'endpoint' => env('S3_ENDPOINT'), + 'bucket_name' => env('S3_BUCKET'), + ], + 'minio' => [ + 'driver' => \Hyperf\Filesystem\Adapter\S3AdapterFactory::class, + 'credentials' => [ + 'key' => env('S3_KEY'), + 'secret' => env('S3_SECRET'), + ], + 'region' => env('S3_REGION'), + 'version' => 'latest', + 'bucket_endpoint' => false, + 'use_path_style_endpoint' => true, + 'endpoint' => env('S3_ENDPOINT'), + 'bucket_name' => env('S3_BUCKET'), + ], + 'oss' => [ + 'driver' => \Hyperf\Filesystem\Adapter\AliyunOssAdapterFactory::class, + 'accessId' => env('OSS_ACCESS_ID'), + 'accessSecret' => env('OSS_ACCESS_SECRET'), + 'bucket' => env('OSS_BUCKET'), + 'endpoint' => env('OSS_ENDPOINT'), + // 'timeout' => 3600, + // 'connectTimeout' => 10, + // 'isCName' => false, + // 'token' => '', + ], + 'qiniu' => [ + 'driver' => \Hyperf\Filesystem\Adapter\QiniuAdapterFactory::class, + 'accessKey' => env('QINIU_ACCESS_KEY'), + 'secretKey' => env('QINIU_SECRET_KEY'), + 'bucket' => env('QINIU_BUCKET'), + 'domain' => env('QINBIU_DOMAIN'), + ], + 'cos' => [ + 'driver' => \Hyperf\Filesystem\Adapter\CosAdapterFactory::class, + 'region' => env('COS_REGION'), + 'credentials' => [ + 'appId' => env('COS_APPID'), + 'secretId' => env('COS_SECRET_ID'), + 'secretKey' => env('COS_SECRET_KEY'), + ], + 'bucket' => env('COS_BUCKET'), + 'read_from_cdn' => false, + // 'timeout' => 60, + // 'connect_timeout' => 60, + // 'cdn' => '', + // 'scheme' => 'https', + ], + ], +]; diff --git a/config/routes.php b/config/routes.php index 10aa6e4..a2e3825 100644 --- a/config/routes.php +++ b/config/routes.php @@ -19,5 +19,9 @@ Router::addGroup('/v1/',function (){ Router::post('CouponUserReceive/getUserReceiveCouponList', 'App\Controller\CouponController@getUserReceiveCouponList'); Router::post('CouponUserReceive/userReceiveCoupon', 'App\Controller\CouponController@userReceiveCoupon'); Router::post('CouponUserReceive/getUserAvailableCoupons', 'App\Controller\CouponController@getUserAvailableCoupons'); + Router::get('test/index1', 'App\Controller\TestController@index1'); + Router::get('test/index2', 'App\Controller\TestController@index2'); + + }); \ No newline at end of file