import request from '@/utils/request'
import { PageType, StrAnyObj } from '@/typings'
import download from "@/utils/download";

// 资金流水分页
export function getPageApi(params: StrAnyObj): Promise<PageType<StrAnyObj>> {
  return request.get('/capitalTransactions/getPage', params)
}

// 资金流水分页
export function excelExportApi(params: StrAnyObj): Promise<void> {
  return download.get('/capitalTransactions/excelExport', params)
}

// 资金流水明细
export function getDetailApi(params: StrAnyObj): Promise<StrAnyObj> {
  return request.get('/capitalTransactions/getDetail', params)
}

// 资金流水新增
export function addApi(data: StrAnyObj): Promise<void> {
  return request.post('/capitalTransactions/add', data)
}

// 资金流水编辑
export function editApi(data: StrAnyObj): Promise<void> {
  return request.post('/capitalTransactions/edit', data)
}

// 资金流水删除
export function deleteApi(data: StrAnyObj): Promise<void> {
  return request.post('/capitalTransactions/delete', data)
}
