feat: 增加菜地搜索功能

This commit is contained in:
2026-09-10 15:27:47 +08:00
parent 8b563e8249
commit fc58e8ee21
3 changed files with 25 additions and 10 deletions

View File

@@ -15,8 +15,8 @@ def create(data: PatchCreate, db: Session = Depends(get_db)):
@router.get("", response_model=list[PatchResponse])
def list_all(db: Session = Depends(get_db)):
return patch_service.get_patches(db)
def list_all(keyword: str | None, db: Session = Depends(get_db)):
return patch_service.get_patches(db, keyword)
@router.get("/{patch_id}", response_model=PatchResponse)