import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { PartnerContractVO, PartnerContractForm, PartnerContractQuery } from './types';

export function listPartnerContract(query: PartnerContractQuery): AxiosPromise<PartnerContractVO[]> {
  return request({
    url: '/customer/partnerContract/list',
    method: 'get',
    params: query
  });
}

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

export function addPartnerContract(data: PartnerContractForm) {
  return request({
    url: '/customer/partnerContract',
    method: 'post',
    data: data
  });
}

export function updatePartnerContract(data: PartnerContractForm) {
  return request({
    url: '/customer/partnerContract',
    method: 'put',
    data: data
  });
}

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