import request from '@/config/axios'

export interface ChannelVO {
  accountCode: string
  accountName: string
  bankName: string
  bankCountry: string
  iban: string
  bankAddress: string
  branchName: string
  branchAddress: string
  configId: number
}

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

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

// 新增渠道列
export const createChannel = async (data: ChannelVO) => {
  return await request.post({ url: `/member/channel/create`, data })
}

// 修改渠道列
export const updateChannel = async (data: ChannelVO) => {
  return await request.put({ url: `/member/channel/update`, data })
}

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

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