Redis
This commit is contained in:
@ -1,13 +1,14 @@
|
||||
<?php
|
||||
namespace Incoviba\Controller\API;
|
||||
|
||||
use DateTimeInterface;
|
||||
use DateTimeImmutable;
|
||||
use DateInterval;
|
||||
use DateTimeImmutable;
|
||||
use DateTimeInterface;
|
||||
use Incoviba\Common\Implement\Exception\EmptyRedis;
|
||||
use Incoviba\Controller\withRedis;
|
||||
use Incoviba\Service;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Incoviba\Common\Implement\Exception\EmptyRedis;
|
||||
use Incoviba\Service;
|
||||
|
||||
class Money
|
||||
{
|
||||
@ -15,7 +16,8 @@ class Money
|
||||
|
||||
private int $time = 60 * 60 * 24 * 30;
|
||||
|
||||
public function get(ServerRequestInterface $request, ResponseInterface $response, Service\Redis $redisService, Service\Money $moneyService): ResponseInterface
|
||||
public function get(ServerRequestInterface $request, ResponseInterface $response, Service\Redis $redisService,
|
||||
Service\Money $moneyService): ResponseInterface
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
$output = [
|
||||
@ -42,7 +44,8 @@ class Money
|
||||
}
|
||||
|
||||
protected array $data;
|
||||
protected function getValue(Service\Redis $redisService, string $redisKey, Service\Money $moneyService, DateTimeInterface $date, string $provider): float
|
||||
protected function getValue(Service\Redis $redisService, string $redisKey, Service\Money $moneyService,
|
||||
DateTimeInterface $date, string $provider): float
|
||||
{
|
||||
if (isset($this->data[$date->format('Y-m-d')])) {
|
||||
return $this->data[$date->format('Y-m-d')];
|
||||
@ -85,7 +88,8 @@ class Money
|
||||
$output['uf'] = $ufs[$date->format('Y-m-d')];
|
||||
return $this->withJson($response, $output);
|
||||
}*/
|
||||
public function ipc(ServerRequestInterface $request, ResponseInterface $response, Service\Redis $redisService, Service\Money $moneyService): ResponseInterface
|
||||
public function ipc(ServerRequestInterface $request, ResponseInterface $response, Service\Redis $redisService,
|
||||
Service\Money $moneyService): ResponseInterface
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
$output = [
|
||||
|
Reference in New Issue
Block a user