import request from '@/utils/request'; import { AxiosPromise } from 'axios'; import { RecipeCategoryVO, RecipeCategoryForm, RecipeCategoryQuery } from '@/api/system/recipeCategory/types'; /** * 查询食谱分类管理列表 * @param query * @returns {*} */ export const listRecipeCategory = (query?: RecipeCategoryQuery): AxiosPromise => { return request({ url: '/system/recipeCategory/list', method: 'get', params: query }); }; /** * 查询食谱分类管理详细 * @param recipeCategoryId */ export const getRecipeCategory = (recipeCategoryId: string | number): AxiosPromise => { return request({ url: '/system/recipeCategory/' + recipeCategoryId, method: 'get' }); }; /** * 新增食谱分类管理 * @param data */ export const addRecipeCategory = (data: RecipeCategoryForm) => { return request({ url: '/system/recipeCategory', method: 'post', data: data }); }; /** * 修改食谱分类管理 * @param data */ export const updateRecipeCategory = (data: RecipeCategoryForm) => { return request({ url: '/system/recipeCategory', method: 'put', data: data }); }; /** * 删除食谱分类管理 * @param recipeCategoryId */ export const delRecipeCategory = (recipeCategoryId: string | number | Array) => { return request({ url: '/system/recipeCategory/' + recipeCategoryId, method: 'delete' }); };