package shop.alien.store.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import shop.alien.entity.result.R;
import shop.alien.entity.store.LifeNotice;
import shop.alien.entity.store.vo.LifeNoticeVo;

import java.util.List;

public interface LifeNoticeService extends IService<LifeNotice> {

    R<IPage<LifeNoticeVo>> getNoticeList(int pageNum, int pageSize, String receiverId, int noticeType);

    JSONObject getSystemAndOrderNoticeSum(String receiverId);

    int readNoticeById(Integer id);

    /**
     * 根据接收人ID和通知类型查询未读消息数量
     *
     * @param receiverId 接收人ID
     * @param noticeType 通知类型 0-系统通知和订单提醒之外 1-系统通知 2-订单提醒
     * @return 未读数量
     */
    long countUnreadByReceiverIdAndNoticeType(String receiverId, Integer noticeType);

}
