models.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. from pydantic import BaseModel
  2. from typing import List, Optional
  3. SECRET_KEY = "df2f77bd544240801a048bd4293afd8eeb7fff3cb7050e42c791db4b83ebadcd"
  4. ALGORITHM = "HS256"
  5. class Token(BaseModel):
  6. access_token: str
  7. token_type: str
  8. class swap_req(BaseModel):
  9. imgurl: str
  10. class request(BaseModel):
  11. name: str
  12. text_content: List[str]
  13. image_urls: List[str]
  14. avatar: str
  15. client_id :str
  16. multiLang :int
  17. class request_normal():
  18. name: str
  19. text_content: List[str]
  20. image_urls: List[str]
  21. avatar: str
  22. client_id :str
  23. multiLang :int
  24. class gSlide_req(BaseModel):
  25. slide_url: str
  26. avatar: str
  27. client_id :str
  28. multiLang :int
  29. url_type: int
  30. class request_eng(BaseModel):
  31. name: str
  32. text_content: List[str]
  33. image_urls: List[str]
  34. sub_titles: List[str]
  35. avatar: str
  36. client_id :str
  37. # AuthJWT setting
  38. class Settings(BaseModel):
  39. authjwt_secret_key: str = SECRET_KEY
  40. authjwt_token_location: set = {"cookies"}
  41. authjwt_cookie_secure: bool = False
  42. authjwt_cookie_csrf_protect: bool = True
  43. class User(BaseModel):
  44. username: str
  45. email: str
  46. password: str
  47. token: Optional[str] = None
  48. class TokenData(BaseModel):
  49. username: Optional[str] = None
  50. class phone(BaseModel):
  51. price: int
  52. class register_req(BaseModel):
  53. username: str
  54. email: str
  55. password: str