"""
Activity service routes for Memos-style backend.
"""

from typing import List

from fastapi import APIRouter, Depends, HTTPException

from common.memos_core.schemas import ActivityResponse
from common.memos_core.services import get_activity_service


router = APIRouter(prefix="/activities")


@router.get("", summary="List activities", response_model=List[ActivityResponse])
async def list_activities(activity_service=Depends(get_activity_service)):
    try:
        return await activity_service.list_activities()
    except Exception as exc:  # pragma: no cover
        raise HTTPException(status_code=500, detail=str(exc)) from exc


