package com.fs.qw.service.impl;


import com.fs.qw.domain.QwRoom;
import com.fs.qw.mapper.QwRoomMapper;
import com.fs.qw.mapper.QwRoomMemberMapper;
import com.fs.qw.service.IQwRoomMemberService;
import com.fs.qw.service.IQwRoomService;
import com.fs.qw.vo.QwContactListVO;
import com.fs.qw.vo.QwRoomListVO;
import com.fs.qw.vo.QwRoomMember;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static com.fs.qw.utils.QwAllUtil.roomDetail;
import static com.fs.qw.utils.QwAllUtil.roomList;

@Service
public class QwRoomMemberServiceImpl implements IQwRoomMemberService
{
    @Autowired
    private QwRoomMemberMapper qwRoomMemberMapper;

    /**
     * 查询群成员
     *
     */
    @Override
    public QwRoomMember selectQwRoomMemberById(Long userId,Long roomId)
    {
        return qwRoomMemberMapper.selectQwRoomMemberByUserId(userId,roomId);
    }

    /**
     * 查询群成员列表
     *
     * @param qwRoomMember 群成员
     * @return 群成员
     */
    @Override
    public List<QwRoomMember> selectQwRoomMemberList(QwRoomMember qwRoomMember)
    {
        return qwRoomMemberMapper.selectQwRoomMemberList(qwRoomMember);
    }

    /**
     * 新增群成员
     *
     * @param qwRoomMember 群成员
     * @return 结果
     */
    @Override
    public int insertQwRoomMember(QwRoomMember qwRoomMember)
    {
        return qwRoomMemberMapper.insertQwRoomMember(qwRoomMember);
    }

    /**
     * 修改群成员
     *
     * @param qwRoomMember 群成员
     * @return 结果
     */
    @Override
    public int updateQwRoomMember(QwRoomMember qwRoomMember)
    {
        return qwRoomMemberMapper.updateQwRoomMember(qwRoomMember);
    }

    /**
     * 批量删除群成员
     *
     * @param ids 需要删除的群成员ID
     * @return 结果
     */
    @Override
    public int deleteQwRoomMemberByIds(Long[] ids)
    {
        return qwRoomMemberMapper.deleteQwRoomMemberByIds(ids);
    }

    /**
     * 删除群成员信息
     *
     */
    @Override
    public int deleteQwRoomMemberById(Long userId,Long roomId)
    {
        return qwRoomMemberMapper.deleteQwRoomMemberByUserId(userId,roomId);
    }
}

