From 0264a35b8d18315e5fe7d3e0279232b87a3807c4 Mon Sep 17 00:00:00 2001 From: Timmy Date: Mon, 20 Apr 2026 11:15:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20/scan=20response=20=E5=A4=9A=E5=B8=B6?= =?UTF-8?q?=20generated=5Fat=EF=BC=8C=E8=AE=93=E5=89=8D=E7=AB=AF=E8=83=BD?= =?UTF-8?q?=E9=A1=AF=E7=A4=BA=E8=B3=87=E6=96=99=E6=9B=B4=E6=96=B0=E6=99=82?= =?UTF-8?q?=E9=96=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 從 Redis 快取內容讀取 fetcher 寫入時的時間戳(ISO8601 +08:00),原本 只放在 debug 區塊沒暴露。ScanResponse model 加對應 Optional[str] 欄位。 Co-Authored-By: Claude Opus 4.7 (1M context) --- pokemon_radar_api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pokemon_radar_api.py b/pokemon_radar_api.py index 2b3a9b1..bbd55a0 100644 --- a/pokemon_radar_api.py +++ b/pokemon_radar_api.py @@ -102,6 +102,7 @@ class ScanResponse(BaseModel): ttl: int count_raw: int count_filtered: int + generated_at: Optional[str] = None # fetcher 寫入 Redis 的時間(ISO8601 +08:00) items: List[Item] debug: Dict[str, Any] @@ -211,6 +212,7 @@ def scan(req: ScanRequest) -> Any: "ttl": ttl, "count_raw": len(items_raw), "count_filtered": len(items_filtered), + "generated_at": data.get("generated_at"), "items": items_filtered, "debug": debug_info }