diff --git a/app/api/v1/clothing.py b/app/api/v1/clothing.py index 4aa1c8a..d1758ca 100644 --- a/app/api/v1/clothing.py +++ b/app/api/v1/clothing.py @@ -122,11 +122,12 @@ async def create_clothing( async def read_clothes( skip: int = Query(0, ge=0), limit: int = Query(100, ge=1, le=100), + category_id: int = Query(None, ge=0), db: AsyncSession = Depends(get_db), current_user: UserModel = Depends(get_current_user) ): """获取所有衣服""" - clothes = await clothing_service.get_clothes(db=db, skip=skip, limit=limit, user_id=current_user.id) + clothes = await clothing_service.get_clothes(db=db, skip=skip, limit=limit, user_id=current_user.id, category_id=category_id) # 手动返回标准响应格式 return StandardResponse(code=200, data=[Clothing.model_validate(clothing) for clothing in clothes])