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

import {
  TableDataByTableNameParams,
  TempeleteByTableNameParams,
  UploadSldStyleParams,
} from './model/index';

enum Api {
  // 获取列表数据
  TableDataByTableName = '/api/Layer/TableDataByTableName',
  // 获取模板
  TempeleteByTableName = '/api/Layer/TempeleteByTableName',
  //   更新单条数据
  UpdateTableData = '/api/Layer/UpdateTableData',
  // 上传样式
  UploadSldStyle = '/api/Layer/UploadSldStyle',
}
/**
 * @description: 获取打卡点列表
 */
export function tableDataByTableName(params: TableDataByTableNameParams) {
  return defHttp.get({ url: Api.TableDataByTableName, params });
}

/**
 * @description: 编辑打卡点
 */
export function updateTableData(params: any) {
  return defHttp.post({
    url: Api.UpdateTableData,
    params,
  });
}
/**
 * @description: 下载模板
 */
export function tempeleteByTableName(params: TempeleteByTableNameParams) {
  return defHttp.get({
    url: Api.TempeleteByTableName,
    params,
  });
}
/**
 * @description: 下载模板
 */
export function uploadSldStyle(params: UploadSldStyleParams) {
  return defHttp.get({
    url: Api.UploadSldStyle,
    params,
  });
}
