resource.py 625 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. from typing import List, Union, Dict
  4. from pydantic import BaseModel, Field
  5. from schemas.base import DetailMixin
  6. class ResourceUrlDetail(DetailMixin):
  7. data: Dict[str, Union[List[str], int]] = None
  8. class NewResourceCollect(BaseModel):
  9. ctype: str
  10. rid: int
  11. uid: int
  12. utype: int
  13. class Config:
  14. anystr_strip_whitespace = True
  15. class CollectDetail(DetailMixin):
  16. pass
  17. class CollectInfo(BaseModel):
  18. opt: int = Field(..., description="操作类型,0=取消收藏,1=添加收藏")
  19. class Config:
  20. anystr_strip_whitespace = True