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

const { request } = networkUtils;
const { api } = config;
const { price, common } = api;
const { history } = price;

/**
 * 过滤查询历史记录（趋势图）
 * @param params
 */
export async function queryHis(params) {
  return request({
    url: history,
    method: 'get',
    data: params,
  });
}

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

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

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

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

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