feat: GEO/SEO structured data + search ranking tracker
This commit is contained in:
@@ -114,7 +114,7 @@ def _aggregate_status_counts(q):
|
||||
return counts
|
||||
|
||||
@router.get("/status")
|
||||
def get_status(db: Session = Depends(get_db)):
|
||||
def get_status(db: Session = Depends(get_db), current_user=Depends(get_current_user)):
|
||||
total = db.query(Topic).count()
|
||||
counts = _aggregate_status_counts(db.query(Topic))
|
||||
today = date.today()
|
||||
@@ -243,15 +243,16 @@ def get_pipeline_status(db: Session = Depends(get_db), current_user=Depends(get_
|
||||
return {"topics_count": total, "status_distribution": counts, "pipeline_modules": pipeline_status}
|
||||
|
||||
@router.post("/sync/run")
|
||||
def run_sync():
|
||||
def run_sync(current_user=Depends(get_current_user)):
|
||||
try:
|
||||
sync_all_topics()
|
||||
return {"message": "Sync completed (DB → JSON backup)"}
|
||||
except Exception as e:
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
|
||||
@router.post("/optimize-sources/run")
|
||||
def trigger_optimize_sources():
|
||||
def trigger_optimize_sources(current_user=Depends(get_current_user)):
|
||||
try:
|
||||
from ..core.scheduler import scheduler
|
||||
def _bg():
|
||||
@@ -265,8 +266,9 @@ def trigger_optimize_sources():
|
||||
except Exception as e:
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
|
||||
@router.post("/metrics-sync/run")
|
||||
def trigger_metrics_sync():
|
||||
def trigger_metrics_sync(current_user=Depends(get_current_user)):
|
||||
try:
|
||||
from ..core.scheduler import scheduler
|
||||
def _bg():
|
||||
@@ -330,7 +332,7 @@ def list_automation_topics(db: Session = Depends(get_db), current_user=Depends(g
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
@router.post("/refresh")
|
||||
def refresh_all():
|
||||
def refresh_all(current_user=Depends(get_current_user)):
|
||||
try:
|
||||
sync_all_topics()
|
||||
return {"message": "Refresh completed"}
|
||||
|
||||
Reference in New Issue
Block a user