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

const BASE = 'planning_production/produce/pin_check/'

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

export function getPincheckWorkstation (data) {
  return request({
    url: BASE + 'workstation',
    method: 'get',
    params: apiParams('planning_production_produce_pincheck_workstation', data)
  })
}

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

export function getPinCheckDetail (data) {
  return request({
    url: BASE + 'detail',
    method: 'get',
    params: apiParams('planning_production_produce_pincheck_detail', data)
  })
}

export function setPinCheckClean (data) {
  return request({
    url: BASE + 'clean',
    method: 'get',
    params: apiParams('planning_production_produce_pincheck_clean', data)
  })
}

export function setPinCheckCleanSingle (data) {
  return request({
    url: BASE + 'clean_single_channel',
    method: 'get',
    params: apiParams('planning_production_produce_pincheck_clean_single_channel', data)
  })
}

export function getWorkstationSearch (data) {
  return request({
    url: BASE + 'search',
    method: 'get',
    params: apiParams('planning_production_produce_pincheck_search', data)
  })
}

export function devicePinCheckExport (data) {
  return request({
    url: BASE + 'check',
    method: 'get',
    params: apiParams('planning_production_produce_pincheck_check', data)
  })
}
