feat : Proxy get user info
This commit is contained in:
39
app/Service/Test/Proxy/UserService.php
Normal file
39
app/Service/Test/Proxy/UserService.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* This service file is part of item.
|
||||
*
|
||||
* @author ctexthuang
|
||||
* @contact ctexthuang@qq.com
|
||||
* @web_site https://ctexthuang.com
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Service\Test\Proxy;
|
||||
|
||||
use App\Interface\Test\Proxy\UserInfoInterface;
|
||||
use App\Service\Test\Proxy\Cache\UserInfoService;
|
||||
use App\Service\Test\TestBaseService;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
|
||||
class UserService extends TestBaseService
|
||||
{
|
||||
/**
|
||||
* @var UserInfoService
|
||||
*/
|
||||
#[Inject]
|
||||
protected UserInfoInterface $userInfoInterface;
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function handle(): array
|
||||
{
|
||||
return $this->return->success(
|
||||
'success',
|
||||
$this->userInfoInterface->getUserInfo(
|
||||
(int)$this->request->input('user_id',1)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user