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

const { request } = networkUtils;
const { api } = config;
const { message } = api;
const { annc } = message;

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

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

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

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

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

