From ce7b954f68d1b8fd40bb9bd80711c0c011b92c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A2=A8=E6=A2=93=E6=9F=92?= <1787882683@qq.com> Date: Wed, 31 Dec 2025 01:36:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0Bot=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=88=B0=E5=B9=B4=E5=BA=A6=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=A8=A1=E5=9E=8B=EF=BC=8C=E5=B9=B6=E5=9C=A8?= =?UTF-8?q?=E7=94=9F=E6=88=90=E6=8A=A5=E5=91=8A=E6=97=B6=E8=8E=B7=E5=8F=96?= =?UTF-8?q?Bot=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/webui/annual_report_routes.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/webui/annual_report_routes.py b/src/webui/annual_report_routes.py index 93d6e8d6..ff3ec00f 100644 --- a/src/webui/annual_report_routes.py +++ b/src/webui/annual_report_routes.py @@ -113,6 +113,7 @@ class AnnualReportData(BaseModel): """年度报告完整数据""" year: int = Field(2025, description="报告年份") + bot_name: str = Field("麦麦", description="Bot名称") generated_at: str = Field(..., description="报告生成时间") time_footprint: TimeFootprintData = Field(default_factory=TimeFootprintData) social_network: SocialNetworkData = Field(default_factory=SocialNetworkData) @@ -854,7 +855,12 @@ async def get_full_annual_report(year: int = 2025, _auth: bool = Depends(require 完整的年度报告数据 """ try: + from src.config.config import global_config + logger.info(f"开始生成 {year} 年度报告...") + + # 获取 bot 名称 + bot_name = global_config.bot.nickname or "麦麦" # 并行获取各维度数据 time_footprint = await get_time_footprint(year) @@ -865,6 +871,7 @@ async def get_full_annual_report(year: int = 2025, _auth: bool = Depends(require report = AnnualReportData( year=year, + bot_name=bot_name, generated_at=datetime.now().strftime("%Y-%m-%d %H:%M:%S"), time_footprint=time_footprint, social_network=social_network,