package com.yonge.cooleshow.biz.dal.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yonge.cooleshow.biz.dal.dao.ImGroupMemberDao;
import com.yonge.cooleshow.biz.dal.entity.ImGroupMember;
import io.rong.models.group.GroupMember;

import java.util.List;
import java.util.Set;

/**
 * 群成员表(ImGroupMember)表服务接口
 *
 * @author zx
 * @since 2022-03-22 10:45:58
 */
public interface ImGroupMemberService extends IService<ImGroupMember> {

    ImGroupMemberDao getDao();

    /**
    * @description: 添加群成员
     * @param imGroupMembers
    * @return void
    * @author zx
    * @date 2022/3/22 14:02
    */
    void insertBatch(List<ImGroupMember> imGroupMembers);

    /**
    * @description: 初始化单个群成员信息，并返回
     * @param imGroupId
     * @param userId
     * @param isAdmin
     * @param roleType
    * @return List<GroupMember>
    * @author zx
    * @date 2022/3/22 15:59
    */
    List<GroupMember> initGroupMember(String imGroupId, Long userId, Boolean isAdmin, ImGroupMember.ImGroupMemberRoleType roleType) throws Exception;

    /**
    * @description: 添加群成员
     * @param imGroupId
     * @param userIds
     * @param roleType
    * @return void
    * @author zx
    * @date 2022/3/22 15:59
    */
    List<GroupMember> initGroupMembers(String imGroupId, Set<Long> userIds, ImGroupMember.ImGroupMemberRoleType roleType) throws Exception;

    /**
    * @description: 加入融云群
     * @param groupMemberList
     * @param imGroupId
    * @return void
    * @author zx
    * @date 2022/3/23 17:50
    */
    void join(List<GroupMember> groupMemberList,String imGroupId) throws Exception;

    /**
    * @description: 删除群成员
     * @param groupId
    * @return void
    * @author zx
    * @date 2022/3/22 16:21
    */
    void delByGroupId(String groupId);

    /**
    * @description: 获取群成员基本信息
     * @param userId
     * @param groupId
    * @return com.yonge.cooleshow.biz.dal.entity.ImGroupMember
    * @author zx
    * @date 2022/3/24 13:53
    */
    ImGroupMember getUserDetail(Long userId, String groupId);
}

