import request from '@/utils/request'

// list
export function rtpList(params) {
  return request({
    url: '/trace/index',
    method: 'get',
    params
  })
}

// 一键生成
export function createMany(data) {
  return request({
    url: '/trace/many_add',
    method: 'post',
    data
  })
}

// 生成单个
export function createOne(data) {
  return request({
    url: '/trace/add',
    method: 'post',
    data
  })
}

// 删除
export function deleteCode(data) {
  return request({
    url: '/trace/destroy',
    method: 'post',
    data
  })
}

// 获取子码
export function childCode(params) {
  return request({
    url: '/trace/get_child_info',
    method: 'get',
    params
  })
}

// 设置真假码
export function childIsTrue(data) {
  return request({
    url: '/trace/set_true',
    method: 'post',
    data
  })
}

// 导出
export function codeExport(params) {
  return request({
    url: '/trace/get_trace_export_url',
    method: 'get',
    params
  })
}

// 一键生成类型
export function createCodeModel() {
  return request({
    url: '/trace/get_model_info',
    method: 'get'
  })
}

// 获取生成批次
export function codeTrace(params) {
  return request({
    url: '/trace/getTraceInfo',
    method: 'get',
    params
  })
}

// 删除批次
export function deleteTrace(data) {
  return request({
    url: '/trace/destroySerial',
    method: 'post',
    data
  })
}

// 查询code
export function searchCode(params) {
  return request({
    url: '/trace/getCodeInfo',
    method: 'get',
    params
  })
}

// 代理防伪码真假
export function teamSet(data) {
  return request({
    url: '/trace/set_all_true',
    method: 'post',
    data
  })
}

// 批量防伪码真假
export function selectCodeSet(data) {
  return request({
    url: '/trace/set_many_true',
    method: 'post',
    data
  })
}
