import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { PartnerContactsVO, PartnerContactsForm, PartnerContactsQuery } from './types';

export function listPartnerContacts(query: PartnerContactsQuery): AxiosPromise<PartnerContactsVO[]> {
  return request({
    url: '/customer/partnerContacts/list',
    method: 'get',
    params: query
  });
}

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

export function addPartnerContacts(data: PartnerContactsForm) {
  return request({
    url: '/customer/partnerContacts',
    method: 'post',
    data: data
  });
}

export function updatePartnerContacts(data: PartnerContactsForm) {
  return request({
    url: '/customer/partnerContacts',
    method: 'put',
    data: data
  });
}

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