liveRoom.js 2.98 KB
import { http } from '@/main'

const defaultPath = 'scrm.api.live.'

const getLiveRoomListApi = params => {
  params.method = `${defaultPath}live.room.list`
  return http({
    url: 'rop-scrm-live/router',
    method: 'GET',
    data: params,
    sign: true
  })
}

const getLiveShareApi = params => {
  params.method = `${defaultPath}get.shared.code`
  return http({
    url: 'rop-scrm-live/router',
    method: 'GET',
    data: params,
    sign: true
  })
}

const insertLiveRoomApi = params => {
  params.method = `${defaultPath}insert.live.room`
  return http({
    url: 'rop-scrm-live/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

const deleteLiveRoomApi = params => {
  params.method = `${defaultPath}delete.live.room`
  return http({
    url: 'rop-scrm-live/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

const getLiveRoomInfoApi = params => {
  params.method = `${defaultPath}get.live.room.by.id`
  return http({
    url: 'rop-scrm-live/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

const getControlInfoApi = params => {
  params.method = `${defaultPath}get.control`
  return http({
    url: 'rop-scrm-live/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

const getControlImportListApi = params => {
  params.method = `${defaultPath}get.import.goods`
  return http({
    url: 'rop-scrm-live/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

const getWaitImportListApi = params => {
  params.method = `${defaultPath}get.wait.import.goods`
  return http({
    url: 'rop-scrm-live/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

const importGoodsApi = params => {
  params.method = `${defaultPath}import.goods`
  return http({
    url: 'rop-scrm-live/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

const updateCommentApi = params => {
  params.method = `${defaultPath}update.comment`
  return http({
    url: 'rop-scrm-live/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

const updateReplayApi = params => {
  params.method = `${defaultPath}update.replay`
  return http({
    url: 'rop-scrm-live/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

const controlUpOrDownApi = params => {
  params.method = `${defaultPath}toggle.status`
  return http({
    url: 'rop-scrm-live/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

const controlDeleteApi = params => {
  params.method = `${defaultPath}delete.room.goods`
  return http({
    url: 'rop-scrm-live/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

export { getLiveRoomListApi, getLiveShareApi, insertLiveRoomApi, deleteLiveRoomApi, getLiveRoomInfoApi, getControlInfoApi, getControlImportListApi, getWaitImportListApi, importGoodsApi, updateCommentApi, updateReplayApi, controlUpOrDownApi, controlDeleteApi }