feat: mo_data.py unified read layer (DB-first, JSON fallback) + cash_log table + batch JSON→DB migration (16 files)

This commit is contained in:
知微
2026-07-01 23:45:30 +08:00
parent 864d924012
commit 6305204c7a
52 changed files with 16351 additions and 11643 deletions
+2 -1
View File
@@ -11,6 +11,7 @@ from datetime import datetime
from urllib.request import urlopen, Request
from concurrent.futures import ThreadPoolExecutor, as_completed
from threading import Semaphore
from mo_data import read_portfolio, read_decisions, read_watchlist
DATA_DIR = "/home/hmo/web-dashboard/data"
DECISIONS_PATH = f"{DATA_DIR}/decisions.json"
@@ -135,7 +136,7 @@ def main():
codes = set()
# 读取持仓+自选
try:
dec = json.load(open(DECISIONS_PATH))
dec = mo_data.read_decisions()
for d in dec.get("decisions", []):
c = d.get("code", "")
if c: