package com.ruoyi.project.common.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.project.common.domain.MessageContentUser;
import com.ruoyi.project.common.dto.MessageContentUserDto;
import com.ruoyi.project.common.mapper.MessageContentUserMapper;
import com.ruoyi.project.common.service.IMessageContentUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 聊天记录读取Service业务层处理
 *
 * @author jubs
 * @date 2024-05-15
 */
@Service
public class MessageContentUserServiceImpl extends ServiceImpl<MessageContentUserMapper, MessageContentUser> implements IMessageContentUserService {
    @Resource
    private MessageContentUserMapper messageContentUserMapper;


    @Override
    public List<MessageContentUserDto> markUnReadMessage(List<Long> messageChatIds, List<Long> receiveUserIds) {
        return messageContentUserMapper.markUnReadMessage(messageChatIds, receiveUserIds);
    }

    @Override
    public List<MessageContentUserDto> getUnReadMessageByUserIdAndChatRoom(Long userId, Long chatRoomId) {
        return messageContentUserMapper.getUnReadMessageByUserIdAndChatRoom(userId, chatRoomId);
    }

    @Override
    public Integer getUnReadMessageByUserIdNeChatRoomId(Long userId, Long chatRoomId) {
        return messageContentUserMapper.getUnReadMessageByUserIdNeChatRoomId(userId, chatRoomId);
    }
}