msg.py 882 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. """
  4. demeter database
  5. name:msg.py
  6. author:rabin
  7. mqtt里的key:msg/type_key/farm_id/uid,value
  8. """
  9. from __load__ import *
  10. class Msg(Base):
  11. __table__ = 'msg'
  12. __comment__ = '消息表'
  13. id = Fields(type='uuid', primaryKey=True, comment='消息ID', uuid='farm_id')
  14. farm_id = Fields(type='int', default='setting.farm', comment='园区ID')
  15. uid = Fields(type='uuid', comment='用户ID')
  16. type_id = Fields(type='int', comment='分类ID')
  17. link = Fields(type='varchar(255)', comment='消息链接')
  18. content = Fields(type='text', comment='消息内容')
  19. push = Fields(type='varchar(50)', comment='推送')
  20. status = Fields(type='boolean', default='False', comment='是否已读')
  21. state = Fields(type='boolean', default='True', comment='数据存在状态')
  22. cdate = Fields(type='int', default='time', comment='创建时间')