feat : Proxy get user info

This commit is contained in:
2025-09-07 13:10:17 +08:00
parent 705d18239f
commit 32bc27596e
7 changed files with 186 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ declare(strict_types=1);
use App\Interface\Test\Adapter\CacheInterface;
use App\Interface\Test\Decorator\HttpClientInterface;
use App\Interface\Test\Decorator\LoggerInterface;
use App\Interface\Test\Proxy\UserInfoInterface;
use App\Lib\Request\GuzzleHttpClient;
use App\Service\Test\Adapter\Cache\RedisCacheService;
use App\Service\Test\Decorator\Container\BasicFileLogger;
@@ -21,6 +22,9 @@ use App\Service\Test\Decorator\Container\IpLoggerDecorator;
use App\Service\Test\Decorator\Container\TimestampLoggerDecorator;
use App\Service\Test\Decorator\Http\LoggableHttpClientService;
use App\Service\Test\Decorator\Http\RetryableHttpClientService;
use App\Service\Test\Proxy\Cache\CacheUserInfoService;
use App\Service\Test\Proxy\Cache\UserInfoService;
use Hyperf\Cache\Cache;
use function Hyperf\Support\make;
return [
@@ -37,5 +41,11 @@ return [
$logger = make(BasicFileLogger::class);
$client = make(RetryableHttpClientService::class,['httpClient' => $client , 'logger' => $logger , 'maxRetries' => 2]);
return make(LoggableHttpClientService::class,['httpClient' => $client , 'logger' => $logger]);
},
UserInfoInterface::class => function () {
$service = make(UserInfoService::class);
$logger = make(BasicFileLogger::class);
$cache = make(Cache::class);
return make(CacheUserInfoService::class, ['userInfoService' => $service,'logger' => $logger , 'cache' => $cache]);
}
];