import request from '@/utils/request'

// 导出
export function exportChannel(query) {
  return request({
    url: '/channel/info/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
//获取渠道列表
export function listChannel(query) {
  return request({
    url: '/channel/info/page',
    method: 'get',
    params: query
  })
}
//新增渠道列表
export function addChannel(params) {
  return request({
    url: "/channel/info/create",
    method: 'post',
    data: params
  })
}
//删除渠道
export function delChannel(params) {
  return request({
    url: '/channel/info/delete',
    method: 'delete',
    params
  })
}

//获取一条数据
export function getOne(query) {
  return request({
    url: '/channel/info/list',
    method: 'get',
    params: query
  })
}

//编辑一条数据
export function editChannel(params) {
  return request({
    url: '/channel/info/update',
    method: 'put',
    data: params
  })
}

//获取二级列表
export function Channelsecondd(query) {
  return request({
    url: '/channel/info/listChannels',
    method: 'get',
    params: query
  })
}

//新增历史记录
export function createHistory(params) {
  return request({
    url: "/channel/info/create",
    method: 'post',
    data: params
  })
}

//获取历史记录
export function listChannelHistory(query) {
  return request({
    url: '/channel/log/page',
    method: 'get',
    params: query
  })
}

//查询一级获取渠道列表
export function listChanneGet(query) {
  return request({
    url: '/channel/info/get',
    method: 'get',
    params: query
  })
}
