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;
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();
}
}

View File

@@ -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();
}
}

View File

@@ -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);