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

import {
  AddApplicationParams,
  GetApplicationListParams,
  DeleteApplicationParams,
  GetGeomTableListParams,
} from './model/index';

enum Api {
  GetApplicationList = '/api/ApplicationData/GetApplicationList',
  AddApplication = '/api/ApplicationData/AddApplication',
  UpdateApplication = '/api/ApplicationData/UpdateApplication',
  DeleteApplication = '/api/ApplicationData/DeleteApplication',
  GetGeomTableList = '/api/ApplicationData/GetGeomTableList',
}
/**
 * @description: 获取打卡点列表
 */
export function getApplicationList(params: GetApplicationListParams) {
  return defHttp.get({ url: Api.GetApplicationList, params });
}

/**
 * @description: 添加
 */
export function addApplication(params: AddApplicationParams) {
  return defHttp.post({
    url: Api.AddApplication,
    params,
  });
}
/**
 * @description: 删除打卡点
 */
export function deleteApplication(params: DeleteApplicationParams) {
  return defHttp.post({
    url: Api.DeleteApplication + '?id=' + params.id,
    params,
  });
}

/**
 * @description: 编辑打卡点
 */
export function updateApplication(params: AddApplicationParams) {
  return defHttp.post({
    url: Api.UpdateApplication,
    params,
  });
}
/**
 * @description: 编辑打卡点
 */
export function getGeomTableList(params: GetGeomTableListParams) {
  return defHttp.post({
    url: Api.GetGeomTableList,
    params,
  });
}
