package com.zhentao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhentao.dto.BlockDto;
import com.zhentao.entity.ChatConversation;
import com.zhentao.repository.ChatConversationMapper;
import com.zhentao.service.ChatConversationService;
import org.springframework.stereotype.Service;

@Service
public class ChatConversationServiceImpl extends ServiceImpl<ChatConversationMapper,ChatConversation> implements ChatConversationService {

    @Override
    public void deleteChatConversation(BlockDto dto) {
        QueryWrapper<ChatConversation> chatConversationQueryWrapper = new QueryWrapper<>();
        chatConversationQueryWrapper.lambda().eq(ChatConversation::getUserId,dto.getUserId()).eq(ChatConversation::getTargetUserId,dto.getTargetUserId());
        this.baseMapper.delete(chatConversationQueryWrapper);
    }
}
