更新消息存储和查询逻辑,支持MongoDB风格的操作符,修改消息ID字段类型为TextField

This commit is contained in:
墨梓柒
2025-05-15 19:03:47 +08:00
parent 4c2cfd5c73
commit a18524ce61
4 changed files with 74 additions and 28 deletions

View File

@@ -122,7 +122,7 @@ class Messages(BaseModel):
用于存储消息数据的模型。
"""
message_id = IntegerField(index=True) # 消息 ID
message_id = TextField(index=True) # 消息 ID (更改自 IntegerField)
time = DoubleField() # 消息时间戳
chat_id = TextField(index=True) # 对应的 ChatStreams stream_id
@@ -208,7 +208,7 @@ class PersonInfo(BaseModel):
"""
person_id = TextField(unique=True, index=True) # 个人唯一ID
person_name = TextField() # 个人名称
person_name = TextField(null=True) # 个人名称 (允许为空)
name_reason = TextField(null=True) # 名称设定的原因
platform = TextField() # 平台
user_id = TextField(index=True) # 用户ID