import request from '@/utils/request'

export function getImplementRuleList(query) {
  return request({
    url: '/certset/implementrule/',
    method: 'get',
    params: query
  })
}

export function getImplementRule(id) {
  return request({
    url: `/certset/implementrule/${id}/`,
    method: 'get'
  })
}

export function createImplementRule(data) {
  return request({
    url: '/certset/implementrule/',
    method: 'post',
    data
  })
}

export function updateImplementRule(id, data) {
  return request({
    url: `/certset/implementrule/${id}/`,
    method: 'put',
    data
  })
}

export function deleteImplementRule(id) {
  return request({
    url: `/certset/implementrule/${id}/`,
    method: 'delete'
  })
}

export function getUnitTypeList(query) {
  return request({
    url: '/certset/unittype/',
    method: 'get',
    params: query
  })
}

export function createUnitType(data) {
  return request({
    url: '/certset/unittype/',
    method: 'post',
    data
  })
}

export function updateUnitType(id, data) {
  return request({
    url: `/certset/unittype/${id}/`,
    method: 'put',
    data
  })
}

export function deleteUnitType(id) {
  return request({
    url: `/certset/unittype/${id}/`,
    method: 'delete'
  })
}