import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { EnterpriseScaleVO, EnterpriseScaleForm, EnterpriseScaleQuery } from '@/api/customer/enterpriseScale/types';

/**
 * 查询企业规模列表
 * @param query
 * @returns {*}
 */

export const listEnterpriseScale = (query?: EnterpriseScaleQuery): AxiosPromise<EnterpriseScaleVO[]> => {
  return request({
    url: '/customer/enterpriseScale/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询企业规模详细
 * @param id
 */
export const getEnterpriseScale = (id: string | number): AxiosPromise<EnterpriseScaleVO> => {
  return request({
    url: '/customer/enterpriseScale/' + id,
    method: 'get'
  });
};

/**
 * 新增企业规模
 * @param data
 */
export const addEnterpriseScale = (data: EnterpriseScaleForm) => {
  return request({
    url: '/customer/enterpriseScale',
    method: 'post',
    data: data
  });
};

/**
 * 修改企业规模
 * @param data
 */
export const updateEnterpriseScale = (data: EnterpriseScaleForm) => {
  return request({
    url: '/customer/enterpriseScale',
    method: 'put',
    data: data
  });
};

/**
 * 删除企业规模
 * @param id
 */
export const delEnterpriseScale = (id: string | number | Array<string | number>) => {
  return request({
    url: '/customer/enterpriseScale/' + id,
    method: 'delete'
  });
};
