import service from '@/utils/service'

const baseUrl = process.env.VUE_APP_HOST + '/manager/api/cp_game'

const cpGame = {}

cpGame.baseUrl = baseUrl

cpGame.getList = params => {
  return service({
    url: `${baseUrl}/v1/list`,
    method: 'get',
    params: params
  })
}

cpGame.getById = id => {
  return service({
    url: `${baseUrl}/v1/${id}`,
    method: 'get',
  })
}

cpGame.add = data => {
  return service({
    url: `${baseUrl}/v1`,
    method: 'post',
    data: data
  })
}

cpGame.update = data => {
  return service({
    url: `${baseUrl}/v1`,
    method: 'put',
    data: data
  })
}

export default cpGame