import request from '@/utils/request'
import Qs from 'qs'

export function listPre(query) {
  return request({
    url: '/pre/list',
    method: 'get',
    params: query,
    paramsSerializer: function(params) {
      return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
}
export function detailOrder(id) {
  return request({
      url: '/pre/detail',
      method: 'get',
      params: { id }
  })
}
export function listPreCategory(query) {
  return request({
    url: '/preCategory/list',
    method: 'get',
    params: query,
    paramsSerializer: function(params) {
      return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
}
export function detailPreCategory(id) {
  return request({
      url: '/preCategory/detail',
      method: 'get',
      params: { id }
  })
}
export function deletePreCategory(id) {
  return request({
      url: '/preCategory/delete',
      method: 'get',
      params: { id }
  })
}
export function addPreCategory(name) {
  return request({
      url: '/preCategory/add',
      method: 'get',
      params: { name }
  })
}
export function  deleteTypePreCategory(query) {
  return request({
    url: '/preCategory/typeDelete',
    method: 'get',
    params: query
  })
}
export function  addTypePreCategory(query) {
  return request({
    url: '/preCategory/typeAdd',
    method: 'get',
    params: query
  })
}

export function  runEtl(query) {
  return request({
    url: '/pre/runEtl',
    method: 'get',
    params: query
  })
}