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

const BASE = 'data_middleground/basic_traceability/reverse_direction_traceability/'

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

export function getBackwardTraceabilityData (data) {
  return request({
    url: BASE + 'get_data',
    method: 'get',
    params: apiParams('data_middleground_basic_traceability_reverse_direction_traceability_get_data', data)
  })
}

export function exportBackwardTraceabilityTree (data) {
  return request({
    url: BASE + 'export_tree',
    method: 'post',
    data: apiParams('data_middleground_basic_traceability_reverse_direction_traceability_export_tree', data)
  })
}
