agent init

This commit is contained in:
penghanyuan
2026-01-21 22:31:03 +01:00
parent 426f23c777
commit 44bd478c1e
19 changed files with 1513 additions and 111 deletions

View File

@@ -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