Files
diary-news/backend/app/schemas/search.py

16 lines
337 B
Python
Raw Normal View History

"""搜索建议 schema(纯 keyword 续接词)。"""
from __future__ import annotations
from pydantic import BaseModel
class SearchKeywordItem(BaseModel):
word: str
weight: int
source: str # 'ts_stat' / 'ts_stat_live'
class SearchSuggestionsResponse(BaseModel):
query: str
keywords: list[SearchKeywordItem] = []