Files

20 lines
610 B
Python
Raw Permalink Normal View History

"""打卡记鹿 —— 业务编排(Service 层)。"""
from __future__ import annotations
from PIL import Image
from ..repository import record_month
from ..utils.render import draw_calendar_grid_image
async def checkin(uid: str, year: int, month: int) -> Image.Image:
"""记录一次打卡并返回当月日历图。"""
await record_month(uid)
return await draw_calendar_grid_image(uid, year, month)
async def review(uid: str, year: int, month: int) -> Image.Image:
"""仅查询(不新增记录)并返回当月日历图。"""
return await draw_calendar_grid_image(uid, year, month)