From b80fba6150f29d51668995b4a6fed2bb48233420 Mon Sep 17 00:00:00 2001 From: Pine Date: Thu, 27 Aug 2026 14:56:21 +0800 Subject: [PATCH] =?UTF-8?q?feat(content):=20GET=20/admin/content/{id}=20?= =?UTF-8?q?=E8=AF=A6=E6=83=85(=E7=BC=96=E8=BE=91=E5=9B=9E=E5=A1=AB)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/routers/rbac_operator.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/api/routers/rbac_operator.py b/app/api/routers/rbac_operator.py index 57aa199..3cda834 100644 --- a/app/api/routers/rbac_operator.py +++ b/app/api/routers/rbac_operator.py @@ -202,6 +202,18 @@ async def list_content( return await db.content.list(ctype=ctype, status=status) +@router.get("/content/{content_id}", summary="内容详情(编辑回填)") +async def get_content( + content_id: str, + db: Database = Depends(get_db), + _u: dict = Depends(require_roles("operator")), +): + item = await db.content.get(content_id) + if item is None: + raise HTTPException(status_code=404, detail="Content not found") + return item + + @router.post("/content", summary="创建内容") async def create_content( req: ContentCreateRequest,