issues/27: sync branch from k3s-test
This commit is contained in:
committed by
Valeriy Petrov
parent
fe24537e9f
commit
65934cff3c
@@ -7,6 +7,11 @@ parameters:
|
||||
app.timezone: 'Europe/Moscow'
|
||||
upload_directory: '%kernel.project_dir%/public/uploads'
|
||||
api.baseurl: '%env(string:API_BASE_URL)%'
|
||||
api.public_url: '%env(default:api_base_url_default:API_PUBLIC_URL)%'
|
||||
api_base_url_default: '%env(API_BASE_URL)%'
|
||||
env(WIDGET_API_URL): ''
|
||||
widget_api_url: '%env(default:mis_url_default:WIDGET_API_URL)%'
|
||||
mis_url_default: '%env(MIS_URL)%'
|
||||
mailer_from_email: 'noreply@sova.clinic'
|
||||
mailer_from_name: 'Sova Clinic'
|
||||
mailer_access_token: ''
|
||||
@@ -61,6 +66,8 @@ services:
|
||||
alias: App\Service\Translite\TransliteService
|
||||
|
||||
App\Command\UploadFilialsCommand:
|
||||
arguments:
|
||||
$widgetApiUrl: '%widget_api_url%'
|
||||
tags: ['console.command']
|
||||
|
||||
App\Command\UploadDoctorsCommand:
|
||||
@@ -70,9 +77,13 @@ services:
|
||||
tags: ['console.command']
|
||||
|
||||
App\Command\UploadPriceDepCommand:
|
||||
arguments:
|
||||
$widgetApiUrl: '%widget_api_url%'
|
||||
tags: ['console.command']
|
||||
|
||||
App\Command\UploadPriceCommand:
|
||||
arguments:
|
||||
$widgetApiUrl: '%widget_api_url%'
|
||||
tags: ['console.command']
|
||||
|
||||
App\Command\BitrixUpdateDoctorsCommand:
|
||||
@@ -143,6 +154,15 @@ services:
|
||||
$token: '%env(string:SMSRU_TOKEN)%'
|
||||
$sender: '%env(string:SMSRU_SENDER)%'
|
||||
|
||||
App\Service\Client\Interfaces\CalltouchClientServiceInterface:
|
||||
alias: App\Service\Client\CalltouchClientService
|
||||
|
||||
App\Service\Client\Interfaces\SmartCaptchaClientServiceInterface:
|
||||
alias: App\Service\Client\SmartCaptchaClientService
|
||||
|
||||
App\Service\Client\Interfaces\SmsClientServiceInterface:
|
||||
alias: App\Service\Client\SmsruClientService
|
||||
|
||||
App\Service\Bitrix\BitrixService:
|
||||
public: true
|
||||
arguments:
|
||||
@@ -172,6 +192,7 @@ services:
|
||||
$specialistService: '@App\Service\Specialist\SpecialistService'
|
||||
$locationService: '@App\Service\Location\LocationService'
|
||||
$filialService: '@App\Service\Filial\FilialService'
|
||||
$apiPublicUrl: '%api.public_url%'
|
||||
|
||||
App\Service\XmlFeedGenerator\XmlFeedGeneratorV1Service:
|
||||
arguments:
|
||||
@@ -180,6 +201,7 @@ services:
|
||||
$helperService: '@App\Service\Helper\HelperService'
|
||||
$connection: '@doctrine.dbal.default_connection'
|
||||
$logger: '@logger'
|
||||
$apiPublicUrl: '%api.public_url%'
|
||||
|
||||
App\Service\ScheduleCache\ScheduleCacheService:
|
||||
arguments:
|
||||
|
||||
@@ -23,7 +23,8 @@ class UploadFilialsCommand extends Command
|
||||
private LoggerInterface $logger,
|
||||
private EntityManagerInterface $entityManager,
|
||||
private HttpClientInterface $client,
|
||||
private TransliteServiceInterface $transliteService
|
||||
private TransliteServiceInterface $transliteService,
|
||||
private string $widgetApiUrl,
|
||||
)
|
||||
{
|
||||
parent::__construct();
|
||||
@@ -40,7 +41,7 @@ class UploadFilialsCommand extends Command
|
||||
$response = $this->client->request('GET', '/filials/list', [
|
||||
'verify_peer' => false,
|
||||
'verify_host' => false,
|
||||
'base_uri' => 'https://widget.sovamed.ru',
|
||||
'base_uri' => $this->widgetApiUrl,
|
||||
'headers' => [
|
||||
'Content-Type' => 'application/json',
|
||||
'User-Agent' => 'sovamed_bot'
|
||||
|
||||
@@ -25,6 +25,7 @@ class UploadPriceCommand extends Command
|
||||
public function __construct(
|
||||
private EntityManagerInterface $entityManager,
|
||||
private HttpClientInterface $client,
|
||||
private string $widgetApiUrl,
|
||||
)
|
||||
{
|
||||
parent::__construct();
|
||||
@@ -144,7 +145,7 @@ class UploadPriceCommand extends Command
|
||||
'verify_peer' => false,
|
||||
'verify_host' => false,
|
||||
'timeout' => 60,
|
||||
'base_uri' => 'https://widget.sovamed.ru',
|
||||
'base_uri' => $this->widgetApiUrl,
|
||||
'headers' => [
|
||||
'Content-Type' => 'application/json',
|
||||
'User-Agent' => 'sovamed_bot'
|
||||
|
||||
@@ -20,6 +20,7 @@ class UploadPriceDepCommand extends Command
|
||||
public function __construct(
|
||||
private EntityManagerInterface $entityManager,
|
||||
private HttpClientInterface $client,
|
||||
private string $widgetApiUrl,
|
||||
)
|
||||
{
|
||||
parent::__construct();
|
||||
@@ -34,7 +35,7 @@ class UploadPriceDepCommand extends Command
|
||||
$response = $this->client->request('GET', '/pricelist/departments', [
|
||||
'verify_peer' => false,
|
||||
'verify_host' => false,
|
||||
'base_uri' => 'https://widget.sovamed.ru',
|
||||
'base_uri' => $this->widgetApiUrl,
|
||||
'headers' => [
|
||||
'Content-Type' => 'application/json',
|
||||
'User-Agent' => 'sovamed_bot'
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Service\Client\Stub;
|
||||
|
||||
use App\Service\Client\Interfaces\SmartCaptchaClientServiceInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
final class AlwaysValidSmartCaptchaClientService implements SmartCaptchaClientServiceInterface
|
||||
{
|
||||
public function __construct(
|
||||
private LoggerInterface $logger,
|
||||
) {
|
||||
}
|
||||
|
||||
public function validate(string $token, string $clientIp): array
|
||||
{
|
||||
$this->logger->info('SmartCaptcha suppressed (noop stub)', [
|
||||
'ip' => $clientIp,
|
||||
]);
|
||||
|
||||
return ['status' => 'ok', 'message' => '', 'stub' => true];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Service\Client\Stub;
|
||||
|
||||
use App\Dto\CalltouchCreateRequestDto;
|
||||
use App\Service\Client\Interfaces\CalltouchClientServiceInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
final class NoopCalltouchClientService implements CalltouchClientServiceInterface
|
||||
{
|
||||
public function __construct(
|
||||
private LoggerInterface $logger,
|
||||
) {
|
||||
}
|
||||
|
||||
public function requestCreate(CalltouchCreateRequestDto $requests): array
|
||||
{
|
||||
$this->logger->info('Calltouch lead suppressed (noop stub)', [
|
||||
'regionId' => $requests->regionId ?? null,
|
||||
]);
|
||||
|
||||
return ['leadId' => 'test-stub', 'stub' => true];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Service\Client\Stub;
|
||||
|
||||
use App\Service\Client\Interfaces\SmsClientServiceInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
final class NoopSmsClientService implements SmsClientServiceInterface
|
||||
{
|
||||
public function __construct(
|
||||
private LoggerInterface $logger,
|
||||
) {
|
||||
}
|
||||
|
||||
public function send(string $to, string $msg): array
|
||||
{
|
||||
$this->logger->info('SMS suppressed (noop stub)', ['to' => $to]);
|
||||
|
||||
return ['status' => 'ok', 'stub' => true];
|
||||
}
|
||||
|
||||
public function senders(): array
|
||||
{
|
||||
$this->logger->info('SMS senders suppressed (noop stub)');
|
||||
|
||||
return ['status' => 'ok', 'stub' => true, 'senders' => []];
|
||||
}
|
||||
|
||||
public function balance(): array
|
||||
{
|
||||
$this->logger->info('SMS balance suppressed (noop stub)');
|
||||
|
||||
return ['status' => 'ok', 'stub' => true, 'balance' => 0];
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,8 @@ class XmlFeedGeneratorService
|
||||
private SpecialistService $specialistService,
|
||||
private LocationService $locationService,
|
||||
private FilialService $filialService,
|
||||
private SpecialistDcodeDescriptionRepository $specialistDcodeDescriptionRepository
|
||||
private SpecialistDcodeDescriptionRepository $specialistDcodeDescriptionRepository,
|
||||
private string $apiPublicUrl,
|
||||
) {
|
||||
$this->dom = new DOMDocument('1.0', 'UTF-8');
|
||||
$this->dom->formatOutput = true;
|
||||
@@ -114,7 +115,7 @@ class XmlFeedGeneratorService
|
||||
}
|
||||
};
|
||||
|
||||
return "https://api.sovamed.ru/images/logo/{$picture}";
|
||||
return rtrim($this->apiPublicUrl, '/') . "/images/logo/{$picture}";
|
||||
}
|
||||
|
||||
private function getSpecialistLink(Specialist $specialist): string
|
||||
@@ -171,7 +172,7 @@ class XmlFeedGeneratorService
|
||||
$location->getDepartment()
|
||||
);
|
||||
$this->addTextElement($doctorElement, 'description', $doctorDescription ?? '');
|
||||
$picture = "https://api.sovamed.ru/specialist/picture/{$id}";
|
||||
$picture = rtrim($this->apiPublicUrl, '/') . "/specialist/picture/{$id}";
|
||||
$this->addTextElement($doctorElement, 'picture', $picture);
|
||||
$this->addTextElement($doctorElement, 'name', $doctor->getName() ?? '');
|
||||
$this->addTextElement($doctorElement, 'first_name', $doctor->getFullName()['firstName'] ?? '');
|
||||
|
||||
@@ -26,6 +26,7 @@ class XmlFeedGeneratorV1Service
|
||||
private SpecialistService $specialistService,
|
||||
private HelperService $helperService,
|
||||
private Connection $connection,
|
||||
private string $apiPublicUrl,
|
||||
private ?LoggerInterface $logger = null,
|
||||
) {
|
||||
$this->dom = new DOMDocument('1.0', 'UTF-8');
|
||||
@@ -139,7 +140,7 @@ class XmlFeedGeneratorV1Service
|
||||
}
|
||||
};
|
||||
|
||||
return "https://api.sovamed.ru/images/logo/{$picture}";
|
||||
return rtrim($this->apiPublicUrl, '/') . "/images/logo/{$picture}";
|
||||
}
|
||||
|
||||
private function getSpecialistLink(Specialist $specialist): string
|
||||
@@ -219,7 +220,7 @@ class XmlFeedGeneratorV1Service
|
||||
$this->addTextElement($offerElement, 'url', $url);
|
||||
$this->addTextElement($offerElement, 'set-ids', $specialist->getDcodes());
|
||||
|
||||
$picture = "https://api.sovamed.ru/specialist/picture/{$specialist->getId()}";
|
||||
$picture = rtrim($this->apiPublicUrl, '/') . "/specialist/picture/{$specialist->getId()}";
|
||||
$this->addTextElement($offerElement, 'picture', $picture);
|
||||
$this->addTextElement($offerElement, 'categoryId', '1');
|
||||
$this->addTextElement($offerElement, 'currencyId', 'RUR');
|
||||
|
||||
Reference in New Issue
Block a user