Get textbooks for user's list

GET /api/textbooks/gettextbooksforlist

Retrieves the list of textbooks that the authenticated user has interacted with, sorted by the last message time. This endpoint requires JWT authentication.

Responses

  • 200 application/json

    Successfully retrieved textbooks for the user's list

    Hide response attribute Show response attribute object
    • textbooks array[object]
      Hide textbooks attributes Show textbooks attributes object
      • _id string
      • lastMessageTime string(date-time)
      • title string
      • author string
  • 400 text/plain

    Bad request - User ID is required

  • 401 text/plain

    Unauthorized - No valid JWT token provided

  • 403 text/plain

    Forbidden - Invalid JWT token

  • 500 text/plain

    Internal server error

GET /api/textbooks/gettextbooksforlist
curl \
 --request GET 'http://localhost:xxxx/api/textbooks/gettextbooksforlist' \
 --cookie "jwt=$API_KEY"
Response examples (200)
{
  "textbooks": [
    {
      "_id": "60d21b4667d0d8992e610c85",
      "lastMessageTime": "2023-10-05T14:48:00.000Z",
      "title": "计算机科学导论",
      "author": "李四"
    }
  ]
}
Response examples (400)
需要用户ID
Response examples (401)
您未通过身份验证
Response examples (403)
无效的令牌
Response examples (500)
服务器内部错误