DDB-1753 #5

Merged
dcherednik merged 21 commits from DDB-1753 into master 2025-03-21 13:37:34 +03:00
2 changed files with 4 additions and 18 deletions
Showing only changes of commit cea9bdedaf - Show all commits

View File

@ -13,14 +13,3 @@ DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&ch
DOT_DOT_URL='http://dot-dot.local' DOT_DOT_URL='http://dot-dot.local'
API_TOKEN='secret' API_TOKEN='secret'
###> KONTUR_DIADOC###
API_KONTUR_DIADOC_END_POINT_URL=https://diadoc-api.kontur.ru
API_KONTUR_DIADOC_API_TOKEN=API-3701ccdb-7bdf-4f29-bbe0-3a0278eee913
API_KONTUR_DIADOC_LOGIN=LOGIN
API_KONTUR_DIADOC_PASSWORD=PASSWORD
###> KONTUR_DIADOC_POST_MESSAGE_DIRECTION###
API_KONTUR_DIADOC_PMD_BOX_ID=c1a0d340-a481-49b2-ba21-d51dea59df55
API_KONTUR_DIADOC_PMD_FROM_DEPT_ID=00000000-0000-0000-0000-000000000000
API_KONTUR_DIADOC_PMD_TO_DEPT_ID=da0f3b33-ef70-41e9-8e9e-fb431a891ef4
###< KONTUR_DIADOC###

View File

@ -7,6 +7,7 @@ namespace App\SignDocument\Controller;
use App\Infrastructure\Traits\ApiHelperTrait; use App\Infrastructure\Traits\ApiHelperTrait;
use App\SignDocument\Api\Request\DigitalSignatureRequest; use App\SignDocument\Api\Request\DigitalSignatureRequest;
use App\SignDocument\Services\DigitalSignatureService; use App\SignDocument\Services\DigitalSignatureService;
use PHPUnit\Event\RuntimeException;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
@ -26,12 +27,8 @@ class DigitalSignatureController extends AbstractController
{ {
$token = $request->server->get('HTTP_AUTHORIZATION'); $token = $request->server->get('HTTP_AUTHORIZATION');
try {
return $this->createJsonResponse([ return $this->createJsonResponse([
'base64' => $this->digitalSignatureService->getSignature($digitalSignatureRequest, $token), 'hash' => $this->digitalSignatureService->getSignature($digitalSignatureRequest, $token),
]); ]);
} catch (Exception $exception) {
return $this->createJsonResponse([], $exception->getMessage(), 400);
}
} }
} }