import request from '@/config/axios'

export interface RecipeVO {
  id: number
  name: string
  process: string
  remark: string
}

export const RecipeApi = {
  getRecipePage: async (params: any) => {
    return await request.get({ url: `/iot/recipe-type/page`, params })
  },

  getRecipe: async (id: number) => {
    return await request.get({ url: `/iot/recipe-type/get?id=` + id })
  },

  createRecipe: async (data: Partial<RecipeVO>) => {
    return await request.post({ url: `/iot/recipe-type/create`, data })
  },

  updateRecipe: async (data: Partial<RecipeVO>) => {
    return await request.put({ url: `/iot/recipe-type/update`, data })
  },

  deleteRecipe: async (id: number) => {
    return await request.delete({ url: `/iot/recipe-type/delete?id=` + id })
  },

  exportRecipe: async (params) => {
    return await request.download({ url: `/iot/recipe-type/export-excel`, params })
  }
}
