import request from '@/utils/request'
const api = {
  page: '/system/business/service/page',
  add: '/system/business/service',
  info: '/system/business/service',
  remove: '/system/business/service/abandon'
}

export function fetchServicePage(params) {
  return request({
    url: api.page,
    method: 'get',
    params
  })
}

export function addService(data) {
  return request({
    url: api.add,
    method: data.id ? 'put' : 'post',
    data
  })
}

export function fetchServiceInfo(id) {
  return request({
    url: `${api.info}/${id}`,
    method: 'get'
  })
}

export function removeService(ids) {
  return request({
    url: `${api.remove}/${ids}`,
    method: 'put'
  })
}
