update profile service
This commit is contained in:
parent
72e2897084
commit
306f52bc4b
@ -27,13 +27,16 @@ from common_lib.utils.http_client import client
|
||||
# except httpx.RequestError:
|
||||
# raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail="Token service unavailable")
|
||||
|
||||
async def get_profile_by_user_id(user_id: UUID, current_user: UUID) -> dict:
|
||||
async def get_profile_by_user_id(user_id: UUID, current_user: UUID, full_profile: bool, with_permissions: bool) -> dict:
|
||||
try:
|
||||
# async with httpx.AsyncClient(transport=ssl_transport, timeout=5.0) as client:
|
||||
response = await client.post(
|
||||
f"{settings.PROFILE_SERVICE}/user_id/internal",
|
||||
json={"user_id": str(user_id),
|
||||
"current_user": str(current_user)})
|
||||
"current_user": str(current_user),
|
||||
"full_profile": full_profile,
|
||||
"with_permissions": with_permissions
|
||||
})
|
||||
|
||||
if response.status_code != 200:
|
||||
raise HTTPException(
|
||||
@ -48,13 +51,16 @@ async def get_profile_by_user_id(user_id: UUID, current_user: UUID) -> dict:
|
||||
raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail=f"profile_service unreachable: {str(e)}")
|
||||
|
||||
|
||||
async def get_profiles_by_user_ids(user_ids: List[UUID], user_id: UUID) -> Dict[str, dict]:
|
||||
async def get_profiles_by_user_ids(user_ids: List[UUID], user_id: UUID, full_profile: bool, with_permissions: bool) -> Dict[str, dict]:
|
||||
try:
|
||||
# async with httpx.AsyncClient(transport=ssl_transport, timeout=5.0) as client:
|
||||
response = await client.post(
|
||||
f"{settings.PROFILE_SERVICE}/user_ids/internal",
|
||||
json={"user_ids": [str(uid) for uid in user_ids],
|
||||
"user_id": str(user_id)})
|
||||
"user_id": str(user_id),
|
||||
"full_profile": full_profile,
|
||||
"with_permissions": with_permissions
|
||||
})
|
||||
|
||||
if response.status_code != 200:
|
||||
raise HTTPException(
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "common-lib"
|
||||
version = "0.0.51"
|
||||
version = "0.0.52"
|
||||
description = "Библиотека общих компонентов для микросервисов yobble"
|
||||
authors = [{ name = "cheykrym", email = "you@example.com" }]
|
||||
license = "MIT"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user