import {defHttp} from '/@/utils/http/axios';
import {EventAppendix} from "/@/api/burialPoint/eventAppendix/model/eventAppendixModel";

enum Api {
  queryListByEventId = '/eventAppendix/queryListByEventId',
  Download = '/eventAppendix/download',
  Delete = '/eventAppendix/delete',
}

/**
 * 通过eventId查询数据
 */
export function queryListByEventId(params: string) {
  return defHttp.get<EventAppendix>({
    url: Api.queryListByEventId,
    params,
  });
}

/**
 * 删除数据
 */
export function eventAppendixDelete(params: string) {
  return defHttp.post<EventAppendix>({
    url: Api.Delete + '?id=' + params,
  });
}

/**
 * 附件下载
 */
export function downloadAppendix(params: string) {
  return defHttp.get({
    url: Api.Download + '?id=' + params,
    responseType: 'blob',
  }, {
    isReturnNativeResponse: true,
    isTransformResponse: true
  });
}
