package com.common.im.api;

import static com.cooleshow.base.common.BaseConstant.AUTH_GROUP;
import static com.cooleshow.base.common.BaseConstant.STUDENT_GROUP;
import static com.cooleshow.base.common.BaseConstant.TEACHER_GROUP;

import com.common.im.bean.ContactListBean;
import com.common.im.bean.ContactRoomListBean;
import com.common.im.bean.GroupApplyBean;
import com.common.im.bean.GroupMemberBean;
import com.common.im.bean.GroupNoticeBean;
import com.common.im.bean.MusicSheetListBean;
import com.common.im.bean.RongIMGroupInfo;
import com.common.im.bean.RongIMUserInfo;
import com.cooleshow.base.data.net.BaseResponse;

import java.util.List;

import io.reactivex.rxjava3.core.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
import retrofit2.http.Path;

/**
 * Author by pq, Date on 2022/5/7.
 */
public interface IMApi {

    /**
     * 获取好友列表-学生
     *
     * @return
     */
    @POST(STUDENT_GROUP + "imUserFriend/queryAll")
    Observable<BaseResponse<List<ContactListBean>>> queryStuFriendList(@Body RequestBody requestBody);

    /**
     * 获取好友列表-老师
     *
     * @return
     */
    @POST(TEACHER_GROUP + "imUserFriend/queryAll")
    Observable<BaseResponse<List<ContactListBean>>> queryTeaFriendList(@Body RequestBody requestBody);

    /**
     * 群列表-学生
     *
     * @return
     */
    @POST(STUDENT_GROUP + "imGroup/queryAll")
    Observable<BaseResponse<List<ContactRoomListBean>>> queryStuGroupList(@Body RequestBody requestBody);

    /**
     * 群列表-老师
     *
     * @return
     */
    @POST(TEACHER_GROUP + "imGroup/queryAll")
    Observable<BaseResponse<List<ContactRoomListBean>>> queryTeaGroupList(@Body RequestBody requestBody);

    /**
     * 根据用户编号获取用户基本信息-学生
     *
     * @param userId
     * @return
     */
    @POST(STUDENT_GROUP + "imUserFriend/getDetail/{userId}")
    Observable<BaseResponse<RongIMUserInfo>> queryStuFriendDetail(@Path("userId") String userId);

    /**
     * 根据用户编号获取用户基本信息-老师
     *
     * @param userId
     * @return
     */
    @POST(TEACHER_GROUP + "imUserFriend/getDetail/{userId}")
    Observable<BaseResponse<RongIMUserInfo>> queryTeaFriendDetail(@Path("userId") String userId);


    /**
     * 查询群详情-学生
     *
     * @returnClassListAdapter
     */
    @POST(STUDENT_GROUP + "imGroup/getDetail/{groupId}")
    Observable<BaseResponse<RongIMGroupInfo>> queryStuGroupDetail(@Path("groupId") String groupId);

    /**
     * 查询群详情-老师
     *
     * @returnClassListAdapter
     */
    @POST(TEACHER_GROUP + "imGroup/getDetail/{groupId}")
    Observable<BaseResponse<RongIMGroupInfo>> queryTeaGroupDetail(@Path("groupId") String groupId);


    /**
     * 分页查询分页查询
     *
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "music/sheet/list")
    Observable<BaseResponse<MusicSheetListBean>> queryMusicList(@Body RequestBody body);

    /**
     * 创建粉丝群
     *
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "imGroup/create")
    Observable<BaseResponse<Object>> createImGroup(@Body RequestBody body);

    /**
     * 获取群成员列表-学生
     *
     * @param body
     * @return
     */
    @POST(STUDENT_GROUP + "imGroupMember/queryAll")
    Observable<BaseResponse<List<GroupMemberBean>>> queryStuGroupMembers(@Body RequestBody body);

    /**
     * 获取群成员列表-老师
     *
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "imGroupMember/queryAll")
    Observable<BaseResponse<List<GroupMemberBean>>> queryTeaGroupMembers(@Body RequestBody body);

    /**
     * 群公告-学生
     *
     * @param body
     * @return
     */
    @POST(STUDENT_GROUP + "imGroupNotice/queryPage")
    Observable<BaseResponse<GroupNoticeBean>> queryStuGroupNotice(@Body RequestBody body);

    /**
     * 群公告-老师
     *
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "imGroupNotice/queryPage")
    Observable<BaseResponse<GroupNoticeBean>> queryTeaGroupNotice(@Body RequestBody body);

    /**
     * 修改群公告
     *
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "imGroupNotice/update")
    Observable<BaseResponse<Object>> updateGroupNotice(@Body RequestBody body);

    /**
     * 新增群公告
     *
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "imGroupNotice/create")
    Observable<BaseResponse<Object>> createGroupNotice(@Body RequestBody body);


    /**
     * 修改群公告
     *
     * @return
     */
    @POST(TEACHER_GROUP + "imGroupNotice/del/{id}")
    Observable<BaseResponse<String>> noticeDel(@Path("id") String id);

    /**
     * 修改群信息
     *
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "imGroup/update")
    Observable<BaseResponse<Object>> updateGroupInfo(@Body RequestBody body);

    /**
     * 申请入群列表
     *
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "imGroupMemberAudit/queryAll")
    Observable<BaseResponse<List<GroupApplyBean>>> groupApplyList(@Body RequestBody body);

    /**
     * 申请入群批量审核
     *
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "imGroupMemberAudit/applyAudit")
    Observable<BaseResponse<Object>> doGroupApply(@Body RequestBody body);

    /**
     * @param body
     * @return
     */
    @POST(TEACHER_GROUP + "sysImComplaint/add")
    Observable<BaseResponse<Object>> sysImComplaint(@Body RequestBody body);


    /**
     * 解散群组
     *
     * @param
     * @return
     */
    @POST(TEACHER_GROUP + "imGroup/dismiss/{groupId}")
    Observable<BaseResponse<Object>> dissolveChatGroup(@Path("groupId") String groupId);
}
