import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { PartnerWarehouseVO, PartnerWarehouseForm, PartnerWarehouseQuery } from './types';

export function listPartnerWarehouse(query: PartnerWarehouseQuery): AxiosPromise<PartnerWarehouseVO[]> {
  return request({
    url: '/customer/partnerWarehouse/list',
    method: 'get',
    params: query
  });
}

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

export function addPartnerWarehouse(data: PartnerWarehouseForm) {
  return request({
    url: '/customer/partnerWarehouse',
    method: 'post',
    data: data
  });
}

export function updatePartnerWarehouse(data: PartnerWarehouseForm) {
  return request({
    url: '/customer/partnerWarehouse',
    method: 'put',
    data: data
  });
}

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