import request from '@/utils/request'

export function listMeasurePoint(query) {
  return request({
    url: '/mes/md/measurepoint/list',
    method: 'get',
    params: query
  })
}

export function getMeasurePoint(pointId) {
  return request({
    url: '/mes/md/measurepoint/' + pointId,
    method: 'get'
  })
}

export function addMeasurePoint(data) {
  return request({
    url: '/mes/md/measurepoint',
    method: 'post',
    data: data
  })
}

export function updateMeasurePoint(data) {
  return request({
    url: '/mes/md/measurepoint',
    method: 'put',
    data: data
  })
}

export function delMeasurePoint(pointId) {
  return request({
    url: '/mes/md/measurepoint/' + pointId,
    method: 'delete'
  })
}

export function getMeasurePointLatest(pointCode) {
  return request({
    url: '/mes/md/measurepoint/latest',
    method: 'get',
    params: { pointCode }
  })
}

export function getMeasurePointHistory(query) {
  return request({
    url: '/mes/md/measurepoint/history',
    method: 'get',
    params: query
  })
}
