12345678910111213141516171819202122232425262728293031 |
- from typing import List, Optional
- from pydantic import BaseModel
- class CronExpression(BaseModel):
- # cron类型(0:时,1:日,2:周,3:月,4:cron)
- cron_select_type: int
- # cron表达式
- cron_expression: Optional[str] = None
- # 分
- minute: Optional[int] = None
- # 时
- hour: Optional[int] = None
- # 天
- day: Optional[int] = None
- # 周
- week: Optional[int] = None
- # 月
- month: Optional[int] = None
- class Config:
- schema_extra = {
- "example": {
- "cron_select_type": 3,
- "cron_expression": "",
- "minute": 0,
- "hour": 0,
- "day": 1,
- "week": 3,
- "month": 2,
- }
- }
|