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

const BASE = 'production_configuration/spc_configuration/binding_scada_node/'

function apiParams (method, data = {}) {
  return {
    method: `production_configuration_spc_configuration_binding_scada_node_${method}`,
    platform: 'background',
    ...data
  }
}

export function getDataCollectionConfigList (data) {
  return request({
    url: BASE + 'list',
    method: 'get',
    params: apiParams('list', data)
  })
}

export function createDataCollectionConfig (data) {
  return request({
    url: BASE + 'create',
    method: 'post',
    data: apiParams('create', data)
  })
}

export function editDataCollectionConfig (data) {
  return request({
    url: BASE + 'edit',
    method: 'put',
    data: apiParams('edit', data)
  })
}

export function deleteDataCollectionConfig (data) {
  return request({
    url: BASE + 'delete',
    method: 'delete',
    data: apiParams('delete', data)
  })
}
