import request from '@/utils/request'

// 查询物料列表
export function listMaterial(query) {
  return request({
    url: '/cutter/material/list',
    method: 'get',
    params: query
  })
}

// 查询刀具实例列表
export function listEntity(query) {
  return request({
    url: '/cutter/entity/list',
    method: 'get',
    params: query
  })
}

export function getEntity(id) {
  return request({
    url: '/cutter/entity/' + id,
    method: 'get'
  })
}

// 查询刀具使用记录列表
export function listUseRecord(query) {
  return request({
    url: '/cutter/useRecord/list',
    method: 'get',
    params: query
  })
}

// 查询刀具使用记录详细
export function getUseRecord(id) {
  return request({
    url: '/cutter/useRecord/' + id,
    method: 'get'
  })
}

// 新增刀具使用记录
export function addUseRecord(data) {
  return request({
    url: '/cutter/useRecord',
    method: 'post',
    data: data
  })
}

// 修改刀具使用记录
export function updateUseRecord(data) {
  return request({
    url: '/cutter/useRecord',
    method: 'put',
    data: data
  })
}

// 查询设备管理列表
export function listEquipment(query) {
  return request({
    url: '/basic/equipment/list',
    method: 'get',
    params: query
  })
}

// 删除刀具使用记录
export function delUseRecord(id) {
  return request({
    url: '/cutter/useRecord/' + id,
    method: 'delete'
  })
}

// 新增刀具上机记录
export function addStartUse(data) {
  return request({
    url: '/cutter/useRecord/start',
    method: 'post',
    data: data
  })
}

// 新增刀具上机记录
export function installShank(data) {
  return request({
    url: '/cutter/useRecord/install/shank',
    method: 'post',
    data: data
  })
}


// 更新刀具下机记录
export function removeShank(data) {
  return request({
    url: '/cutter/useRecord/remove/shank',
    method: 'put',
    data: data
  })
}

// 新增刀刃上机记录
export function installBlade(data) {
  return request({
    url: '/cutter/useRecord/install/blade',
    method: 'post',
    data: data
  })
}


// 更新刀具下机记录
export function removeBlade(data) {
  return request({
    url: '/cutter/useRecord/remove/blade',
    method: 'put',
    data: data
  })
}

// 更新刀具下机记录
export function updateEndUse(data) {
  return request({
    url: '/cutter/useRecord/end',
    method: 'put',
    data: data
  })
}

// 新增刀柄刀刃解绑记录
export function bindRecord(data) {
  return request({
    url: '/cutter/installRecord/bind',
    method: 'post',
    data: data
  })
}

// 修改刀柄刀刃解绑记录
export function unbindRecord(data) {
  return request({
    url: '/cutter/installRecord/unbind',
    method: 'put',
    data: data
  })
}

// 查询刀具安装记录列表
export function listInstallRecord(query) {
  return request({
    url: '/cutter/installRecord/list',
    method: 'get',
    params: query
  })
}