import request from '@/utils/request'
import Qs from 'qs'
export function listChannel(query) {
  return request({
    url: '/channel/list',
    method: 'get',
    params: query
  })
}

export function createChannel(data) {
  return request({
    url: '/channel/create',
    method: 'post',
    data
  })
}

export function allChannel(query) { 
  return request({
    url: '/channel/all',
    method: 'get',
    params: query
  })
}

export function readChannel(query) {
  return request({
    url: '/channel/read',
    method: 'get',
    params: query
  })
}

export function updateChannel(data) {
  return request({
    url: '/channel/update',
    method: 'post',
    data
  })
}

export function deleteChannel(data) {
  return request({
    url: '/channel/delete',
    method: 'post',
    data
  })
}

export function qrCode(query) { 
  return request({
    url: '/channel/qrcode',
    method: 'get',
    params: query
  })
}
export function updateChannelCity(query) { 
  return request({
    url: '/goods/updateChannelCity',
    method: 'get',
    params: query,
    paramsSerializer: function(params) {
      return Qs.stringify(params, { arrayFormat:'repeat' })
    }
  })
}

