feat(content): GET /admin/content/{id} 详情(编辑回填)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user