import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { MainCrrcExtVO, MainCrrcExtForm, MainCrrcExtQuery } from '@/api/order/mainCrrcExt/types';

/**
 * 查询中车电子商城订单扩展列表
 * @param query
 * @returns {*}
 */

export const listMainCrrcExt = (query?: MainCrrcExtQuery): AxiosPromise<MainCrrcExtVO[]> => {
  return request({
    url: '/order/mainCrrcExt/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询中车电子商城订单扩展详细
 * @param id
 */
export const getMainCrrcExt = (id: string | number): AxiosPromise<MainCrrcExtVO> => {
  return request({
    url: '/order/mainCrrcExt/' + id,
    method: 'get'
  });
};

/**
 * 新增中车电子商城订单扩展
 * @param data
 */
export const addMainCrrcExt = (data: MainCrrcExtForm) => {
  return request({
    url: '/order/mainCrrcExt',
    method: 'post',
    data: data
  });
};

/**
 * 修改中车电子商城订单扩展
 * @param data
 */
export const updateMainCrrcExt = (data: MainCrrcExtForm) => {
  return request({
    url: '/order/mainCrrcExt',
    method: 'put',
    data: data
  });
};

/**
 * 删除中车电子商城订单扩展
 * @param id
 */
export const delMainCrrcExt = (id: string | number | Array<string | number>) => {
  return request({
    url: '/order/mainCrrcExt/' + id,
    method: 'delete'
  });
};
