cron_expression.py 750 B

12345678910111213141516171819202122232425262728293031
  1. from typing import List, Optional
  2. from pydantic import BaseModel
  3. class CronExpression(BaseModel):
  4. # cron类型(0:时,1:日,2:周,3:月,4:cron)
  5. cron_select_type: int
  6. # cron表达式
  7. cron_expression: Optional[str] = None
  8. # 分
  9. minute: Optional[int] = None
  10. # 时
  11. hour: Optional[int] = None
  12. # 天
  13. day: Optional[int] = None
  14. # 周
  15. week: Optional[int] = None
  16. # 月
  17. month: Optional[int] = None
  18. class Config:
  19. schema_extra = {
  20. "example": {
  21. "cron_select_type": 3,
  22. "cron_expression": "",
  23. "minute": 0,
  24. "hour": 0,
  25. "day": 1,
  26. "week": 3,
  27. "month": 2,
  28. }
  29. }