Add word-book practice, iOS app shell, and fix embedded WebView blank screen.

Ship dual-track learning (daily accumulation vs textbook),沪教/商务词书 APIs and UI, native iOS wrapper with bundled H5, and production book import on deploy.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-06-06 21:09:27 +08:00
parent 2fae90b597
commit e76fa586f1
76 changed files with 47488 additions and 445 deletions
+16 -4
View File
@@ -216,13 +216,25 @@ class MemoryCoachService:
t.revealed = True
return tokens
def start_session(self, db: Session, user: User) -> CoachSessionResponse:
settings = quiz_service.get_settings(db, user)
words = quiz_service.select_daily_words(db, user, settings.daily_target)
def start_session(self, db: Session, user: User, track: str = "accumulation") -> CoachSessionResponse:
from services.book_service import book_service
if track == "book":
book = book_service.get_active_book(db, user)
if not book:
return CoachSessionResponse(words=[], total=0)
book_service.ensure_user_book_words(db, user, book)
practice = book_service.practice_settings_dict(db, user, book)
words = quiz_service.select_book_words(db, user, book, practice["daily_target"])
book_id = book.id
else:
settings = quiz_service.get_settings(db, user)
words = quiz_service.select_accumulation_words(db, user, settings.daily_target)
book_id = 0
if not words:
return CoachSessionResponse(words=[], total=0)
summaries = memory_visual_service.get_visualization(db, user)["words"]
summaries = memory_visual_service.get_visualization(db, user, book_id=book_id)["words"]
risk_map = {w["id"]: w.get("retention_now", 0) for w in summaries}
items = [