feat(content): GET /admin/content/{id} 详情(编辑回填)

This commit is contained in:
Pine
2026-08-27 14:56:21 +08:00
parent 74d50c829d
commit b80fba6150
+12
View File
@@ -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,