import Request from '@/utils/request/request-util';

/**
 * low_code 流程发起api
 *
 */
export class FlowStartApi {
  /**
   * 获取流程定义下，绑定的表单设计列表
   * @param {*} params
   * @returns
   */
  static getFlowDefinitionFormConfig(params) {
    return Request.get('/getFlowDefinitionFormConfig', params);
  }

  /**
   * 发起流程接口
   * @param {*} params
   * @returns
   */
  static start(params) {
    return Request.post('/workflowControl/start', params);
  }

  /**
   * 保存流程草稿
   * @param {*} params
   * @returns
   */
  static saveDraft(params) {
    return Request.post('/workflowControl/saveDraft', params);
  }

  /**
   * 获取草稿详情
   * @param {*} params
   * @returns
   */
  static flowEngineDraftDetail(params) {
    return Request.get('/flowEngineDraft/getDetail', params);
  }

  /**
   * 获取指定流程定义下，发起人可以操作的按钮权限
   *
   * @author nxy
   * @date 2021/4/1 16:07
   */
  static getApplicantButtonPermission(params) {
    return Request.getAndLoadData('/startPage/getApplicantButtonPermission', params);
  }
}
