feat : cache Adapter unfinished
Some checks failed
Build Docker / build (push) Has been cancelled

This commit is contained in:
2025-09-04 23:16:07 +08:00
parent f4b812f861
commit 80ba5dcbf8
4 changed files with 22 additions and 4 deletions

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Controller\Test; namespace App\Controller\Test;
use App\Service\Test\Adapter\CacheService;
use App\Service\Test\Adapter\PayService; use App\Service\Test\Adapter\PayService;
use App\Service\Test\AdapterTestService; use App\Service\Test\AdapterTestService;
use Hyperf\HttpServer\Annotation\Controller; use Hyperf\HttpServer\Annotation\Controller;
@@ -12,14 +13,21 @@ use Hyperf\HttpServer\Annotation\RequestMapping;
#[Controller(prefix: 'adapter/test')] #[Controller(prefix: 'adapter/test')]
class AdapterTestController class AdapterTestController
{ {
/**
* @return array
*/
#[RequestMapping(path: 'pay', methods: 'GET')] #[RequestMapping(path: 'pay', methods: 'GET')]
public function pay() public function pay()
{ {
return (new PayService)->handle(); return (new PayService)->handle();
} }
/**
* @return array
*/
#[RequestMapping(path: 'cache', methods: 'GET')]
public function cache() public function cache()
{ {
return (new CacheService)->handle();
} }
} }

View File

@@ -15,8 +15,11 @@ use App\Service\Test\TestBaseService;
class CacheService extends TestBaseService class CacheService extends TestBaseService
{ {
public function handle() /**
* @return array
*/
public function handle(): array
{ {
//todo Write logic return $this->return->success();
} }
} }

View File

@@ -19,7 +19,10 @@ use App\Service\Test\TestBaseService;
class PayService extends TestBaseService class PayService extends TestBaseService
{ {
public function handle() /**
* @return array
*/
public function handle(): array
{ {
$alipayRes = (new AlipayAdapter(new AlipayService))->pay(100.00); $alipayRes = (new AlipayAdapter(new AlipayService))->pay(100.00);

View File

@@ -7,3 +7,7 @@ account=13632877014&password=123456
> {% > {%
client.global.set("admin_token", response.body.data.token); client.global.set("admin_token", response.body.data.token);
%} %}
### Adapter cache test
GET {{host}}/adapter/test/cache
Content-Type: application/x-www-form-urlencoded