import { requestClient } from '#/api/request';

async function queryPage(param) {
  return requestClient.post('/auth/RobotFee/queryPage', param);
}

async function queryList(param) {
  return requestClient.post('/auth/RobotFee/queryList', param);
}

async function create(param) {
  return requestClient.post('/auth/RobotFee/addOne', param);
}

async function removeByUid(param) {
  return requestClient.post('/auth/RobotFee/removeByUid/' + param.uuid, param);
}

async function updateByUid(param) {
  return requestClient.post('/auth/RobotFee/updateByUid/' + param.uuid, param);
}

async function getById(param) {
  return requestClient.post('/auth/RobotFee/getById', param);
}

async function getByUuid(param) {
  return requestClient.post('/auth/RobotFee/getByUuid', param);
}
/**
 * 资金池统计数据
 * @param param 
 * @returns 
 * 返回数据，data的值为：
 * {
 *  "totalPool": 0.0,
 *  "totalAllocatedAmount": 0.0,
 *  "usedAmount": 0.0,
 *  "allocatedAmount": 0.0,
 *  "availableAmount": 0.0
 * }
 */
async function getFeeStatistics(param) {
  return requestClient.post('/auth/RobotFee/getFeeStatistics', param);
}

export const robotFee = {
  queryPage,
  queryList,
  create,
  removeByUid,
  updateByUid,
  getById,
  getByUuid,
  getFeeStatistics
}