import request from '@/utils/request';

export async function getList (data) {
  const res = await request.post('/aps/outsource/page', data);
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

export async function test (params) {
  const res = await request.get('/aps/outsource/test', { params });
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

export async function save (data) {
  const res = await request.post('/aps/outsourcePlan/save', data);
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}
