style: 格式化代码

This commit is contained in:
John Richard
2025-10-02 19:38:39 +08:00
parent d5627b0661
commit ecb02cae31
111 changed files with 2344 additions and 2316 deletions

View File

@@ -1,4 +1,3 @@
import asyncio
import copy
import datetime
import hashlib
@@ -145,7 +144,7 @@ class PersonInfoManager:
except Exception as e:
logger.error(f"根据用户名 {person_name} 获取用户ID时出错: {e}")
return ""
@staticmethod
async def first_knowing_some_one(platform: str, user_id: str, user_nickname: str, user_cardname: str):
"""判断是否认识某人"""
@@ -166,7 +165,7 @@ class PersonInfoManager:
await person_info_manager.update_one_field(
person_id=person_id, field_name="nickname", value=user_nickname, data=data
)
@staticmethod
async def create_person_info(person_id: str, data: Optional[dict] = None):
"""创建一个项"""
@@ -491,7 +490,9 @@ class PersonInfoManager:
async def _db_check_name_exists_async(name_to_check):
async with get_db_session() as session:
result = await session.execute(select(PersonInfo).where(PersonInfo.person_name == name_to_check))
result = await session.execute(
select(PersonInfo).where(PersonInfo.person_name == name_to_check)
)
record = result.scalar()
return record is not None
@@ -552,7 +553,6 @@ class PersonInfoManager:
else:
logger.debug(f"删除失败:未找到 person_id={person_id} 或删除未影响行")
@staticmethod
async def get_value(person_id: str, field_name: str) -> Any:
"""获取单个字段值(同步版本)"""
@@ -623,6 +623,7 @@ class PersonInfoManager:
result[field_name] = copy.deepcopy(person_info_default.get(field_name))
return result
@staticmethod
async def get_specific_value_list(
field_name: str,
@@ -694,7 +695,7 @@ class PersonInfoManager:
return record, False # 其他协程已创建,返回现有记录
# 如果仍然失败,重新抛出异常
raise e
unique_nickname = await self._generate_unique_person_name(nickname)
initial_data = {
"person_id": person_id,