import ajax from '../utils/request.js';

/**
 * 获取分组列表
 * @param {Object data}
 * @returns {Promise}
 */
export function getGroupList(data) {
  return ajax({
    api: '/chat/group/list',
    base: 'origin',
    method: 'get',
    data,
    headers: {
      Authorization: localStorage.getItem('token')
    }
  });
}
/**
   * 创建分组
   * @param {Object data}
   * @returns {Promise}
   */
export function createGroup(data) {
  return ajax({
    api: '/chat/group/create',
    base: 'origin',
    method: 'POST',
    data,
    headers: {
      Authorization: localStorage.getItem('token')
    }
  });
}
