programme.py 500 B

12345678910111213141516171819202122232425262728
  1. from typing import List, Optional
  2. from pydantic import BaseModel
  3. class ProgrammeBase(BaseModel):
  4. # 程序名称
  5. name: str
  6. class ProgrammeCreate(ProgrammeBase):
  7. # 密码
  8. password: str
  9. class Config:
  10. schema_extra = {
  11. "example": {
  12. "name": "test",
  13. "password": "test",
  14. }
  15. }
  16. class ProgrammeId(BaseModel):
  17. # 程序id
  18. programme_id: int
  19. class ProgrammeUpdate(ProgrammeId):
  20. # 密码
  21. password: str