import request from '@/utils/request'
import { URL } from '@/config'

export function getListChannel(params) {
  return request({
    url: URL.account.user.base.getListChannel,
    method: 'get',
    params,
  })
}

export function getListChannelCode(params) {
  return request({
    url: URL.account.user.base.getListChannelCode,
    method: 'get',
    params,
  })
}

export function getListChannelCodes(params) {
  return request({
    url: URL.account.user.base.getListChannelCodes,
    method: 'get',
    params,
  })
}

export function doEditChannel(data) {
  return request({
    url: URL.account.user.base.doEditChannel,
    method: 'post',
    data,
  })
}

export function doEditChannelCode(data) {
  return request({
    url: URL.account.user.base.doEditChannelCode,
    method: 'post',
    data,
  })
}

export function doAddChannelCode(data) {
  return request({
    url: URL.account.user.base.doAddChannelCode,
    method: 'post',
    data,
  })
}

export function doDeleteChannel(data) {
  return request({
    url: URL.account.user.base.doDeleteChannel,
    method: 'post',
    data,
  })
}

export function doDeleteChannelCode(data) {
  return request({
    url: URL.account.user.base.doDeleteChannelCode,
    method: 'post',
    data,
  })
}

export function getListChannelBring(params) {
  return request({
    url: URL.account.user.base.getListChannelBring,
    method: 'get',
    params,
  })
}

export function poster(data) {
  return request({
    url: URL.account.user.base.poster,
    method: 'post',
    data,
  })
}

export function channelBringExportFile(data) {
  return request({
    url: URL.account.user.base.channelBringExportFile,
    method: 'post',
    data,
    responseType: 'blob',
  })
}
