Ship native iOS app, Wiki/TTS backend, and skeleton loading UX.
Replace the WebView shell with SwiftUI screens, add account-scoped Wiki and TTS APIs with adaptive review and photo scan support, and keep web/iOS pages usable while data loads asynchronously. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
from fastapi import APIRouter, Depends, HTTPException
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from auth import get_current_user
|
||||
from database import get_db
|
||||
from models import User
|
||||
from schemas import WikiGraphOut, WikiSettingsUpdate, WikiStatusOut
|
||||
from services.wiki_llm_quota_service import WikiLlmQuotaExceeded
|
||||
from services.wiki_service import wiki_service
|
||||
|
||||
router = APIRouter(prefix="/api/wiki", tags=["wiki"])
|
||||
|
||||
|
||||
@router.get("/status", response_model=WikiStatusOut)
|
||||
def get_wiki_status(
|
||||
db: Session = Depends(get_db),
|
||||
current_user: User = Depends(get_current_user),
|
||||
):
|
||||
return wiki_service.status(db, current_user)
|
||||
|
||||
|
||||
@router.get("/graph", response_model=WikiGraphOut)
|
||||
def get_wiki_graph(
|
||||
db: Session = Depends(get_db),
|
||||
current_user: User = Depends(get_current_user),
|
||||
):
|
||||
return wiki_service.graph(db, current_user)
|
||||
|
||||
|
||||
@router.patch("/settings", response_model=WikiStatusOut)
|
||||
def update_wiki_settings(
|
||||
data: WikiSettingsUpdate,
|
||||
db: Session = Depends(get_db),
|
||||
current_user: User = Depends(get_current_user),
|
||||
):
|
||||
return wiki_service.update_settings(
|
||||
db,
|
||||
current_user,
|
||||
enabled=data.enabled,
|
||||
auto_organize=data.auto_organize,
|
||||
)
|
||||
|
||||
|
||||
@router.post("/rebuild", response_model=WikiStatusOut)
|
||||
def rebuild_wiki(
|
||||
db: Session = Depends(get_db),
|
||||
current_user: User = Depends(get_current_user),
|
||||
):
|
||||
try:
|
||||
return wiki_service.rebuild(db, current_user)
|
||||
except WikiLlmQuotaExceeded as exc:
|
||||
raise HTTPException(status_code=429, detail=str(exc)) from exc
|
||||
Reference in New Issue
Block a user