agent init
This commit is contained in:
@@ -33,10 +33,28 @@ async def get_current_book(
|
||||
"title": book.title,
|
||||
"total_pages": book.total_pages,
|
||||
"total_words": book.total_words,
|
||||
"cover_image_url": book.cover_image_url
|
||||
"cover_image_url": book.cover_image_url,
|
||||
"has_update": book.has_update,
|
||||
"last_update_chapter_id": book.last_update_chapter_id,
|
||||
}
|
||||
|
||||
|
||||
@router.post("/clear-update")
|
||||
async def clear_book_update(
|
||||
current_user: UserModel = Depends(get_current_user),
|
||||
db: AsyncSession = Depends(get_async_db),
|
||||
):
|
||||
"""清除回忆录更新标记"""
|
||||
stmt = select(BookModel).where(BookModel.user_id == current_user.id).order_by(BookModel.updated_at.desc())
|
||||
result = await db.execute(stmt)
|
||||
book = result.scalar_one_or_none()
|
||||
if not book:
|
||||
return {"status": "ok", "message": "No book found"}
|
||||
book.has_update = False
|
||||
await db.commit()
|
||||
return {"status": "ok"}
|
||||
|
||||
|
||||
class ExportPdfRequest(BaseModel):
|
||||
book_id: str
|
||||
|
||||
|
||||
Reference in New Issue
Block a user