import request from '@/utils/request';
import { OrderSettingVO, OrderSettingForm } from './types';
import { AxiosPromise } from 'axios';

/**
 * 获取订单设置详情
 * @param id 设置ID
 */
export function getOrderSetting(id: number | string): AxiosPromise<OrderSettingVO> {
  return request({
    url: `/order/setting/${id}`,
    method: 'get'
  });
}

/**
 * 修改订单设置
 * @param data 设置数据
 */
export function updateOrderSetting(data: OrderSettingForm): AxiosPromise<void> {
  return request({
    url: '/order/setting/edit',
    method: 'put',
    data: data
  });
}
