import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { PartnerBankVO, PartnerBankForm, PartnerBankQuery } from './types';

export function listPartnerBank(query: PartnerBankQuery): AxiosPromise<PartnerBankVO[]> {
  return request({
    url: '/customer/partnerBank/list',
    method: 'get',
    params: query
  });
}

export function getPartnerBank(id: string | number): AxiosPromise<PartnerBankVO> {
  return request({
    url: '/customer/partnerBank/' + id,
    method: 'get'
  });
}

export function addPartnerBank(data: PartnerBankForm) {
  return request({
    url: '/customer/partnerBank',
    method: 'post',
    data: data
  });
}

export function updatePartnerBank(data: PartnerBankForm) {
  return request({
    url: '/customer/partnerBank',
    method: 'put',
    data: data
  });
}

export function delPartnerBank(ids: string | number | Array<string | number>) {
  return request({
    url: '/customer/partnerBank/' + ids,
    method: 'delete'
  });
}
