| 12345678910111213141516171819202122232425262728293031323334 |
- // 书架相关API
- const api = require('../utils/api');
- // 获取书架列表
- function getBookshelfList(userId) {
- return api.get('/user/bookshelf/list', { userId });
- }
- // 加入书架
- function addToBookshelf(userId, contentId) {
- return api.post('/user/bookshelf/add', {}, false, { userId, contentId });
- }
- // 移出书架
- function removeFromBookshelf(userId, contentId) {
- return api.del('/user/bookshelf/remove', { userId, contentId });
- }
- // 检查是否在书架中
- function checkInBookshelf(userId, contentId) {
- return api.get('/user/bookshelf/check', { userId, contentId });
- }
- module.exports = {
- getBookshelfList,
- addToBookshelf,
- removeFromBookshelf,
- checkInBookshelf
- };
|