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

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