import request from '@/config/axios'

// 平台消费分充值记录 VO
export interface ConsumptionTopUpLogVO {
  // 充值编号
  id: number
  // 用户ID
  userId: number
  // 转账凭证附件
  attachment: string
  // 消费分
  consumptionPoints: number
  // 实际消费分
  practicalConsumptionPoints: number
  // 用户名
  userName: string
}

// 平台消费分充值记录 API
export const ConsumptionTopUpLogApi = {
  // 查询平台消费分充值记录分页
  getConsumptionTopUpLogPage: async (params: any) => {
    return await request.get({ url: `/distri/consumption-top-up-log/page`, params })
  },
  // 查询用户自充值记录分页
  getConsumptionUserTopUpLogPage: async (params: any) => {
    return await request.get({ url: `/distri/user-top-up-consumption-points-order/page`, params })
  },
  // 查询平台消费分充值记录分页
  getConsumptionTransfersLog: async (params: any) => {
    return await request.get({ url: `/distri/consumption-transfer-log/page`, params })
  },

  // 查询消费分异动记录分页
  getConsumptionNotice: async (params: any) => {
    return await request.get({ url: `/distri/consumption-error-log/page`, params })
  },
  // 查询消费分异动用户记录分页
  getConsumptionNoticeUser: async (params: any) => {
    return await request.get({ url: `/distri/consumption-error-user/page`, params })
  },
  // 查询平台消费分充值记录详情
  getConsumptionTopUpLog: async (id: number) => {
    return await request.get({ url: `/distri/consumption-top-up-log/get?id=` + id })
  },

  // 新增平台消费分充值记录
  createConsumptionTopUpLog: async (data: ConsumptionTopUpLogVO) => {
    return await request.post({ url: `/distri/consumption-top-up-log/create`, data })
  },

  // 修改平台消费分充值记录
  updateConsumptionTopUpLog: async (data: ConsumptionTopUpLogVO) => {
    return await request.put({ url: `/distri/consumption-top-up-log/update`, data })
  },

  // 删除平台消费分充值记录
  deleteConsumptionTopUpLog: async (id: number) => {
    return await request.delete({ url: `/distri/consumption-top-up-log/delete?id=` + id })
  },

  // 导出平台消费分充值记录 Excel
  exportConsumptionTopUpLog: async (params) => {
    return await request.download({ url: `/distri/consumption-top-up-log/export-excel`, params })
  },

  // 查询用户是否第一次充值消费分
  isUserFirstRecharge: async (params: any) => {
    return await request.get({ url: `/distri/consumption-top-up-log/isFirstConsumption`, params })
  },
  
}