diff --git a/src/main.py b/src/main.py index 2c64f08..f85701c 100644 --- a/src/main.py +++ b/src/main.py @@ -74,7 +74,7 @@ class CalendarEvent(SQLModel): attendees: List[CalendarAttendees] | None = None -@app.get('/calendar_events', response_model=List[CalendarEvent]) +@app.get('/calendar_events', response_model=List[CalendarEvent], tags=['Calendar']) def get_calendar_events( lower_bound: datetime = None, upper_bound: datetime = None, @@ -114,7 +114,7 @@ def get_calendar_events( return events -@app.post('/calendar_events') +@app.post('/calendar_events', tags=['Calendar']) def create_calendar_event(calendar_event: CalendarEvent, service: Resource = Depends(get_calendar_service)): # Call the Calendar API now = datetime.utcnow().isoformat() + 'Z' # 'Z' indicates UTC time @@ -124,7 +124,7 @@ def create_calendar_event(calendar_event: CalendarEvent, service: Resource = Dep return calendar_event -@app.post('/calendar_events/create_slots', response_model=List[CalendarEvent]) +@app.post('/calendar_events/create_slots', response_model=List[CalendarEvent], tags=['Calendar']) def create_calendar_slots(datetime_start: datetime, timezone: str, slot_length_minutes: int, count: int, service: Resource = Depends(get_calendar_service)): # Call the Calendar API events = [] @@ -151,7 +151,7 @@ def create_calendar_slots(datetime_start: datetime, timezone: str, slot_length_m return events -@app.get('/calendar_events/free_slots', response_model=List[CalendarEvent]) +@app.get('/calendar_events/free_slots', response_model=List[CalendarEvent], tags=['Calendar']) def get_free_calendar_slots( lower_bound: datetime = None, upper_bound: datetime = None, @@ -165,7 +165,7 @@ def get_free_calendar_slots( return free_slots -@app.post('/calendar_events/mark_busy', response_model=CalendarEvent) +@app.post('/calendar_events/mark_busy', response_model=CalendarEvent, tags=['Calendar']) def mark_busy_calendar_slot( description: str | None = None, lower_bound: datetime = None, @@ -191,7 +191,7 @@ def mark_busy_calendar_slot( return event -@app.get('/calendar_events/{slot_id}', response_model=CalendarEvent) +@app.get('/calendar_events/{slot_id}', response_model=CalendarEvent, tags=['Calendar']) def get_slot_by_id( slot_id: str, service: Resource = Depends(get_calendar_service) @@ -209,7 +209,7 @@ def get_slot_by_id( return event -@app.post('/calendar_events/{slot_id}/mark_busy', response_model=CalendarEvent) +@app.post('/calendar_events/{slot_id}/mark_busy', response_model=CalendarEvent, tags=['Calendar']) def mark_busy_calendar_slot_by_id( slot_id: str, description: str | None = None, @@ -230,7 +230,7 @@ def mark_busy_calendar_slot_by_id( return event -@app.post('/calendar_events/{slot_id}/mark_free', response_model=CalendarEvent) +@app.post('/calendar_events/{slot_id}/mark_free', response_model=CalendarEvent, tags=['Calendar']) def mark_free_calendar_slot_by_id( slot_id: str, service: Resource = Depends(get_calendar_service) @@ -246,7 +246,7 @@ def mark_free_calendar_slot_by_id( return event -@app.post('/calendar_events/mark_free', response_model=CalendarEvent) +@app.post('/calendar_events/mark_free', response_model=CalendarEvent, tags=['Calendar']) def mark_free_calendar_slot( lower_bound: datetime = None, upper_bound: datetime = None, @@ -269,7 +269,7 @@ def mark_free_calendar_slot( return event -@app.post('/calendar_events/mark_free/batch', response_model=List[CalendarEvent]) +@app.post('/calendar_events/mark_free/batch', response_model=List[CalendarEvent], tags=['Calendar']) def mark_free_calendar_slots( lower_bound: datetime = None, upper_bound: datetime = None, @@ -352,7 +352,7 @@ class FormatDateResponse(BaseModel): now_delta_word: str | None = Field(schema_extra={'example': 'сегодня'}) -@app.post('/utils/date_format', response_model=FormatDateResponse) +@app.post('/utils/date_format', response_model=FormatDateResponse, tags=['Utils']) async def format_date(input_date: FormatDateRequest): now = datetime.now() timestamp = input_date.date.timestamp()