diff --git a/docs/api/xhs/xhs.md b/docs/api/xhs/xhs.md index fe06b07..62fdac9 100644 --- a/docs/api/xhs/xhs.md +++ b/docs/api/xhs/xhs.md @@ -191,6 +191,7 @@ | keyword | true | string | 搜索词 | | offset | false | int | 搜索翻页偏移量, 默认0 | | limit | false | int | 结果数量, 默认10 | +| sort | false | string | 排序方式,默认为`general`综合。 | - **Success Response** diff --git a/service/xhs/views/search.py b/service/xhs/views/search.py index a2170a6..381a8bb 100644 --- a/service/xhs/views/search.py +++ b/service/xhs/views/search.py @@ -5,10 +5,10 @@ from ..logic import request_search import random -async def search(keyword: str, sort: str, offset: int = 0, limit: int = 20): +async def search(keyword: str, sort: str = "general", offset: int = 0, limit: int = 20): """ 获取笔记搜索 - "sort": "time_descending", # 排序,general:默认, popularity_descending:最热, time_descending:最新 + "sort": general:默认, popularity_descending:最热, time_descending:最新 """ _accounts = await accounts.load() random.shuffle(_accounts)