diff --git a/app/Controller/Test/AdapterTestController.php b/app/Controller/Test/AdapterTestController.php index 86a93e3..f525c8d 100644 --- a/app/Controller/Test/AdapterTestController.php +++ b/app/Controller/Test/AdapterTestController.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace App\Controller\Test; +use App\Service\Test\Adapter\CacheService; use App\Service\Test\Adapter\PayService; use App\Service\Test\AdapterTestService; use Hyperf\HttpServer\Annotation\Controller; @@ -12,14 +13,21 @@ use Hyperf\HttpServer\Annotation\RequestMapping; #[Controller(prefix: 'adapter/test')] class AdapterTestController { + /** + * @return array + */ #[RequestMapping(path: 'pay', methods: 'GET')] public function pay() { return (new PayService)->handle(); } + /** + * @return array + */ + #[RequestMapping(path: 'cache', methods: 'GET')] public function cache() { - + return (new CacheService)->handle(); } } diff --git a/app/Service/Test/Adapter/CacheService.php b/app/Service/Test/Adapter/CacheService.php index 23c7927..3d8365e 100644 --- a/app/Service/Test/Adapter/CacheService.php +++ b/app/Service/Test/Adapter/CacheService.php @@ -15,8 +15,11 @@ use App\Service\Test\TestBaseService; class CacheService extends TestBaseService { - public function handle() + /** + * @return array + */ + public function handle(): array { - //todo Write logic + return $this->return->success(); } } \ No newline at end of file diff --git a/app/Service/Test/Adapter/PayService.php b/app/Service/Test/Adapter/PayService.php index 7376add..59f71a8 100644 --- a/app/Service/Test/Adapter/PayService.php +++ b/app/Service/Test/Adapter/PayService.php @@ -19,7 +19,10 @@ use App\Service\Test\TestBaseService; class PayService extends TestBaseService { - public function handle() + /** + * @return array + */ + public function handle(): array { $alipayRes = (new AlipayAdapter(new AlipayService))->pay(100.00); diff --git a/request/test.http b/request/test.http index 3c8f900..daa9d50 100644 --- a/request/test.http +++ b/request/test.http @@ -7,3 +7,7 @@ account=13632877014&password=123456 > {% client.global.set("admin_token", response.body.data.token); %} + +### Adapter cache test +GET {{host}}/adapter/test/cache +Content-Type: application/x-www-form-urlencoded \ No newline at end of file