邓淳远、崔鹏宇、翁思扬组云计算期末项目
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.

73 lines
2.0 KiB

  1. from sqlalchemy import Column, Integer, String, BLOB
  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. order = Column(Integer)
  20. def __init__(self, id=None, name=None, tag=None, phonenum=None, like=0, order=None):
  21. self.id = id
  22. self.name = name
  23. self.tag = tag
  24. self.phonenum = phonenum
  25. self.like = like
  26. self.order = order
  27. class Block(Base):
  28. __tablename__ = 'block'
  29. id = Column(String(255), primary_key=True)
  30. content_text = Column(String(255))
  31. content_pic = Column(BLOB)
  32. type = Column(Integer)
  33. order = Column(Integer)
  34. # type = Column(String(255))
  35. def __init__(self, id=None, content_text=None, content_pic=None, order=None, type=None):
  36. self.id = id
  37. self.content_text = content_text
  38. self.content_pic = content_pic
  39. self.type = type
  40. self.order = order
  41. class CollectionBlock(Base):
  42. __tablename__ = 'collection_block'
  43. id = Column(String(255), primary_key=True)
  44. # password = Column(String(255))
  45. block_id = Column(String(255))
  46. def __init__(self, id=None, block_id=None):
  47. self.id = id
  48. self.block_id = block_id
  49. class UserLike(Base):
  50. __tablename__ = 'user_like'
  51. phonenum = Column(String(255), primary_key=True)
  52. collection_id = Column(String(255), primary_key=True)
  53. state = Column(Integer)
  54. def __init__(self, phonenum=None, collection_id=None, state=None):
  55. self.phonenum = phonenum
  56. self.collection_id = collection_id
  57. self.state = state