import request from '@/utils/request'

/**
 * 待审核列表
 * @param query
 * @returns {*}
 */
export function auditList(query) {
    return request({
        url: '/admin/merchant/auditList',
        method: 'get',
        params: query
    })
}

/**
 * 审核信息详情
 * @param merchantId
 * @returns {*}
 */
export function merchantInfo(merchantId) {
  return request({
    url: '/admin/merchant/merchantInfo?merchantId=' + merchantId,
    method: 'get'
  })
}

/**
 * 处理审核
 * @param data
 * @returns {*}
 */
export function handleAudit(data) {
  return request({
    url: '/admin/merchant/handleAudit',
    method: 'put',
    data: data
  })
}


/**
 * 待审核列表
 * @param query
 * @returns {*}
 */
export function passList(query) {
  return request({
    url: '/admin/merchant/passList',
    method: 'get',
    params: query
  })
}


/**
 * 下架
 * @param data
 * @returns {*}
 */
export function takeOff(data) {
  return request({
    url: '/admin/merchant/takeOff',
    method: 'put',
    data: data
  })
}
/**
 * 上架
 * @param data
 * @returns {*}
 */
export function takeOn(data) {
  return request({
    url: '/admin/merchant/takeOn',
    method: 'put',
    data: data
  })
}

/**
 * 服务人员列表
 * @param params
 * @returns {*}
 */
export function serverUserList(params) {
  return request({
    url: '/admin/server/user/pageList',
    method: 'get',
    params: params
  })
}

/**
 * 根据用户ID查询服务列表
 * @param params
 * @returns {*}
 */
export function serverGoodsList(params) {
  return request({
    url: '/admin/goods/server/serverGoodsList',
    method: 'get',
    params: params
  })
}

/**
 * 服务列表
 * @param params
 * @returns {*}
 */
export function goodsList(params) {
  return request({
    url: '/admin/goods/pageList',
    method: 'get',
    params: params
  })
}

/**
 * 下架
 * @param data
 * @returns {*}
 */
export function goodsTakeOff(data) {
  return request({
    url: '/admin/goods/takeOff',
    method: 'put',
    data: data
  })
}
/**
 * 上架
 * @param data
 * @returns {*}
 */
export function goodsTakeOn(data) {
  return request({
    url: '/admin/goods/takeOn',
    method: 'put',
    data: data
  })
}

/**
 * 删除服务
 * @param goodsId
 * @returns {*}
 */
export function deleteGoods(goodsId) {
  return request({
    url: '/admin/goods/deleteGoods/' + goodsId,
    method: 'delete'
  })
}
