import { config, networkUtils } from '@utils';

const { request } = networkUtils;
const { api } = config;
const { price} = api;
const { adjust} = price;

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

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

export async function submit(params: object) {
  return request({
    url: `${adjust}/add`,
    method: 'post',
    data: params,
  });
}

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

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

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

