import request from '@/utils/request'


// 查询渠道列表
export function listChannel(query) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/business/channel/list',
    method: 'get',
    params: query
  })
}

// 查询渠道类型列表
export function listCategory(query) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/business/category/list',
    method: 'get',
    params: query
  })
}

// 查询渠道详细
export function getChannel(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/business/channel/' + id,
    method: 'get'
  })
}

// 新增渠道
export function addChannel(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/business/channel',
    method: 'post',
    data: data
  })
}

// 修改渠道
export function updateChannel(data) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/business/channel',
    method: 'put',
    data: data
  })
}

// 删除渠道
export function delChannel(id) {
  request.defaults.baseURL = '/ezhizao-yzbh-crm'
  return request({
    url: '/business/channel/' + id,
    method: 'delete'
  })
}
