searchpost

Change-Id: I3b471ad217a958e2e8bf22c005b1a3fd36454151
diff --git a/src/main/java/com/example/g8backend/controller/PostController.java b/src/main/java/com/example/g8backend/controller/PostController.java
index f373539..a47734a 100644
--- a/src/main/java/com/example/g8backend/controller/PostController.java
+++ b/src/main/java/com/example/g8backend/controller/PostController.java
@@ -109,4 +109,14 @@
         Long likeCount = postService.getPostLikeCount(postId);
         return ResponseEntity.ok().body(likeCount);
     }
+
+    // 搜索帖子
+    @GetMapping("/search")
+    public List<Post> searchPosts(
+            @RequestParam(required = false) String keyword,
+            @RequestParam(required = false) List<Long> tags,  // 修改为接收多个标签
+            @RequestParam(required = false) String author) {
+
+        return postService.searchPosts(keyword, tags, author);
+    }
 }