package com.pcloud.book.applet.biz;

import com.pcloud.book.applet.dto.AppletTaskDTO;
import com.pcloud.book.applet.dto.AppletUserBookcaseDTO;
import com.pcloud.book.applet.dto.BaseTempletClassifyDTO;
import com.pcloud.book.applet.dto.UserLastBookReDTO;
import com.pcloud.book.applet.entity.AppletUserBookcase;
import com.pcloud.book.applet.entity.AppletUserClickRecord;
import com.pcloud.book.book.dto.BookDto;
import com.pcloud.common.page.PageBeanNew;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import java.util.List;
import java.util.Map;

/**
 * 小程序用户书架
 */
public interface AppletUserBookcaseBiz {

    /**
     * 添加图书到书架
     * @param appletUserBookcase
     */
    AppletTaskDTO addUserBook(AppletUserBookcase appletUserBookcase);

    /**
     * 查用户书架列表
     * @param wechatUserId
     * @param currentPage
     * @param numPerPage
     * @return
     */
    PageBeanNew<AppletUserBookcaseDTO> listByWechatUserId(Long wechatUserId, Integer currentPage, Integer numPerPage,Long officialAccountsId);

    /**
     * 新增用户资源点击记录
     * @param appletUserClickRecord
     */
    void addUserClickRecord(AppletUserClickRecord appletUserClickRecord);

    /**
     * 用户图书资源点击统计
     * @param wechatUserId
     * @param bookId
     * @return
     */
    Map<String,Object> getUserClickStatistic(Long wechatUserId, Long bookId, Long channelId, Long adviserId);


    UserLastBookReDTO getUserLastBookRe(Long wechatUserId, Long officialAccountsId);

    /**
     * 批量删除
     * @author：zhuyajie
     * @date：2020/5/11 16:06
     *  * @param null
     */
    void deleteByIds(List<Long> ids, Long wechatUserId, Long officialAccountsId);

    /**
     * 更新读者关于本书的阅读方式
     * @param appletUserBookcase
     */
    void updateUserReadType(AppletUserBookcase appletUserBookcase);

    /**
     * 获取读者关于本书的阅读方式
     * @param wechatUserId
     * @param bookId
     * @param adviserId
     * @param channelId
     * @return
     */
    AppletUserBookcase getUserReadType(Long wechatUserId, Long bookId, Long adviserId, Long channelId);

    /**
     * 已读书刊随机换一本书展示
     * @author：zhuyajie
     * @date：2020/5/15 14:49
     *  * @param null
     */
    void randomChangeBook(Long wechatUserId);

    /**
     * 书架id
     * @author：zhuyajie
     * @date：2020/5/29 13:11
     *  * @param null
     */
    List<Long> getBookcaseIdListByUser(Long wechatUserId, Long officialAccountsId);

    /**
     * 书刊访问量
     * @author：zhuyajie
     * @date：2020/6/15 11:45
     *  * @param null
     */
    Map<String,Integer> mapBookUserCountList(List<Long> bookIds);

    AppletUserBookcaseDTO getUserBookInfoByWechatUserId(Long bookId,Long channelId,Long adviserId,Long rightsSettingId);

    String getResources4Books(MultipartHttpServletRequest request);

    BaseTempletClassifyDTO getLastReadBookInfo(List<Long> wechatUserIds);

    List<Long> getSameClassifyUserIds(List<Long> wechatUserIds);

    /**
     * 小程序打卡-书架最近10本书
     * @author：zhuyajie
     * @date：2021/6/22 14:03
     *  * @param null
     */
    List<BookDto> getLatest10Books4Clock(Long wechatUserId, Long officialAccountsId);
}
