import axios from '@/utils/request'
const baseURL = import.meta.env.VITE_APP_BASE_PROCESS_API;
//查询Xml
export const getXmlInfo = ({id}) => {
  return axios.request({
    baseURL,
    url: `/engine-rest/process-definition/${id}/xml`,
    method: 'get',
    dataType: 'json'
  })
}
// 查询分页数据：
export const getModelerPage = (arg) => {
  return axios.request({
    url: '/sys/Modeler/page',
    method: 'get',
    params: arg,
    dataType: 'json'
  })
}
// 查询详情数据：
export const getModelerDetail = (arg) => {
  return axios.request({
    url: `/sys/Modeler/${arg}`,
    method: 'get',
    params: arg,
    dataType: 'json'
  })
}

// 添加数据：
export const addModeler = (arg) => {
  return axios.request({
    baseURL,
    url: '/engine-rest/deployment/create',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    method: 'post',
    data: arg,
    dataType: 'json'
  })
}

// 修改数据：
export const updateModeler = (arg) => {
  return axios.request({
    url: '/sys/Modeler',
    method: 'put',
    data: arg,
    dataType: 'json'
  })
}

// 删除数据:
export const deleteModeler = (arg) => {
  return axios.request({
    url: '/sys/Modeler',
    method: 'delete',
    data: arg,
    dataType: 'json'
  })
}