feat: complete image console and add verified REST and MCP workflows

This commit is contained in:
2026-11-04 00:41:54 +08:00
parent 3140cd51d2
commit bef8af53ed
48 changed files with 5167 additions and 1176 deletions
+34
View File
@@ -0,0 +1,34 @@
"""画廊 API。"""
from __future__ import annotations
from fastapi import APIRouter, HTTPException
from ..services import gallery as svc
from ..providers import ProviderError
router = APIRouter(prefix="/api/galleries", tags=["gallery"])
@router.get("")
def list_galleries():
return svc.list_galleries()
@router.get("/{profile_name}")
def list_gallery(profile_name: str):
try:
return svc.list_gallery(profile_name)
except ProviderError as exc:
raise HTTPException(status_code=exc.status, detail=exc.message)
@router.delete("/{profile_name}/{filename}")
def delete_gallery_item(profile_name: str, filename: str):
try:
svc.delete_gallery_item(profile_name, filename)
except FileNotFoundError as exc:
raise HTTPException(status_code=404, detail=str(exc))
except ProviderError as exc:
raise HTTPException(status_code=exc.status, detail=exc.message)
return {"ok": True}