models.py 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. from sqlmodel import Field, SQLModel
  2. # Generic message
  3. class Message(SQLModel):
  4. message: str
  5. # JSON payload containing access token
  6. class Token(SQLModel):
  7. access_token: str
  8. token_type: str = "bearer"
  9. # Contents of JWT token
  10. class TokenPayload(SQLModel):
  11. sub: int | None = None
  12. class NewPassword(SQLModel):
  13. token: str
  14. new_password: str
  15. class Setting(SQLModel, table=True):
  16. id: int | None = Field(default=None, primary_key=True)
  17. key: str
  18. value: str
  19. describle: str | None = None
  20. wxapp_id: int | None = None
  21. update_time: str | None = None
  22. class Wxapp(SQLModel, table=True):
  23. id: int | None = Field(default=None, primary_key=True)
  24. app_id: str
  25. app_secret: str
  26. mchid: str | None = None
  27. api_key: str | None = None
  28. private_key: str | None = None
  29. cert_pem: str | None = None
  30. key_pem: str | None = None
  31. link_name: str | None = None
  32. link_phone: str | None = None
  33. end_time: str | None = None
  34. is_local: int | None = None
  35. plus_id: int | None = None
  36. update_time: str | None = None
  37. class AppsMode(SQLModel, table=True):
  38. id: int | None = Field(default=None, primary_key=True)
  39. title: str
  40. image_id: int | None = None
  41. name: str | None = None
  42. param: str | None = None
  43. is_delete: int | None = None
  44. state: int | None = None
  45. create_time: str | None = None
  46. update_time: str | None = None
  47. wxapp_id: int | None = None
  48. command: str | None = None
  49. tips_txt: str | None = None
  50. sort: int | None = None
  51. is_default: int | None = None
  52. remarks: str | None = None
  53. class AppsLoop(SQLModel, table=True):
  54. id: int | None = Field(default=None, primary_key=True)
  55. keys: str
  56. fail_num: int | None = None
  57. success_num: int | None = None
  58. class MjJobs(SQLModel, table=True):
  59. id: int | None = Field(default=None, primary_key=True)
  60. user_id: int
  61. class Platform(SQLModel, table=True):
  62. id: int | None = Field(default=None, primary_key=True)
  63. name: str
  64. type: int | None = None
  65. sort: int | None = None
  66. # class Seller(SQLModel, table=True):
  67. # id: str
  68. # open_id: str
  69. # password: str
  70. # nick_name: str | None = None
  71. # avatar_url: str | None = None
  72. # gender: int | None = None
  73. # country: str | None = None
  74. # city: str | None = None
  75. # address_id: int | None = None
  76. # balance: float | None = None
  77. # points: int | None = None
  78. # total_money: float | None = None
  79. # withdraw_money: float | None = None
  80. # pay_money: float | None = None
  81. # expand_money: float | None = None
  82. # gradle_id: int | None = None
  83. # second: int | None = None
  84. # card_type: int | None = None
  85. # pople: int | None = None
  86. # end_time: str | None = None
  87. class Question(SQLModel, table=True):
  88. id: int | None = Field(default=None, primary_key=True)
  89. user_id: int
  90. session_id: str | None = Field(default=None, description="chatgpt会话ID")
  91. id: int | None = Field(
  92. default=None, primary_key=True, description="The unique identifier"
  93. )
  94. name: str | None = Field(description="The name of the item")
  95. description: str | None = Field(description="The description of the item")