/**
 * 溯源证书管理
 */
import request from '../../index'
import type { IListQuery } from '@/views/equipement/source/cert/cert-interface'
const prefix = 'equipment/trace/certificate'
// 列表查询
export function getSourceCertList(data: IListQuery) {
  return request({
    url: `${prefix}/listPage?offset=${data.offset}&limit=${data.limit}`,
    method: 'post',
    data,
  })
}

// 删除
export function delSourceCertList(data: any) {
  return request({
    url: `${prefix}/delete`,
    method: 'post',
    data,
  })
}

// 新增
export function addSourceCertList(data: object) {
  return request({
    url: `${prefix}/add`,
    method: 'post',
    data,
  })
}

// 编辑
export function updateSourceCert(data: object) {
  return request({
    url: `${prefix}/update`,
    method: 'post',
    data,
  })
}

// 详情
export function getRecordDetail(data: { id: string }) {
  return request({
    url: `${prefix}/detail`,
    method: 'post',
    data,
  })
}

