import request from '@/config/axios'

export interface ChannelConfigVO {
  id: number
  channelName: string
  channelType: number
  iconLink: string
  scenario: number
  status: number
}

// 查询渠道配置列表
export const getChannelConfigPage = async (params) => {
  return await request.get({ url: `/member/channel-config/page`, params })
}

// 查询渠道配置详情
export const getChannelConfig = async (id: number) => {
  return await request.get({ url: `/member/channel-config/get?id=` + id })
}

// 新增渠道配置
export const createChannelConfig = async (data: ChannelConfigVO) => {
  return await request.post({ url: `/member/channel-config/create`, data })
}

// 修改渠道配置
export const updateChannelConfig = async (data: ChannelConfigVO) => {
  return await request.put({ url: `/member/channel-config/update`, data })
}

// 删除渠道配置
export const deleteChannelConfig = async (id: number) => {
  return await request.delete({ url: `/member/channel-config/delete?id=` + id })
}

// 导出渠道配置 Excel
export const exportChannelConfig = async (params) => {
  return await request.download({ url: `/member/channel-config/export-excel`, params })
}
