constant.py 454 B

123456789101112131415161718192021222324
  1. from typing import List, Optional
  2. from pydantic import BaseModel
  3. class ConstantBase(BaseModel):
  4. # 常量类型
  5. type: str
  6. # 常量值
  7. value: str
  8. class ConstantCreate(ConstantBase):
  9. class Config:
  10. schema_extra = {
  11. "example": {
  12. "type": "作业类型",
  13. "value": "textValue",
  14. }
  15. }
  16. class Constant(ConstantBase):
  17. id: int
  18. class Config:
  19. orm_mode = True