import request from '@/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/blade-transport/driver/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    },
  });
};

export const getDetail = id => {
  return request({
    url: '/blade-transport/driver/detail',
    method: 'get',
    params: {
      id,
    },
  });
};

export const submit = row => {
  return request({
    url: '/blade-transport/driver/submit',
    method: 'post',
    data: row,
  });
};

export const remove = ids => {
  return request({
    url: '/blade-transport/driver/remove',
    method: 'post',
    params: {
      ids,
    },
  });
};

export const changeStatus = (id, status) => {
  return request({
    url: '/blade-transport/driver/status',
    method: 'post',
    params: {
      id,
      status,
    },
  });
};

export const getExpiryStat = params => {
  return request({
    url: '/blade-transport/driver/expiry-stat',
    method: 'get',
    params,
  });
};

export const recognitionIDCard = url => {
  return request({
    url: '/blade-file/file/recognitionIDCard',
    method: 'get',
    timeout: 60000,
    params: {
      url,
    },
  });
};

export const recognitionTransportCertificates = certificates => {
  return request({
    url: '/blade-file/file/recognitionTransportCertificates',
    method: 'post',
    timeout: 60000,
    data: certificates,
  });
};
