import request from '@/utils/request';

/**
 * 查询列表
 * @param {*} params
 * @returns
 */
export const getPackageList = (params) => request('/package', { params });


/**
 * 新增
 * @param {*} data
 * @returns
 */
export const addPackage = (data) => request('/package', { method: 'post', data });

/**
 * 新增
 *  @param {*} id
 * @param {*} data
 * @returns
 */
export const updataPackage = (data, id) => request(`/package/${id}`, { method: 'put', data });

/**
 * 删除
 *  @param {*} id
 * @returns
 */
export const deletePackage = id => request(`/package/${id}`, { method: 'delete' });


/**
 * 获取明细
 * @param {*} params 
 * @returns 
 */
export const getPackageDetailList = params => request('/packageDetail', { params });


/**
 * 新增明细
 * @param {*} data 
 * @returns 
 */
 export const addPackageDetail = data => request('/packageDetail', { method: 'post', data });
 

/**
 * 删除明细
 * @param {*} params 
 * @returns 
 */
 export const deletePackageDetail = params => request('/packageDetail', { method: 'delete', params });