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

const BASE = 'system_settings/system_monitor/setting/'

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

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

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

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

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