import { request } from '@/api/_service'

const BASE = 'spc/manager/'

function apiParams (data = {}, method = 'get.spc.create', platform = 'admin') {
  return { method, platform, ...data }
}
export function fetchSpcConfigurationList (data = {}) {
  return request({
    url: BASE + 'list',
    method: 'get',
    params: apiParams(data, 'get.spc.create', 'admin')
  })
}

export function createSpcConfiguration (data = {}) {
  return request({
    url: BASE + 'create',
    method: 'post',
    data: apiParams(data, 'set.spc.create', 'admin')
  })
}

export function editSpcConfiguration (data = {}) {
  return request({
    url: BASE + 'edit',
    method: 'put',
    data: apiParams(data, 'set.spc.edit', 'admin')
  })
}

export function deleteSpcConfiguration (data = {}) {
  return request({
    url: BASE + 'delete',
    method: 'post',
    data: apiParams(data, 'set.spc.delete', 'admin')
  })
}

