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

const { request } = networkUtils;
const { api } = config;
const { price, common } = api;
const { prices, webs,adjust } = price;

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

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

export async function getWebs(id) {
  return request({
    url: webs,
    method: 'get',
  });
}

export async function getSupps(param) {
  return request({
    url: common.suggest.itemSupps,
    method: 'get',
    data: param,
  });
}

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

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

export async function update(params) {
  return request({
    url: prices,
    method: 'put',
    data: params,
  });
}

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