import request from '@/utils/request'

// 查询列表
export function listPerson(query) {
    return request({
        url: '/bracelet/person/list',
        method: 'get',
        params: query
    })
}

// 新增
export function addPerson(data) {
    return request({
        headers: { // 修改请求头
            'decrypt': 'decrypt',
            'Content-Type': 'multipart/form-data'
        },
        url: '/bracelet/person/addPerson',
        method: 'post',
        data: data
    })
}

// 编辑
export function editPerson(data) {
    return request({
        headers: { // 修改请求头
            'decrypt': 'decrypt',
            'Content-Type': 'multipart/form-data'
        },
        url: '/bracelet/person/editPerson',
        method: 'post',
        data: data
    })
}

// 详情
export function getPersonInfo(data) {
    return request({
        url: '/bracelet/person/getPersonInfo',
        method: 'post',
        data: data
    })
}

//证书详情
export function getCertificate(memberId) {
    return request({
        url: '/bracelet/person/' + memberId,
        method: 'get',
    })
}

// 删除
export function delPerson(data) {
    return request({
        url: '/bracelet/person/delPerson',
        method: 'post',
        data: data
    })
}
// 推送人脸照片到人脸库
export function pushFace(data) {
    return request({
        url: '/bracelet/person/pushFace',
        method: 'post',
        data: data
    })
}

// 修改证书
export function updateCertificate(data) {
    return request({
      headers: { // 修改请求头
        'decrypt': 'decrypt',
        'Content-Type': 'multipart/form-data'
      },
      url: '/bracelet/person/updateCertificate',
      method: 'post',
      data: data
    })
  }

// 导出
export function exportPerson(query) {
    return request({
        url: '/bracelet/export/exportPerson',
        method: 'get',
        headers: { 'Content-Type': 'application/x-www-form-urlencoded',
            "encryption":"encryption"
        },
        responseType: 'blob',
        params: query
    })
}
// 模板下载
export function personFile(query) {
    return request({
        url: '/bracelet/download/personFile',
        method: 'get',
        headers: { 'Content-Type': 'application/x-www-form-urlencoded',
            "encryption":"encryption"
        },
        responseType: 'blob',
        params: query
    })
}



