mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-11-22 15:53:01 +00:00
todo penner 1
This commit is contained in:
parent
b74646994e
commit
558a7e8a02
3 changed files with 15 additions and 7 deletions
|
@ -75,19 +75,15 @@ class TransformedString(BaseModel):
|
|||
|
||||
class Puzzle(BaseModel):
|
||||
# Titel
|
||||
# TODO penner neue Route GET /user/title
|
||||
title: str
|
||||
|
||||
# Tag, an dem der Kalender startet
|
||||
# TODO penner
|
||||
begin_day: int = 1
|
||||
|
||||
# Monat, in dem der Kalender startet
|
||||
# TODO penner
|
||||
begin_month: int = 12
|
||||
|
||||
# Kalender so viele Tage nach der letzten Türöffnung schließen
|
||||
# TODO penner
|
||||
close_after: int = 90
|
||||
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ async def get_all_sorted_days(
|
|||
|
||||
|
||||
async def get_all_event_dates(
|
||||
cfg: Config = Depends(get_config),
|
||||
days: list[int] = Depends(get_all_sorted_days),
|
||||
) -> EventDates:
|
||||
"""
|
||||
|
@ -31,10 +32,10 @@ async def get_all_event_dates(
|
|||
|
||||
return EventDates(
|
||||
today=date.today(),
|
||||
begin_month=12,
|
||||
begin_day=1,
|
||||
begin_month=cfg.puzzle.begin_month,
|
||||
begin_day=cfg.puzzle.begin_day,
|
||||
events=days,
|
||||
close_after=90,
|
||||
close_after=cfg.puzzle.close_after,
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -27,6 +27,17 @@ async def get_background_image(
|
|||
return await api_return_image(await load_image(f"files/{cal_cfg.background}"))
|
||||
|
||||
|
||||
@router.get("/title")
|
||||
async def get_title(
|
||||
cfg: Config = Depends(get_config),
|
||||
) -> str:
|
||||
"""
|
||||
Lädt Kalendertitel
|
||||
"""
|
||||
|
||||
return cfg.puzzle.title
|
||||
|
||||
|
||||
@router.get("/doors")
|
||||
async def get_doors(
|
||||
cal_cfg: CalendarConfig = Depends(get_calendar_config),
|
||||
|
|
Loading…
Reference in a new issue