data_management.py 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. from typing import List, Optional
  2. from pydantic import BaseModel
  3. class DataManagementBase(BaseModel):
  4. # 数据名称
  5. name: str
  6. class DataManagementCreate(DataManagementBase):
  7. dag_uuid: str
  8. node_id: str
  9. out_pin: str
  10. class Config:
  11. schema_extra = {
  12. "example": {
  13. "name": "test",
  14. "dag_uuid": "test",
  15. "node_id": "test",
  16. "out_pin": "0",
  17. }
  18. }
  19. class DataManagement(DataManagementBase):
  20. id: int
  21. # 表格名称
  22. table_name: str
  23. # 创建时间
  24. create_time: int
  25. # 创建人编号
  26. user_id: str
  27. # 创建人名称
  28. user_name: str
  29. # 项目编号
  30. project_id: str
  31. class Config:
  32. orm_mode = True
  33. class DataManagementSelect(BaseModel):
  34. table_name: str
  35. page: Optional[int] = 0
  36. size: Optional[int] = 100
  37. class Config:
  38. schema_extra = {
  39. "example": {
  40. "table_name": "train",
  41. "page": 0,
  42. "size": 100
  43. }
  44. }