import { request } from './request/index';

export const apiService = {
  get(
    url,
    query,
    options = {}
  ) {
    return request(
      url,
      {
        method: 'GET',
        params: query,
      },
      options
    );
  },

  post(
    url,
    query,
    body,
    options= {}
  ) {
    return request(
      url,
      {
        method: 'POST',
        params: query,
        data: body,
      },
      options
    );
  },

  put(
    url,
    query,
    body,
    options= {}
  ) {
    return request(
      url,
      {
        method: 'PUT',
        params: query,
        data: body,
      },
      options
    );
  },

  delete(
    url,
    query,
    options = {}
  ) {
    return request(
      url,
      {
        method: 'DELETE',
        params: query,
      },
      options
    );
  },
};
