import request from "@/utils/request";

class VehicleAPI {
  static queryPage(data: PageParams) {
    return request<any, PageResult<VehicleDTO[]>>({
      url: `/api/v1/vehicleInfo/findPage`,
      method: "get",
      params: data,
    });
  }

  static updateById(data: VehicleDTO) {
    return request({
      url: `/api/v1/vehicleInfo/updateById`,
      method: "post",
      data: data,
    });
  }

  static queryRegis(data: PageParams) {
    return request<any, PageResult<VehicleDTO[]>>({
      url: `/api/v1/vehicleRegistration/findPage`,
      method: "get",
      params: data,
    });
  }

  static updateRegisById(data: VehicleDTO) {
    return request({
      url: `/api/v1/vehicleRegistration/updateById`,
      method: "post",
      data: data,
    });
  }
}

export default VehicleAPI;

export interface PageParams {
  inquiryNo?: string;
  contactInfo?: string;
  status?: number; // 1=已联系 0=待联系
  startTime?: string | null;
  endTime?: string | null;
  pageSize?: number;
  pageNum?: number;
  range?: string[];
  name?: string;
}

export interface VehicleDTO {
  id?: number;
  status?: number; // 1=已联系 0=待联系
  remarks?: string;
}
