邓淳远、崔鹏宇、翁思扬组云计算期末项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.7 KiB

  1. from sqlalchemy import Column, Integer, String, Text
  2. from APP.view.database import Base
  3. class Users(Base):
  4. __tablename__ = 'users'
  5. phonenum = Column(String(255), primary_key=True)
  6. password = Column(String(255))
  7. name = Column(String(255))
  8. def __init__(self, name=None, password=None, phonenum=None):
  9. self.name = name
  10. self.password = password
  11. self.phonenum = phonenum
  12. class Collection(Base):
  13. __tablename__ = 'collection'
  14. id = Column(String(255), primary_key=True)
  15. name = Column(String(255))
  16. tag = Column(String(255))
  17. phonenum = Column(String(255))
  18. like = Column(Integer)
  19. def __init__(self, id=None, name=None, tag=None, phonenum=None, like=0):
  20. self.id = id
  21. self.name = name
  22. self.tag = tag
  23. self.phonenum = phonenum
  24. self.like = like
  25. class Block(Base):
  26. __tablename__ = 'block'
  27. id = Column(String(255), primary_key=True)
  28. content = Column(String(255))
  29. # type = Column(String(255))
  30. def __init__(self, id=None, content=None):
  31. self.id = id
  32. self.content = content
  33. class CollectionBlock(Base):
  34. __tablename__ = 'collection_block'
  35. id = Column(String(255), primary_key=True)
  36. # password = Column(String(255))
  37. block_id = Column(String(255))
  38. def __init__(self, id=None, block_id=None):
  39. self.id = id
  40. self.block_id = block_id
  41. class UserLike(Base):
  42. __tablename__ = 'user_like'
  43. phonenum = Column(String(255), primary_key=True)
  44. collection_id = Column(String(255), primary_key=True)
  45. def __init__(self, phonenum=None, collection_id=None):
  46. self.phonenum = phonenum
  47. self.collection_id = collection_id