修改 filterOptions 让接口更友好 (#260)

Co-authored-by: huruize <8985917+huruize007@user.noreply.gitee.com>
This commit is contained in:
hrz
2025-10-23 23:52:34 +08:00
committed by GitHub
parent 0d18d951f7
commit 94ed5d4477
6 changed files with 172 additions and 154 deletions

View File

@@ -120,7 +120,7 @@ func (s *AppServer) listFeedsHandler(c *gin.Context) {
// searchFeedsHandler 搜索Feeds
func (s *AppServer) searchFeedsHandler(c *gin.Context) {
var keyword string
var filters []xiaohongshu.FilterOption
var filters xiaohongshu.FilterOption
switch c.Request.Method {
case http.MethodPost:
@@ -144,7 +144,7 @@ func (s *AppServer) searchFeedsHandler(c *gin.Context) {
}
// 搜索 Feeds
result, err := s.xiaohongshuService.SearchFeeds(c.Request.Context(), keyword, filters...)
result, err := s.xiaohongshuService.SearchFeeds(c.Request.Context(), keyword, filters)
if err != nil {
respondError(c, http.StatusInternalServerError, "SEARCH_FEEDS_FAILED",
"搜索Feeds失败", err.Error())