32 lines
2.2 KiB
Python
32 lines
2.2 KiB
Python
from django.db import models
|
|||
|
|
|
||
|
|
from wechat_数据库.用户数据库.小程序登陆用户 import models_app_name
|
||
|
|
from wechat_数据库.雪花算法.雪花算法工具 import generator
|
||
|
|
|
||
|
|
|
||
|
|
class wecom企微群(models.Model):
|
||
|
|
"""城市信息表"""
|
||
|
|
objects = models.Manager() #
|
||
|
|
idKeyWecom企微群 = models.CharField(primary_key=True, default=generator.generate_str, )
|
||
|
|
chat_id群 = models.CharField(max_length=128, )
|
||
|
|
chat群名称 = models.CharField(max_length=128, blank=True, null=True, )
|
||
|
|
chat群主ID = models.CharField(max_length=128, blank=True, null=True, )
|
||
|
|
chat群成员外部好友external_userid = models.CharField(max_length=128, blank=True, null=True, )
|
||
|
|
chat群成员外部好友unionid = models.CharField(max_length=128, blank=True, null=True, )
|
||
|
|
chat群成员外部好友名称 = models.CharField(max_length=128, blank=True, null=True, ) # 如果是微信用户,则返回其在微信中设置的名字
|
||
|
|
chat群成员外部好友群名称 = models.CharField(max_length=128, blank=True, null=True, )
|
||
|
|
chat群成员外部好友类型 = models.IntegerField(blank=True, null=True, )
|
||
|
|
# 1 - 由群成员邀请入群(直接邀请入群) 2 - 由群成员邀请入群(通过邀请链接入群) 3 - 通过扫描群二维码入群
|
||
|
|
chat群成员外部好友加入方式 = models.IntegerField(blank=True, null=True, )
|
||
|
|
chat群成员外部好友邀请者 = models.CharField(max_length=128, blank=True, null=True, ) # 邀请者目前仅当是由本企业内部成员邀请入群时会返回该值
|
||
|
|
chat群管理员列表 = models.JSONField(default=list)
|
||
|
|
chat群创建时间 = models.IntegerField(blank=True, null=True, ) # 时间戳
|
||
|
|
chat群成员加入时间 = models.IntegerField(blank=True, null=True, )
|
||
|
|
dateAndTime = models.DateTimeField(auto_now_add=True, db_comment="创建时间") # 数据创建时间
|
||
|
|
updateTime = models.DateTimeField(auto_now=True, db_comment="更新时间") # 更新时间(需要用 save() )
|
||
|
|
|
||
|
|
class Meta:
|
||
|
|
db_table = "wecom企微群" # 给数据表自定义一个名称;默认的会是在 应用名+类名
|
||
|
|
app_label = models_app_name
|
||
|
|
ordering = ["-dateAndTime", "-updateTime"]
|