fix: 修复代码审查P2/P3问题

P2:
- lottery.py 改为引用 history_loader.py 公共模块,删除独立 Excel 加载逻辑
- 删除 lottery.py 中不再使用的 _normalize_history_format 方法(已迁移到 history_loader)

P3:
- app.py: 删除未使用的 import shutil
- app.py: 删除不可达代码 return stats
- app.py: 修复 api_history 中奇偶形态字段映射错误(奇偶比→奇偶形态)
- app.py: api_history columns 列表补充奇偶比和奇偶形态字段
- 开发文档目录结构补充 history_loader.py 和 web_executor.py 废弃标记

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
2026-07-04 09:21:43 +08:00
parent 5cebbfa433
commit 462f1505ee
3 changed files with 16 additions and 134 deletions
+3 -5
View File
@@ -10,7 +10,6 @@ import os
import sys
import json
import uuid
import shutil
import traceback
import threading
from datetime import datetime
@@ -207,8 +206,6 @@ def get_statistics_data(generator=None):
"""获取统计数据 — 委托公共模块计算"""
return compute_statistics(CONFIG['history_file'])
return stats
# ============================================================
# API:获取统计数据
@@ -379,7 +376,8 @@ def api_history():
'蓝球': row['蓝球'],
'开机号': str(row['开机号']),
'和值': str(row['和值特征']),
'奇偶形态': str(row['奇偶比']),
'奇偶': str(row['奇偶比']),
'奇偶形态': str(row['奇偶形态']),
'大小比': str(row['大小比']),
'跨度': str(row['跨度']),
}
@@ -392,7 +390,7 @@ def api_history():
'total': total,
'page': page,
'page_size': page_size,
'columns': ['开奖日期', '期号', '红球', '蓝球', '开机号', '和值', '大小比', '跨度']
'columns': ['开奖日期', '期号', '红球', '蓝球', '开机号', '和值', '奇偶比', '奇偶形态', '大小比', '跨度']
}
})
except Exception as e: