Переработан эндпоинт getProfile на использование http клиента
All checks were successful
Build And Push / publish (push) Successful in 1m41s

This commit is contained in:
2025-09-26 12:27:24 +03:00
parent e218d0b130
commit bd7162b803
6 changed files with 111 additions and 2 deletions

View File

@ -0,0 +1,28 @@
from logging import getLogger
from fastapi import status as st
from httpx import AsyncClient
from core.config import settings
from shared import exceptions as e
from . import schema as s
class VITACORE_API(AsyncClient):
def __init__(self):
self.logger = getLogger(__name__)
super().__init__(base_url=settings.VITACORE_BASE_URL)
async def findBySnils(self, snils: str):
return
async def getProfile(self, patId: str):
req = await self.get('/getProfile', params={'patId': patId})
match req.status_code:
case st.HTTP_200_OK:
return s.ProfileModel.model_validate(req.json())
case _:
self.logger.error(req.json())
raise e.UnknownException