import request from '@/config/axios'

// 分区碰撞 VO
export interface PartitionCrashVO {
  // 用户编号
  id: number
  // 用户ID
  userId: number
  // 分区编号
  partNo: string
  // 兄弟分区额度
  brotherPrice: number
  // 子分区额度
  sonPrice: number
  // 碰撞后额度
  afterHitQuota: number
}

// 分区碰撞 API
export const PartitionCrashApi = {
  // 查询分区碰撞分页
  getPartitionCrashPage: async (params: any) => {
    return await request.get({ url: `/distri/partition-crash/page`, params })
  },
  getPartitionCrashAll: async (params: any) => {
    return await request.get({ url: `/distri/pt-profit-daily-statistics-log/page`, params })
  },
  // 查询分区碰撞详情
  getPartitionCrash: async (id: number) => {
    return await request.get({ url: `/distri/partition-crash/get?id=` + id })
  },

  // 新增分区碰撞
  createPartitionCrash: async (data: PartitionCrashVO) => {
    return await request.post({ url: `/distri/partition-crash/create`, data })
  },

  // 修改分区碰撞
  updatePartitionCrash: async (data: PartitionCrashVO) => {
    return await request.put({ url: `/distri/partition-crash/update`, data })
  },

  // 删除分区碰撞
  deletePartitionCrash: async (id: number) => {
    return await request.delete({ url: `/distri/partition-crash/delete?id=` + id })
  },

  // 导出分区碰撞 Excel
  exportPartitionCrash: async (params) => {
    return await request.download({ url: `/distri/partition-crash/export-excel`, params })
  }
}