mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-07 21:00:21 +08:00
♻️ refactor(scheduler): 重构定时任务服务架构并增强用户体验 (#1967)
**架构重构** - 拆分为 Service、Repository、Adapter 三层架构,提升模块化 - 统一 APScheduler Job ID 生成方式,优化 ScheduleTargeter 逻辑 **新增功能** - 支持定时任务时区配置 - 新增"运行中"任务状态显示 - 为"所有群组"任务增加随机延迟,分散并发压力 **用户体验优化** - 重构操作反馈消息,提供详细的成功提示卡片 - 优化任务查看命令的筛选逻辑 - 统一删除、暂停、恢复、执行、更新操作的响应格式 Co-authored-by: webjoin111 <455457521@qq.com>
This commit is contained in:
@@ -1,3 +1,14 @@
|
||||
"""
|
||||
Zhenxun Bot - 核心服务模块
|
||||
|
||||
主要服务包括:
|
||||
- 数据库上下文 (db_context): 提供数据库模型基类和连接管理。
|
||||
- 日志服务 (log): 提供增强的、带上下文的日志记录器。
|
||||
- LLM服务 (llm): 提供与大语言模型交互的统一API。
|
||||
- 插件生命周期管理 (plugin_init): 支持插件安装和卸载时的钩子函数。
|
||||
- 定时任务调度器 (scheduler): 提供持久化的、可管理的定时任务服务。
|
||||
"""
|
||||
|
||||
from nonebot import require
|
||||
|
||||
require("nonebot_plugin_apscheduler")
|
||||
@@ -6,3 +17,33 @@ require("nonebot_plugin_session")
|
||||
require("nonebot_plugin_htmlrender")
|
||||
require("nonebot_plugin_uninfo")
|
||||
require("nonebot_plugin_waiter")
|
||||
|
||||
from .db_context import Model, disconnect
|
||||
from .llm import (
|
||||
AI,
|
||||
LLMContentPart,
|
||||
LLMException,
|
||||
LLMMessage,
|
||||
get_model_instance,
|
||||
list_available_models,
|
||||
tool_registry,
|
||||
)
|
||||
from .log import logger
|
||||
from .plugin_init import PluginInit, PluginInitManager
|
||||
from .scheduler import scheduler_manager
|
||||
|
||||
__all__ = [
|
||||
"AI",
|
||||
"LLMContentPart",
|
||||
"LLMException",
|
||||
"LLMMessage",
|
||||
"Model",
|
||||
"PluginInit",
|
||||
"PluginInitManager",
|
||||
"disconnect",
|
||||
"get_model_instance",
|
||||
"list_available_models",
|
||||
"logger",
|
||||
"scheduler_manager",
|
||||
"tool_registry",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user