This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user