import request from '@/utils/request'

export function listSite(query) {
  return request({
    url: '/site/query',
    method: 'post',
    data: query
  })
}

export function getSite(id) {
  return request({
    url: `/site/${id}`,
    method: 'get'
  })
}

export function addSite(data) {
  return request({
    url: '/site/insert',
    method: 'post',
    data: data
  })
}

export function updateSite(data) {
  return request({
    url: '/site/update',
    method: 'post',
    data: data
  })
}

export function deleteSite(id) {
  return request({
    url: `/site/delete/${id}`,
    method: 'delete',
  })
}

export function getConfig(id) {
  return request({
    url: `/site/queryConfig/${id}`,
    method: 'get',
  })
}

export function addConfig(data) {
  return request({
    url: '/site/insertConfig',
    method: 'post',
    data: data
  })
}

export function updateConfig(data) {
  return request({
    url: '/site/updateConfig',
    method: 'post',
    data: data
  })
}
