channel.js 1.41 KB
Newer Older
dragondean@qq.com's avatar
dragondean@qq.com committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
import request from '@/utils/request'

// 创建渠道管理
export function createChannel(data) {
  return request({
    url: '/ecw/channel/create',
    method: 'post',
    data: data
  })
}

// 更新渠道管理
export function updateChannel(data) {
  return request({
    url: '/ecw/channel/update',
    method: 'put',
    data: data
  })
}

// 删除渠道管理
export function deleteChannel(id) {
  return request({
zhengyi's avatar
zhengyi committed
24
    url: '/ecw/channel/delete?channelId=' + id,
dragondean@qq.com's avatar
dragondean@qq.com committed
25 26 27 28 29 30 31
    method: 'delete'
  })
}

// 获得渠道管理
export function getChannel(id) {
  return request({
32
    url: '/ecw/channel/get?channelId=' + id,
dragondean@qq.com's avatar
dragondean@qq.com committed
33 34 35 36 37 38 39 40 41 42 43 44
    method: 'get'
  })
}

// 获得渠道管理分页
export function getChannelPage(query) {
  return request({
    url: '/ecw/channel/page',
    method: 'get',
    params: query
  })
}
邓春圆's avatar
邓春圆 committed
45 46 47 48 49 50 51
//启用-禁用渠道
export function channelSwitch(id){
  return request({
    url:`/ecw/channel/switch/${id}`,
    method:'put'
  })
}
52 53 54 55 56 57 58 59 60
// 获得渠道列表 TODO
export function getChannelList(query) {
  return request({
    url: '/ecw/channel/select',
    method: 'get',
    params: query
  })
}

dragondean@qq.com's avatar
dragondean@qq.com committed
61 62 63 64 65 66 67 68 69
// 导出渠道管理 Excel
export function exportChannelExcel(query) {
  return request({
    url: '/ecw/channel/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
70

邓春圆's avatar
邓春圆 committed
71
//
72 73 74 75 76 77 78
export function getChannelListByIds(params){
  return request({
    url: '/ecw/channel/list',
    method: 'get',
    params
  })
}