refactor(core): 优化权限管理和事件模型
- 重构 AdminManager 和 PermissionManager 以 Redis 为主要数据源 - 为所有事件模型添加 slots=True 提升性能 - 更新文档说明 Mypyc 编译注意事项 - 清理测试和调试文件 - 移动静态资源到 web_static 目录
This commit is contained in:
@@ -21,7 +21,7 @@ class NoticeEvent(OneBotEvent):
|
||||
return EventType.NOTICE
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True)
|
||||
class FriendAddNoticeEvent(NoticeEvent):
|
||||
"""
|
||||
好友添加通知
|
||||
@@ -30,7 +30,7 @@ class FriendAddNoticeEvent(NoticeEvent):
|
||||
"""新好友 QQ 号"""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True)
|
||||
class FriendRecallNoticeEvent(NoticeEvent):
|
||||
"""
|
||||
好友消息撤回通知
|
||||
@@ -42,7 +42,7 @@ class FriendRecallNoticeEvent(NoticeEvent):
|
||||
"""被撤回的消息 ID"""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True)
|
||||
class GroupNoticeEvent(NoticeEvent):
|
||||
"""
|
||||
群组通知事件基类
|
||||
@@ -54,7 +54,7 @@ class GroupNoticeEvent(NoticeEvent):
|
||||
"""用户 QQ 号"""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True)
|
||||
class GroupRecallNoticeEvent(GroupNoticeEvent):
|
||||
"""
|
||||
群消息撤回通知
|
||||
@@ -66,7 +66,7 @@ class GroupRecallNoticeEvent(GroupNoticeEvent):
|
||||
"""被撤回的消息 ID"""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True)
|
||||
class GroupIncreaseNoticeEvent(GroupNoticeEvent):
|
||||
"""
|
||||
群成员增加通知
|
||||
@@ -82,7 +82,7 @@ class GroupIncreaseNoticeEvent(GroupNoticeEvent):
|
||||
"""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True)
|
||||
class GroupDecreaseNoticeEvent(GroupNoticeEvent):
|
||||
"""
|
||||
群成员减少通知
|
||||
@@ -100,7 +100,7 @@ class GroupDecreaseNoticeEvent(GroupNoticeEvent):
|
||||
"""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True)
|
||||
class GroupAdminNoticeEvent(GroupNoticeEvent):
|
||||
"""
|
||||
群管理员变动通知
|
||||
@@ -113,7 +113,7 @@ class GroupAdminNoticeEvent(GroupNoticeEvent):
|
||||
"""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True)
|
||||
class GroupBanNoticeEvent(GroupNoticeEvent):
|
||||
"""
|
||||
群禁言通知
|
||||
@@ -132,7 +132,7 @@ class GroupBanNoticeEvent(GroupNoticeEvent):
|
||||
"""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True)
|
||||
class GroupUploadFile:
|
||||
"""
|
||||
群文件信息
|
||||
@@ -150,7 +150,7 @@ class GroupUploadFile:
|
||||
"""文件总线 ID"""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True)
|
||||
class GroupUploadNoticeEvent(GroupNoticeEvent):
|
||||
"""
|
||||
群文件上传通知
|
||||
@@ -159,7 +159,7 @@ class GroupUploadNoticeEvent(GroupNoticeEvent):
|
||||
"""文件信息"""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True)
|
||||
class NotifyNoticeEvent(NoticeEvent):
|
||||
"""
|
||||
系统通知事件基类 (notify)
|
||||
@@ -175,7 +175,7 @@ class NotifyNoticeEvent(NoticeEvent):
|
||||
"""发送者 QQ 号"""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True)
|
||||
class PokeNotifyEvent(NotifyNoticeEvent):
|
||||
"""
|
||||
戳一戳通知
|
||||
@@ -187,7 +187,7 @@ class PokeNotifyEvent(NotifyNoticeEvent):
|
||||
"""群号 (如果是群内戳一戳)"""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True)
|
||||
class LuckyKingNotifyEvent(NotifyNoticeEvent):
|
||||
"""
|
||||
群红包运气王通知
|
||||
@@ -199,7 +199,7 @@ class LuckyKingNotifyEvent(NotifyNoticeEvent):
|
||||
"""运气王 QQ 号"""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True)
|
||||
class HonorNotifyEvent(NotifyNoticeEvent):
|
||||
"""
|
||||
群荣誉变更通知
|
||||
@@ -216,7 +216,7 @@ class HonorNotifyEvent(NotifyNoticeEvent):
|
||||
"""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True)
|
||||
class GroupCardNoticeEvent(GroupNoticeEvent):
|
||||
"""
|
||||
群成员名片更新通知
|
||||
@@ -228,7 +228,7 @@ class GroupCardNoticeEvent(GroupNoticeEvent):
|
||||
"""旧名片"""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True)
|
||||
class OfflineFile:
|
||||
"""
|
||||
离线文件信息
|
||||
@@ -243,7 +243,7 @@ class OfflineFile:
|
||||
"""下载链接"""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True)
|
||||
class OfflineFileNoticeEvent(NoticeEvent):
|
||||
"""
|
||||
接收离线文件通知
|
||||
@@ -255,7 +255,7 @@ class OfflineFileNoticeEvent(NoticeEvent):
|
||||
"""文件数据"""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True)
|
||||
class ClientStatus:
|
||||
"""
|
||||
客户端状态
|
||||
@@ -267,7 +267,7 @@ class ClientStatus:
|
||||
"""状态描述"""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True)
|
||||
class ClientStatusNoticeEvent(NoticeEvent):
|
||||
"""
|
||||
其他客户端在线状态变更通知
|
||||
@@ -276,7 +276,7 @@ class ClientStatusNoticeEvent(NoticeEvent):
|
||||
"""客户端信息"""
|
||||
|
||||
|
||||
@dataclass
|
||||
@dataclass(slots=True)
|
||||
class EssenceNoticeEvent(GroupNoticeEvent):
|
||||
"""
|
||||
精华消息变动通知
|
||||
|
||||
Reference in New Issue
Block a user