import request from '@/utils/request';

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

/**
 * 查询食材列表
 * @param {*} params
 * @returns
 */
export const getFoodIngredientsList = (params) => request('/foodIngredients', { params });

/**
 * 详情
 * @param {*} id
 * @returns
 */
export const getDishById = (id) => request(`/dishes/${id}`);

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

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

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