import request from '@/config/axios'

// 员工分配主播 VO
export interface EmployeeHostsVO {
  id: number // 主键
  hostsId: string // 主播id
  userId: number // 用户 Id
  hostsLevel: string // 主播等级
  hostsCoins: number // 主播金币
  invitationType: number // 邀请类型
  onlineFans: number // 在线人数
  fans: number // 粉丝数量
  fllowernum: number // 关注数量
  yesterdayCoins: number // 昨日金币
  country: string // 主播国家
  hostsKind: string // 直播类型 娱乐，游戏
  operationStatus: number // 操作状态
  createTime: string // 创建时间
  updateTime: string // 创建时间
  flag: string // 旗帜
  remake: string // 备注
  uid: string // 用户id
}

// 员工分配主播 API
export const EmployeeHostsApi = {
  // 查询员工分配主播分页
  // getEmployeeHostsPage: async (params: any) => {
  //   return await request.get({ url: `/server/employee-hosts/page`, params })
  // },
  // 查询员工分配主播分页
  getEmployeeHostsPage: async (params: any) => {
    return await request.get({ url: `/server/employee-hosts/self_page`, params })
  },
  // 查询员工分配大哥分页
  getEmployeeHostsPageDsec: async (params: any) => {
    return await request.get({ url: `/server/employee-big-brother/self_complete` })
  },
  // 查询爬主播建联
  employeeCompleteBarChart: async (params: number[], days: number) => {
    return await request.post({
      url: `/server/employee-hosts/employeeCompleteBarChart`,
      data: { userId: params, days: days }
    })
  },
  // 查询爬大哥建联
  employeeCompleteBarChartDsec: async (params: number[], days: number) => {
    return await request.post({
      url: `/server/employee-big-brother/employeeCompleteBarChart`,
      data: { userId: params, days: days }
    })
  },

  // 查询管理员工分配主播分页
  getMeangeEmployeeHostsPage: async (params: any) => {
    return await request.get({ url: `server/employee-hosts/page`, params })
  },
  // 查询员工分配主播详情
  getEmployeeHosts: async (id: number) => {
    return await request.get({ url: `/server/employee-hosts/get?id=` + id })
  },

  // 新增员工分配主播
  createEmployeeHosts: async (data: EmployeeHostsVO) => {
    return await request.post({ url: `/server/employee-hosts/create`, data })
  },

  // 修改员工分配主播
  updateEmployeeHosts: async (data) => {
    return await request.put({ url: `/server/employee-hosts/update`, data })
  },
  // 批量修改员工分配主播
  updateBatchEmployeeHosts: async (data: EmployeeHostsVO[]) => {
    return await request.put({ url: `/server/employee-hosts/batch_update`, data })
  },

  // 删除员工分配主播
  deleteEmployeeHosts: async (id: number) => {
    return await request.delete({ url: `/server/employee-hosts/delete?id=` + id })
  },
  // 删除员工分配主播
  deleteEmployeeHostsList: async (ids: number[]) => {
    return await request.delete({
      url: `/server/employee-hosts/delete-list`,
      params: { ids: ids.join(',') }
    })
  },

  // 导出员工分配主播 Excel
  exportEmployeeHosts: async (params) => {
    return await request.download({ url: `/server/employee-hosts/export-employee-excel`, params })
  }
}
