import request from '@/utils/request'

export function listModeler(query) {
  return request({
    url: '/activiti/modeler/list',
    method: 'get',
    params: query
  })
}

export function deployModeler(id) {
  return request({
    url: '/activiti/modeler/deploy',
    method: 'post',
    params: {
      id: id
    }
  })
}

export function suspendOrActiveApply(id, suspendState) {
  return request({
    url: '/activiti/definition/suspendOrActiveApply',
    method: 'post',
    params: {
      'id': id,
      'suspendState': suspendState
    }
  })
}

export function delModeler(id) {
  return request({
    url: '/activiti/modeler/remove',
    method: 'post',
    params: {
      id: id
    }
  })
}

export function getActCategroy() {
  return request({
    url: '/activiti/category/listCategory',
    method: 'get'
  })
}

/**
 * date:2020-08-05
 * author:changliang
 * 增加数据关联
 * */
  export function addDataAssociation(query) {

    return request({
      url: '/activiti/association/addDataAssociation',
      method: 'post',
      params: query
    })
}
/**
 * date:2020-08-05
 * author:changliang
 * 显示数据关联
 * */
export function getListDataAssociation(actkey) {

  return request({
    url: '/activiti/association/list/'+actkey,
    method: 'get',
  })
}

/**
 * date:2020-08-05
 * author:changliang
 * 显示数据关联
 * */
export function removeDataAssociation(id) {
  return request({
    url: '/activiti/association/remove/'+id,
    method: 'get',
  })
}
