jm_homework_datasource_relation.py 780 B

12345678910111213141516171819202122232425262728293031323334
  1. from typing import List, Optional
  2. from pydantic import BaseModel
  3. class JmHomeworkDatasourceRelationBase(BaseModel):
  4. # 类型
  5. type: str
  6. # 数据源id
  7. datasource_id: int
  8. # 节点uuid
  9. node_uuid: str
  10. # 表名
  11. table: str
  12. class JmHomeworkDatasourceRelationCreate(JmHomeworkDatasourceRelationBase):
  13. class Config:
  14. schema_extra = {
  15. "example": {
  16. "type": "input",
  17. "datasource_id": 1,
  18. "node_uuid": "77a6e831-bb62-42e1-be8d-97699db00e73",
  19. "table": "jm_homework_datasource_relation",
  20. }
  21. }
  22. class JmHomeworkDatasourceRelation(JmHomeworkDatasourceRelationBase):
  23. id: int
  24. # 作业id
  25. homework_id: int
  26. class Config:
  27. orm_mode = True