From 5ed8f48afc2ba3a2a14b53c8a44fb6ecd7a41b2b Mon Sep 17 00:00:00 2001 From: liuwei Date: Wed, 17 Dec 2025 13:33:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A9=E6=B0=94=E8=AE=A2=E9=98=85=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/weather/main.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/weather/main.py b/plugins/weather/main.py index c5b1bd0..942cbb7 100644 --- a/plugins/weather/main.py +++ b/plugins/weather/main.py @@ -543,12 +543,11 @@ class WeatherPlugin(MessagePluginInterface): if not self.redis_manager: return try: today_fc = api_data.get('daily_forecast', [])[0] - data = { - "date": datetime.datetime.now().strftime("%Y-%m-%d"), - "tempMax": today_fc['tempMax'], - "tempMin": today_fc['tempMin'], - "text": today_fc['textDay'] - } + # 保存完整的接口数据 + data = today_fc.copy() + # 补充 date 字段,方便后续处理 + data["date"] = datetime.datetime.now().strftime("%Y-%m-%d") + self.redis_manager.save_history(city_id, data) except Exception as e: self.LOG.error(f"存档失败: {e}")