import request from '@/config/axios'

// 兄弟分区 VO
export interface PartitionBrothersVO {
  // 用户编号
  id: number
  // 用户ID
  userId: number
  // 分区编号
  partNo: string
  // 业绩
  price: number
  // 是否碰撞 0为未碰撞 1为已碰撞
  hasHit: number
  // 碰撞后额度
  afterHitQuota: number
  // 是否是大区 0为小区 1为大区
  size: number
}

// 兄弟分区 API
export const PartitionBrothersApi = {
  // 查询兄弟分区分页
  getPartitionBrothersPage: async (params: any) => {
    return await request.get({ url: `/distri/partition-brothers/page`, params })
  },

  // 查询兄弟分区详情
  getPartitionBrothers: async (id: number) => {
    return await request.get({ url: `/distri/partition-brothers/get?id=` + id })
  },

  // 新增兄弟分区
  createPartitionBrothers: async (data: PartitionBrothersVO) => {
    return await request.post({ url: `/distri/partition-brothers/create`, data })
  },

  // 修改兄弟分区
  updatePartitionBrothers: async (data: PartitionBrothersVO) => {
    return await request.put({ url: `/distri/partition-brothers/update`, data })
  },

  // 删除兄弟分区
  deletePartitionBrothers: async (id: number) => {
    return await request.delete({ url: `/distri/partition-brothers/delete?id=` + id })
  },

  // 导出兄弟分区 Excel
  exportPartitionBrothers: async (params) => {
    return await request.download({ url: `/distri/partition-brothers/export-excel`, params })
  }
}