import request from '@/utils/request';
import { BankVO, BankQuery, BankForm } from './types';

/**
 * 查询银行列表
 */
export function listBank(query: BankQuery) {
  return request<any>({
    url: '/system/bank/list',
    method: 'get',
    params: query
  });
}

/**
 * 查询银行详细
 */
export function getBank(id: string | number) {
  return request<any>({
    url: '/system/bank/' + id,
    method: 'get'
  });
}

/**
 * 新增银行
 */
export function addBank(data: BankForm) {
  return request<any>({
    url: '/system/bank',
    method: 'post',
    data: data
  });
}

/**
 * 修改银行
 */
export function updateBank(data: BankForm) {
  return request<any>({
    url: '/system/bank',
    method: 'put',
    data: data
  });
}

/**
 * 删除银行
 */
export function delBank(id: string | number | Array<string | number>) {
  return request<any>({
    url: '/system/bank/' + id,
    method: 'delete'
  });
}
