Add topics by time endpoint
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev There was a failure building this commit

This commit is contained in:
spsaefan
2026-05-29 12:15:05 +02:00
parent f2bca2f646
commit 32cb67df72
+15
View File
@@ -50,3 +50,18 @@ async def get_all_author_works(
principal: security.Principal = Depends(security.roles_allowed(["SUPER_ADMIN", "UNI_ADMIN"])),
):
return await logic.get_all_author_works(author_id)
@router.get("/{author_id}/topics-by-time",
operation_id="getTopicsByTimeByAuthor",
response_model=model.TopicsByTime,
summary="Returns topics grouped by publication year for an author.")
async def get_topics_by_time_by_author(
author_id: Annotated[str, Path(description="The author id, for example A5023888391.")],
max_topics_per_year: Annotated[int, Query(description="The maximum number of topics per year.", ge=1, le=20)] = 3,
principal: security.Principal = Depends(security.roles_allowed(["SUPER_ADMIN", "UNI_ADMIN"])),
):
return await logic.get_topics_by_time_by_author(
author_id,
max_topics_per_year=max_topics_per_year,
)