import request from '@/config/axios'

// 大哥数据 VO
export interface BigBrotherVO {
  id: number // 主键id
  displayId: string // 大哥的display_id
  userIdStr: string // 大哥的用户id
  nickname: string // 大哥的用户昵称
  level: number // 大哥的等级
  hostcoins: number // 大哥打赏的金币
  followerCount: number // 大哥的粉丝数
  followingCount: number // 大哥的关注数
  region: string // 大哥所在的地区
  historicHighCoins: number // 大哥打赏的历史最高金币
  totalGiftCoins: number // 大哥历史打赏金币总和
  hostDisplayId: string // 大哥所在的直播间的主播display_id
  ownerId: string // 该数据所属的账号id
}

// 大哥数据 API
export const BigBrotherApi = {
  // 查询大哥数据分页
  getBigBrotherPage: async (params: any) => {
    return await request.get({ url: `/server/big-brother/page`, params })
  },

  // 查询大哥数据详情
  getBigBrother: async (id: number) => {
    return await request.get({ url: `/server/big-brother/get?id=` + id })
  },

  // 新增大哥数据
  createBigBrother: async (data: BigBrotherVO) => {
    return await request.post({ url: `/server/big-brother/create`, data })
  },

  // 修改大哥数据
  updateBigBrother: async (data: BigBrotherVO) => {
    return await request.put({ url: `/server/big-brother/update`, data })
  },

  
   // 分配大哥
   Allocation: async (data: BigBrotherVO[]) => {
    return await request.post({ url: `/server/employee-big-brother/allocation`, data })
  },
  
  // 删除大哥数据
  deleteBigBrother: async (id: number) => {
    return await request.delete({ url: `/server/big-brother/delete?id=` + id })
  },
// 批量删除大哥数据
  deleteBigBrotherList: async (ids: number[]) => {
    return await request.delete({ url: `/server/big-brother/delete-list` ,  params: { ids: ids.join(',') } })
  },
  
  // 导出大哥数据 Excel
  exportBigBrother: async (params) => {
    return await request.download({ url: `/server/big-brother/export-excel`, params })
  }
}