import request from '../utils/request'

export function getToken(code) {
  return request({
    url: '/patientCards/getToken',
    method: 'get',
    params: { code },
  })
}

export function getPatientIdByOpenid() {
  return request({
    url: '/patientCards/getPatientIdByOpenid',
    method: 'get',
  })
}

export function hasValidIdCard(data) {
  return request({
    url: '/patientCards/hasValidIdCard',
    method: 'post',
    data,
  })
}

export function bindPatientId(data) {
  return request({
    url: '/patientCards/bindPatientId',
    method: 'post',
    data,
  })
}

export function setDefaultCard(patientId) {
  return request({
    url: '/patientCards/setDefaultCard',
    method: 'get',
    params: { patientId },
  })
}

export function updateBindInfo(data) {
  return request({
    url: '/patientCards/updateBindInfo',
    method: 'post',
    data,
  })
}

export function relieveBindCard(data) {
  return request({
    url: '/patientCards/relieveBindCard',
    method: 'post',
    data,
  })
}

export function relieveBindCardButCanceled(data) {
  return request({
    url: '/patientCards/relieveBindCardButCanceled',
    method: 'post',
    data,
  })
}

export function readImage(data) {
  return request({
    url: '/analyzeIdCard/readImage',
    method: 'post',
    data,
  })
}

export function readInput(data) {
  return request({
    url: '/analyzeIdCard/readInput',
    method: 'post',
    data,
  })
}
