import service from '@/utils/request'

// @tag user
// @summary 获取用户列表
// @param {object} params
// @return {object} data
// @router get /user/list
export const list = (params) => {
  return service({
    url: '/app_user/list',
    method: 'get',
    params
  })
}

// /app_user/status/:id
export const status = (data) => {
  return service({
    url: '/app_user/status/' + data.ID,
    method: 'put',
    data
  })
}

// 获取用户详情
export const getUserDetail = (id) => {
  return service({
    url: `/app_user/${id}`,
    method: 'get'
  })
}

// 用户注册
export const register = (data) => {
  return service({
    url: '/app_user/register',
    method: 'post',
    data
  })
}

// 修改用户余额
export const setBalance = (data) => {
  return service({
    url: '/app_user/setBalance',
    method: 'put',
    data
  })
}


// 获取讲师申请列表
export const getTeacherApplyList = (params) => {
  return service({
    url: '/app_user/teacherApplyList',
    method: 'get',
    params
  })
}

// 讲师申请审核
export const reviewTeacherApply = (data) => {
  return service({
    url: '/app_user/teacherApply/status',
    method: 'put',
    data
  })
}

// 修改用户VIP
export const setVip = (data) => {
  return service({
    url: '/app_user/setUserVip',
    method: 'put',
    data
  })
}


// GetLoginInfo
export const getLoginInfo = (params) => {
  return service({
    url: '/app_user/login/log',
    method: 'get',
    params
  })
}

// RemoveUserVip
export const removeUserVip = (data) => {
  return service({
    url: '/app_user/vip',
    method: 'delete',
    data
  })
}


// getVipUserList
export const getVipUserList = (params) => {
  return service({
    url: '/app_user/vip/list',
    method: 'get',
    params
  })
}

// setTeacherWeight 设置讲师权重
export const setTeacherWeight = (data) => {
  return service({
    url: '/app_user/weight',
    method: 'put',
    data
  })
}

// setTeacherRate 设置讲师分成比例
export const setTeacherRate = (data) => {
  return service({
    url: '/app_user/rate',
    method: 'put',
    data
  })
}

// =============IP检测相关=================
export const getIpCon = () => {
  return service({
    url: '/app_user/ipCon',
    method: 'get',
  })
}
export const setIpCon = (data) => {
  return service({
    url: '/app_user/ipCon',
    method: 'put',
    data
  })
}
export const setIpStatus = (data) => {
  return service({
    url: '/app_user/ipStatus',
    method: 'put',
    data
  })
}
export const getIpStatus = () => {
  return service({
    url: '/app_user/ipStatus',
    method: 'get',
  })
}