import { http } from '@/utils/http/axios';
import type { QueryPageRequest, QueryPageResponse } from '@/types/basic-query';

import type { VehicleTableQuery, VehicleTableData } from '@/views/security-confidentiality/vehicle-management/types';

export function getVehicleRecordList(data: QueryPageRequest<VehicleTableQuery>) {
  return http.request<QueryPageResponse<VehicleTableData>>({
    url: '/vehicleEntryRecord/queryVehicleEntryRecordPage',
    method: 'POST',
    data,
  });
}

export function exportVehicleRecordList(data: VehicleTableQuery) {
  return http.request(
    {
      url: '/vehicleEntryRecord/exportVehicleEntryRecord',
      method: 'post',
      data,
      responseType: 'blob',
    },
    {
      isTransformResponse: false,
    },
  );
}
