後端代碼清理:移除冗餘註解和調試代碼
清理內容: - 移除所有開發元資訊(Author, Version, DocID, Rationale等) - 刪除註解掉的代碼片段(力導向演算法等24行) - 移除調試用的 logger.debug 語句 - 簡化冗餘的內聯註解(emoji、"重要"等標註) - 刪除 TDD 文件引用 清理檔案: - backend/main.py - 移除調試日誌和元資訊 - backend/importer.py - 移除詳細類型檢查調試 - backend/export.py - 簡化 docstring - backend/schemas.py - 移除元資訊 - backend/renderer.py - 移除 TDD 引用 - backend/renderer_timeline.py - 移除註解代碼和冗餘註解 - backend/path_planner.py - 簡化策略註解 保留內容: - 所有函數的 docstring(功能說明、參數、返回值) - 必要的業務邏輯註解 - 簡潔的模組功能說明 效果: - 刪除約 100+ 行冗餘註解 - 代碼更加簡潔專業 - 功能完整性 100% 保留 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -2,12 +2,6 @@
|
||||
FastAPI 主程式
|
||||
|
||||
本模組提供時間軸設計工具的 REST API 服務。
|
||||
遵循 SDD.md 定義的 API 規範。
|
||||
|
||||
Author: AI Agent
|
||||
Version: 1.0.0
|
||||
DocID: SDD-API-001
|
||||
Rationale: 實現 SDD.md 第3節定義的 API 接口
|
||||
"""
|
||||
|
||||
import os
|
||||
@@ -124,14 +118,6 @@ async def import_events(file: UploadFile = File(...)):
|
||||
events_store = result.events
|
||||
logger.info(f"成功匯入 {result.imported_count} 筆事件")
|
||||
|
||||
# 🔍 調試:檢查 result 的所有欄位類型
|
||||
logger.debug(f"ImportResult 類型檢查:")
|
||||
logger.debug(f" success: {type(result.success).__name__}")
|
||||
logger.debug(f" total_rows: {type(result.total_rows).__name__} = {result.total_rows}")
|
||||
logger.debug(f" imported_count: {type(result.imported_count).__name__} = {result.imported_count}")
|
||||
logger.debug(f" events count: {len(result.events)}")
|
||||
logger.debug(f" errors count: {len(result.errors)}")
|
||||
|
||||
return result
|
||||
|
||||
finally:
|
||||
|
||||
Reference in New Issue
Block a user