全新的process方法完成(Message其他部分仍未完成);对应测试;调整部分注释;数据库检索优化
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from maim_message import MessageBase, Seg
|
||||
from typing import List, Tuple, Optional
|
||||
from typing import List, Tuple, Optional, Sequence
|
||||
|
||||
import base64
|
||||
import hashlib
|
||||
@@ -35,7 +35,7 @@ class MessageUtils:
|
||||
def from_maim_message_segments_to_MaiSeq(message: "MessageBase") -> MessageSequence:
|
||||
"""从maim_message.MessageBase.message_segment转换为MessageSequence"""
|
||||
raw_msg_seq = message.message_segment
|
||||
components: List[StandardMessageComponents] = []
|
||||
components: Sequence[StandardMessageComponents] = []
|
||||
if not raw_msg_seq:
|
||||
return MessageSequence(components)
|
||||
if raw_msg_seq.type == "seglist":
|
||||
|
||||
@@ -20,7 +20,7 @@ class PersonUtils:
|
||||
"""根据person_id获取用户信息"""
|
||||
try:
|
||||
with get_db_session() as session:
|
||||
statement = select(PersonInfo).filter_by(person_id=person_id)
|
||||
statement = select(PersonInfo).filter_by(person_id=person_id).limit(1)
|
||||
if result := session.exec(statement).first():
|
||||
return MaiPersonInfo.from_db_instance(result)
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user