import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SubOrderLogVO, SubOrderLogQuery } from './types';

export const listSubOrderLog = (query: SubOrderLogQuery): AxiosPromise<SubOrderLogVO[]> => {
    return request({
        url: '/order/subOrderLog/list',
        method: 'get',
        params: query
    });
};

/**
 * 导出订单日志
 * @param orderId 订单ID
 */
export const exportSubOrderLog = (orderId: string | number) => {
    return request({
        url: '/order/subOrderLog/export/' + orderId,
        method: 'post'
    });
};

/**
 * 导出订单日志 URL
 * @param orderId 订单ID
 */
export const exportSubOrderLogUrl = (orderId: string | number) => {
    return '/order/subOrderLog/export/' + orderId;
};
