import http from '@/api'
import { AircraftVO, AircraftForm, AircraftQuery } from '@/api/interface/als/aircraft'
/**
 * @name 查询机型机号列表
 * @param query 参数
 * @returns 返回列表
 */
export const listAircraftApi = (query: AircraftQuery) => {
  return http.get<AircraftVO[]>('/als/aircraft/list', query, { loading: false })
}

/**
 * @name 查询机型机号详细
 * @param id id
 * @returns returns
 */
export const getAircraftApi = (id: string | number) => {
  return http.get<AircraftVO>(`/als/aircraft/${id}`)
}

/**
 * @name 新增机型机号
 * @param data data
 * @returns returns
 */
export const addAircraftApi = (data: AircraftForm) => {
  return http.post<any>('/als/aircraft', data, { loading: false })
}

/**
 * @name 修改机型机号
 * @param data data
 * @returns returns
 */
export const updateAircraftApi = (data: AircraftForm) => {
  return http.put<any>('/als/aircraft', data, { loading: false })
}

/**
 * @name 删除机型机号
 * @param id id
 * @returns returns
 */
export const delAircraftApi = (id: string | number | Array<string | number>) => {
  return http.delete<any>(`/als/aircraft/${id}`)
}

/**
 * @name 下载模板
 * @returns returns
 */
export const importTemplateApi = () => {
  return http.downloadPost('/als/aircraft/importTemplate', {})
}

/**
 * @name 导入数据
 * @returns returns
 */
export const importAircraftDataApi = (data: any) => {
  return http.post('/als/aircraft/importData', data)
}

/**
 * @name 导出数据
 * @returns returns
 */
export const exportAircraftApi = (data: any) => {
  return http.post('/als/aircraft/export', data)
}
