import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { PartnerUserVO, PartnerUserForm, PartnerUserQuery } from './types';

export function listPartnerUser(query: PartnerUserQuery): AxiosPromise<PartnerUserVO[]> {
  return request({
    url: '/customer/partnerUser/list',
    method: 'get',
    params: query
  });
}

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

export function addPartnerUser(data: PartnerUserForm) {
  return request({
    url: '/customer/partnerUser',
    method: 'post',
    data: data
  });
}

export function updatePartnerUser(data: PartnerUserForm) {
  return request({
    url: '/customer/partnerUser',
    method: 'put',
    data: data
  });
}

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