import request from '@/utils/request'

// 查询食品经营法定代人信息列表
export function listRepresentative(query) {
  return request({
    url: '/basicData/xcrLegalRepresentative/findByPage',
    method: 'get',
    params: query
  })
}

// 查询食品经营法定代人信息详细
export function getRepresentative(xhCodeId) {
  return request({
    url: '/basicData/xcrLegalRepresentative/' + xhCodeId,
    method: 'get'
  })
}

// 新增食品经营法定代人信息
export function addRepresentative(data) {
  return request({
    url: '/basicData/xcrLegalRepresentative',
    method: 'post',
    data: data
  })
}

// 修改食品经营法定代人信息
export function updateRepresentative(data) {
  return request({
    url: '/basicData/xcrLegalRepresentative',
    method: 'put',
    data: data
  })
}

// 删除食品经营法定代人信息
export function delRepresentative(xhCodeId) {
  return request({
    url: '/basicData/xcrLegalRepresentative/deleteAll',
    method: 'delete'
  })
}
// 批量删除行政许可
export function delRepresentativeBatch(ids) {
  return request.post('/basicData/xcrLegalRepresentative/delete',ids)
}
