import request from '@/sheep/request';

const ImConversationApi = {
  // 获得会话列表
  getMemberConversationPage: (params) => {
    return request({
      url: '/im/member-conversation/page',
      method: 'GET',
      params,
      custom: {
        auth: true,
        showLoading: false,
      },
    });
  },
  getRandomMemberConversation: () => {
    return request({
      url: '/im/member-conversation/getRandom',
      method: 'GET',
      custom: {
        auth: true,
        showLoading: false,
      },
    });
  },
  // 创建会话
  createMemberConversation: (data) => {
    return request({
      url: '/im/member-conversation/create',
      method: 'POST',
      data,
      custom: {
		auth: true,
		showLoading: false,
      },
    });
  },
  // 删除会话
  deleteMemberConversation: (id) => {
    return request({
      url: '/im/member-conversation/delete',
      method: 'DELETE',
      params: {
		  id
	  },
      custom: {
  		auth: true,
  		showLoading: false,
      },
    });
  },
  // 拉黑
  slashedMemberConversation: (id) => {
    return request({
      url: '/im/member-conversation/slashed',
      method: 'DELETE',
      params: {
  		  id
  	  },
      custom: {
  		auth: true,
  		showLoading: false,
      },
    });
  },
  // 置顶会话
  pinnedMemberConversation: (data) => {
    return request({
      url: '/im/member-conversation/pinned',
      method: 'PUT',
      data,
      custom: {
  		auth: true,
  		showLoading: false,
      },
    });
  },
};

export default ImConversationApi;
