From cfc83f40ca20becb6446235be3316b39fb7eac8e Mon Sep 17 00:00:00 2001 From: Yuban10703 Date: Tue, 18 Jul 2023 19:00:39 +0800 Subject: [PATCH] fix --- app/main.py | 6 +++--- app/schema.py | 4 ++-- requirements.txt | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/main.py b/app/main.py index 19c92b6..98139be 100644 --- a/app/main.py +++ b/app/main.py @@ -30,7 +30,7 @@ async def setu_get( replace_url: Optional[HttpUrl] = None, ): filtered_tags = {tag.strip() for tag in tags if tag.strip()} - setus = await get_setu_data(r18, num, filtered_tags, str(replace_url)) + setus = await get_setu_data(r18, num, filtered_tags, replace_url) if not setus: raise HTTPException(status_code=404, detail="色图库中没找到色图~") return { @@ -42,7 +42,7 @@ async def setu_get( @app.post("/setu", response_class=ORJSONResponse) async def setu_post(item: Item): - setus = await get_setu_data(item.r18, item.num, item.tags, str(item.replace_url)) + setus = await get_setu_data(item.r18, item.num, item.tags, item.replace_url) if not setus: raise HTTPException(status_code=404, detail="色图库中没找到色图~") return { @@ -56,4 +56,4 @@ async def setu_post(item: Item): if __name__ == "__main__": import uvicorn - uvicorn.run("main:app", host="0.0.0.0", port=9999, reload=True) + uvicorn.run("main:app", host="0.0.0.0", port=9999, reload=True) \ No newline at end of file diff --git a/app/schema.py b/app/schema.py index fdba532..cfed18e 100644 --- a/app/schema.py +++ b/app/schema.py @@ -61,5 +61,5 @@ def remove_empty_tags(cls, tags): class Setu_out(BaseModel): detail: str = '' count: int - tags: List[str] - data: List[Setu] + tags: Set[str] + data: List[Setu] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index e8e8491..50ddd65 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,4 @@ motor orjson uvicorn dnspython -pydantic \ No newline at end of file +pydantic<2.0 \ No newline at end of file