import amosRequest from 'amos-processor/lib/fetch/amosRequest';

const commonPost = (url, data) => {
  return amosRequest(url, {
    method: 'POST',
    body: data,
    reject(err) {}
  });
};

const commonGet = (url, data) => {
  return amosRequest(url, {
    method: 'GET',
    body: data,
    reject(err) {}
  });
};

const commonPut = (url, data) => {
  return amosRequest(url, {
    method: 'PUT',
    body: data,
    reject(err) {}
  });
};

const commonDel = (url, data) => {
  return amosRequest(url, {
    method: 'DELETE',
    body: data,
    reject(err) {}
  });
};

export function getService(url, data) {
  return amosRequest(url, {
    method: 'GET',
    body: data,
    reject(err) {}
  });
}

export function postService(url, data) {
  return amosRequest(url, {
    method: 'POST',
    body: data,
    reject(err) {}
  });
}
