import { request } from '@/service/request';

/**
 * 分页获取积分列表
 * @param params
 * @returns
 */
export function fetchGetPointsList(params: any) {
  return request<Api.government.PointsRecharge[]>({
    url: '/platform/pointsRecharge/page',
    method: 'get',
    params
  });
}

/**
 * 导入积分充值数据
 * @param params
 * @returns
 */
export function fetchImportPoints(params: File) {
  return request({
    url: '/platform/pointsRecharge/import',
    method: 'post',
    data: {
      file: params
    },
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
}

/** 获取积分充值统计列表
 *
 * @param params
 * @returns
 */
export function fetchGetPointsOutList(params: any) {
  return request<Api.government.PointsRechargeVO[]>({
    url: '/platform/pointsRecharge/statisticsList',
    method: 'get',
    params
  });
}

/**
 *  获取积分充值失败列表
 * @param params
 * @returns
 */
export function fetchGetFailPointsList() {
  return request<Api.government.PointsFailureRecordVO[]>({
    url: '/platform/pointsFailureRecord/groupByCode',
    method: 'get'
  });
}
