// WFProcess 流程模版基本信息
import { defHttp } from '@/utils/http/axios';
import {
  taskCountParams,
  caseInfoParams,
  countModel,
  taskInfoParams,
  addCaseFavoriteParams,
  updateCaseInfoParams,
} from './model/index';

enum Api {
  // 获取待办任务统计数据
  LoadTaskCount = '/api/DroneCaseInfoSingle/LoadTaskCount',
  //   获取案件信息统计数据
  LoadDroneCaseInfoCount = '/api/DroneCaseInfoSingle/LoadDroneCaseInfoCount',
  // 分页获取案件信息列表
  LoadDroneCaseInfoDetail = '/api/DroneCaseInfoSingle/LoadDroneCaseInfoDetail',
  // 分页获取任务信息列表
  LoadTaskDetailList = '/api/DroneCaseInfoSingle/LoadTaskDetailList',
  // 收藏案件
  AddCaseFavorite = '/api/DroneCaseInfoSingle/AddCaseFavorite',
  // 获取收藏案件列表
  FavoriteCaseList = '/api/DroneCaseinfo/FavoriteCaseList',
  DeleteFavoriteCase = '/api/DroneCaseInfoSingle/DeleteFavoriteCase',
  // 获取案件详情
  GetCaseInfoById = '/api/DroneCaseInfoSingle/GetCaseInfoById',
  // 更新案件行政区划
  UpdateDroneCaseInfo = '/api/DroneCaseInfoSingle/UpdateDroneCaseInfo',
}

/**
 * @description: getCaseFlowLog
 */
export function getLoadTaskCount(params?: taskCountParams) {
  return defHttp.get<countModel>({ url: Api.LoadTaskCount, params });
}

/**
 * @description: getCaseFlowLog
 */
export function getLoadDroneCaseInfoCount(params?: taskCountParams) {
  return defHttp.get<countModel>({ url: Api.LoadDroneCaseInfoCount, params });
}

/**
 * @description: getCaseFlowLog
 */
export function getLoadDroneCaseInfoDetail(params?: caseInfoParams) {
  return defHttp.get({ url: Api.LoadDroneCaseInfoDetail, params });
}
/**
 * @description: getCaseFlowLog
 */
export function getLoadTaskDetailList(params?: taskInfoParams) {
  return defHttp.get({ url: Api.LoadTaskDetailList, params });
}

export function addCaseFavorite(params?: addCaseFavoriteParams) {
  return defHttp.post({ url: Api.AddCaseFavorite, params });
}
export function deleteFavoriteCase(params: string) {
  return defHttp.post({ url: Api.DeleteFavoriteCase, data: params });
}

export function getFavoriteCaseList(params?: { uid: string }) {
  return defHttp.get({ url: Api.FavoriteCaseList, params });
}
export function getCaseInfoById(params?: { id: string }) {
  return defHttp.get({ url: Api.GetCaseInfoById, params });
}
export const updateDroneCaseInfo = (params: updateCaseInfoParams) =>
  defHttp.post({ url: Api.UpdateDroneCaseInfo, params });
