import { defHttp } from '/@/utils/http/axios';
import { Apply } from '/@/api/burialPoint/apply/model/applyModel';

enum Api {
  QueryAll = '/apply/queryAll',
  QueryOne = '/apply/queryOne',
  QueryList = '/apply/queryList',
  Create = '/apply/create',
  Update = '/apply/update',
  Delete = '/apply/delete',
}

/**
 * 查询所有应用
 */
export function queryAll(params: string) {
  return defHttp.get<Apply>({
    url: Api.QueryList,
    params,
  });
}

/**
 * 通过主键查询单条数据
 */
export function queryApplyOne(params: string) {
  return defHttp.get<Apply>({
    url: Api.QueryOne + '?id=' + params,
  });
}

/**
 * 新增数据
 */
export function applyCreate(params: Apply) {
  return defHttp.post<Apply>({
    url: Api.Create,
    params,
  });
}

/**
 * 修改数据
 */
export function applyUpdate(params: Apply) {
  return defHttp.post<Apply>({
    url: Api.Update,
    params,
  });
}

/**
 * 删除数据
 */
export function applyDelete(params: string) {
  return defHttp.post<boolean>({
    url: Api.Delete,
    params,
  });
}
