记录单词搜索次数

This commit is contained in:
Miyamizu-MitsuhaSang 2025-09-15 17:40:13 +08:00
parent 2faebef7f2
commit e068850e4c
1 changed files with 6 additions and 0 deletions

View File

@ -35,6 +35,12 @@ async def search(request: Request, body: SearchRequest, user=Depends(get_current
)
if not word_contents:
raise HTTPException(status_code=404, detail="Word not found")
# 修改freq
first_word = word_contents[0].word
current_freq = first_word.freq
await first_word.update(freq=current_freq+1)
pos_seen = set()
pos_contents = []
contents: List[SearchItemFr] = []