import { del, get, post, put } from '../../http'

/**
 * @description: 获取功能介绍列表
 * @param {*} params
 * @return {*}
 */
export const getWebFunList = async (params: Record<string, any>) => {
  return await get<any>('/functionalManagement/list', params)
}

/**
 * @description: 创建功能
 * @param {Record} params
 * @param {*} any
 */
export const createWebFun = async (data: Record<string, any>) => {
  return await post<any>('/functionalManagement', data)
}

/**
 * @description: 更新功能
 * @param {Record} data
 * @param {*} any
 */
export const saveWebFun = async (data: Record<string, any>) => {
  return await put('/functionalManagement', data)
}

/**
 * @description: 功能状态切换
 * @param {string} id
 */
export const webFunStatus = async (id: string) => {
  return await post<any>(`/functionalManagement/changeStatus/${id}`)
}

/**
 * @description: 删除功能
 * @param {string} id
 */
export const webFunDelete = async (id: string) => {
  return await del(`/functionalManagement/${id}`)
}
