import request from '@/config/axios'

export interface UserBankVO {
  id: number
  userId: number
  bankName: string
  bankCountry: string
  accountName: string
  accountNumber: string
  iban: string
  swiftBicCode: string
  bankAddress: string
  branchName: string
  branchAddress: string
}

// 查询会员银行卡列表
export const getUserBankPage = async (params) => {
  return await request.get({ url: `/member/user-bank/page`, params })
}

// 查询会员银行卡详情
export const getUserBank = async (id: number) => {
  return await request.get({ url: `/member/user-bank/get?id=` + id })
}

// 新增会员银行卡
export const createUserBank = async (data: UserBankVO) => {
  return await request.post({ url: `/member/user-bank/create`, data })
}

// 修改会员银行卡
export const updateUserBank = async (data: UserBankVO) => {
  return await request.put({ url: `/member/user-bank/update`, data })
}

// 删除会员银行卡
export const deleteUserBank = async (id: number) => {
  return await request.delete({ url: `/member/user-bank/delete?id=` + id })
}

// 导出会员银行卡 Excel
export const exportUserBank = async (params) => {
  return await request.download({ url: `/member/user-bank/export-excel`, params })
}
