@router.get('/rooms/{url_token}/campaigns', response_model=PagingResponse[Campaign], response_model_exclude_none=True)
async def get_room_campaigns(r: Request, room: Room=Depends(prepare), after: Optional[str]=None, offset: Optional[int]=0, limit: Optional[int]=20):
    after_id = 0
    if (after_campaign := (await campaign_ctl.get_campaign(url_token=after))):
        after_id = after_campaign.id
    (total, campaigns) = (await asyncio.gather(campaign_ctl.get_campaign_count_by_room(room), campaign_ctl.get_campaigns_by_room(room, after_id, limit)))
    paging_info = (await generate_paging_info(r, total=total, after=(campaigns[(- 1)].id if len(campaigns) else None), offset=offset, limit=limit))
    return PagingResponse[Campaign](data=campaigns, paging=paging_info)
@router.get('/rooms/{url_token}/campaigns', response_model=PagingResponse[Campaign], response_model_exclude_none=True)
async def get_room_campaigns(r: Request, room: Room=Depends(prepare), after: Optional[str]=None, offset: Optional[int]=0, limit: Optional[int]=20):
    after_id = 0
    if (after_campaign := (await campaign_ctl.get_campaign(url_token=after))):
        after_id = after_campaign.id
    (total, campaigns) = (await asyncio.gather(campaign_ctl.get_campaign_count_by_room(room), campaign_ctl.get_campaigns_by_room(room, after_id, limit)))
    paging_info = (await generate_paging_info(r, total=total, after=(campaigns[(- 1)].id if len(campaigns) else None), offset=offset, limit=limit))
    return PagingResponse[Campaign](data=campaigns, paging=paging_info)