feat(backend): person overview with real profile changes, shared groups, joins and leaves, deleted count and group title changes
This commit is contained in:
1 parent
0c9c848fb1
commit
8f9ceb6af8
3 files changed
+290
-10
No files matched your search
@@ -5,7 +5,13 @@ from dishka.integrations.fastapi import DishkaRoute, FromDishka
|
||||
from fastapi import APIRouter, HTTPException, Query
|
||||
|
||||
from utils.read import peers
|
||||
from utils.read.models import PeerHistoryView, PeerView
|
||||
from utils.read.models import (
|
||||
PeerGroups,
|
||||
PeerHistoryView,
|
||||
PeerOverview,
|
||||
PeerView,
|
||||
ProfileChange,
|
||||
)
|
||||
|
||||
router = APIRouter(prefix="/api", tags=["peers"], route_class=DishkaRoute)
|
||||
|
||||
@@ -35,3 +41,24 @@ async def peer_history(
|
||||
pool: FromDishka[asyncpg.Pool], peer_id: int, account_id: AccountId
|
||||
) -> list[PeerHistoryView]:
|
||||
return await peers.get_peer_history(pool, account_id, peer_id)
|
||||
|
||||
|
||||
@router.get("/peers/{peer_id}/overview")
|
||||
async def peer_overview(
|
||||
pool: FromDishka[asyncpg.Pool], peer_id: int, account_id: AccountId
|
||||
) -> PeerOverview:
|
||||
return await peers.get_overview(pool, account_id, peer_id)
|
||||
|
||||
|
||||
@router.get("/peers/{peer_id}/groups")
|
||||
async def peer_groups(
|
||||
pool: FromDishka[asyncpg.Pool], peer_id: int, account_id: AccountId
|
||||
) -> PeerGroups:
|
||||
return await peers.get_groups(pool, account_id, peer_id)
|
||||
|
||||
|
||||
@router.get("/chats/{chat_id}/changes")
|
||||
async def chat_changes(
|
||||
pool: FromDishka[asyncpg.Pool], chat_id: int, account_id: AccountId
|
||||
) -> list[ProfileChange]:
|
||||
return await peers.get_chat_changes(pool, account_id, chat_id)
|
||||
Reference in new issue
Block a user