import { defHttp } from '@/utils/http/axios';

enum Api {
  // 添加云查询任务
  AddDroneTask = '/api/DroneCloudQuery/AddDroneTask',
  // 根据云查询ID获取查询结果
  LoadCloudQueryById = '/api/DroneCloudQuery/LoadCloudQueryById',
  // 获取全部地类数据
  LoadLandType = '/api/DroneCloudQuery/getLandType',
  // 添加地类分割任务
  AddDroneLandTask = '/api/DroneCloudQuery/AddDroneLandTask',
  // 根据云查询ID获取地类分割结果
  LoadCloudLandQueryById = '/api/DroneCloudQuery/LoadCloudLandQueryById',
  // 查询云查询记录的情况
  LoadCloudQueryByCaseNo = '/api/DroneCloudQuery/LoadCloudQueryByCaseNo',
  // 查询云查询全部记录的情况
  LoadCloudQueryAll = '/api/DroneCloudQuery/LoadCloudQueryAll',
}

export function AddDroneTask(params: { geomid: string; caseno: string; countyname: string }) {
  return defHttp.post({
    url: Api.AddDroneTask + '?geomid=' + params.geomid + '&caseno=' + params.caseno + '&countyName=' + params.countyname,
    params,
  });
}

export function LoadCloudQueryById(params: { id: string }) {
  return defHttp.get({
    url: Api.LoadCloudQueryById,
    params,
  });
}

export function LoadLandType(params) {
  return defHttp.get({
    url: Api.LoadLandType,
    params,
  });
}

export function AddDroneLandTask(params) {
  return defHttp.post({
    url: Api.AddDroneLandTask,
    params,
  });
}

export function LoadCloudLandQueryById(params: { id: string }) {
  return defHttp.get({
    url: Api.LoadCloudLandQueryById,
    params,
  });
}

export function LoadCloudQueryByCaseNo(params) {
  return defHttp.get({
    url: Api.LoadCloudQueryByCaseNo + '?geomid=' + params.geomid + '&caseno=' + params.caseno,
  });
}

export function LoadCloudQueryAll(params) {
  return defHttp.get({
    url: Api.LoadCloudQueryAll,
    params,
  });
}