import request from '@/utils/request'

// 查询代练列表
export function listPlayer(query) {
  return request({
    url: '/merchant/player/list',
    method: 'get',
    params: query
  })
}

// 查询代练详细
export function getPlayer(playerId) {
  return request({
    url: '/merchant/player/' + playerId,
    method: 'get'
  })
}

// 更新代练状态
export function updatePlayerStatus(playerId, status) {
  return request({
    url: '/merchant/player/' + playerId + '/status',
    method: 'put',
    data: { status }
  })
}

// 生成邀请码
export function generateInviteCode(data) {
  return request({
    url: '/merchant/invite/generate',
    method: 'post',
    data: data
  })
}

// 查询邀请码列表
export function listInvite(query) {
  return request({
    url: '/merchant/invite/list',
    method: 'get',
    params: query
  })
}

// 查询代练注册申请列表
export function listRegisterApply(query) {
  return request({
    url: '/merchant/player/apply/list',
    method: 'get',
    params: query
  })
}

// 审核代练注册
export function auditRegisterApply(data) {
  return request({
    url: '/merchant/player/audit',
    method: 'post',
    data: data
  })
}
