import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { OrderProductVO, OrderProductQuery, OrderProductForm } from './types';

/**
 * 查询订单商品明细列表
 * @param query
 * @returns {*}
 */
export const listOrderProduct = (query?: OrderProductQuery): AxiosPromise<OrderProductVO[]> => {
    return request({
        url: '/order/orderProduct/list',
        method: 'get',
        params: query
    });
};

/**
 * 获取订单商品明细详细信息
 * @param id
 */
export const getOrderProduct = (id: string | number): AxiosPromise<OrderProductVO> => {
    return request({
        url: '/order/orderProduct/' + id,
        method: 'get'
    });
};

/**
 * 中车查看订单商品
 * @param id
 */
export const getZhongCheOrderProducts = (id: string | number): AxiosPromise<OrderProductVO[]> => {
    return request({
        url: '/order/orderProduct/zhongche/' + id,
        method: 'get'
    });
};
