import { config, networkUtils } from '../../utils';

const { request } = networkUtils;
const { api } = config;
const { lifecycle } = api;
const { performances} = lifecycle;

export async function query(params) {
  return request({
    url: performances,
    method: 'get',
    data: params,
  });
}

export async function getSingle(id) {
  return request({
    url: `${performances}/${id}`,
    method: 'get',
  });
}

export async function create(params) {
  return request({
    url: performances,
    method: 'post',
    data: params,
  });
}

export async function remove(ids) {
  return request({
    url: performances,
    method: 'delete',
    data: ids,
  });
}

export async function remoteCfg(params) {
  return request({
    url: `${performances}/config`,
    method: 'get',
    data: params,
  });
}

export async function update(params) {
  return request({
    url: `${performances}/put`,
    method: 'post',
    data: params,
  });
}

export async function lastMonth(params) {
  return request({
    url: `${performances}/lastMonth`,
    method: 'post',
    data: params,
  });
}

export async function cancel(id) {
  return request({
    url: `${performances}/${id}/cancel`,
    method: 'delete',
  });
}


