import request from '@/config/axios'


export interface uiComponentSaveReqVO{
  id:number,
  componentName:string,
  componentCategory:string,
  componentThumbnail?:string,
  componentFilePath:string,
}

// 查询组件列表
export const getUiComponentPage=async(params:PageParam)=>{
  return await request.get({url:'/sys/ui-component/getUiComponentPage',params})
}

//获得组件详细信息
export const selectUiComponentById=async(id:number)=>{
  return await request.get({url:'/sys/ui-component/selectUiComponentById',params:{id:id}})
}

//创建组件
export const insertUiComponent=async(data:uiComponentSaveReqVO)=>{
  return  await request.post({url:'/sys/ui-component/insertUiComponent',data})
}

// 更新组件
export const updateUiComponent=async(data:uiComponentSaveReqVO)=>{
  return await request.put({url:'/sys/ui-component/updateUiComponent',data})
}

// 批量删除组件
export const deleteUiComponentList=async(ids:[])=>{
  return await request.delete({url:'/sys/ui-component/deleteUiComponentList?ids='+ids})
}
