增强AI插件

This commit is contained in:
2025-11-20 15:40:03 +08:00
parent b879a70325
commit 544b8071da
3 changed files with 711 additions and 32 deletions

View File

@@ -247,6 +247,20 @@ class WPSConfigAPI(WPSAPI):
row = cursor.fetchone()
return int(row["user_id"]) if row else None
def get_all_usernames(self) -> List[Dict[str, Any]]:
"""获取所有已设置用户名的用户列表
Returns:
包含 user_id 和 username 的字典列表
示例: [{"user_id": 123, "username": "张三"}, ...]
"""
cursor = get_db().conn.cursor()
cursor.execute(
"SELECT user_id, username FROM user_info WHERE username != '' AND username IS NOT NULL ORDER BY user_id ASC"
)
rows = cursor.fetchall()
return [{"user_id": row["user_id"], "username": row["username"]} for row in rows]
def get_user_url(self, user_id: int) -> Optional[str]:
record = self._get_user_record(user_id)
if not record: