package com.boman.web.core.controller;

import com.boman.domain.dto.AjaxResult;
import com.boman.domain.dto.ProcessDto;
import com.boman.web.core.service.jflow.JFlowProcessService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 *  流程中心控制器
 *
 * @author zhong.h
 * @date 2021-06-22
 * description:流程中心的web层
 */
@RequestMapping("/jflow/process")
@RestController
public class JFlowProcessController {

    @Autowired
    private JFlowProcessService jFlowProcessService;

    /**
     * 实例发起，重启
     *
     * @param processDto
     * @return
     */
    @ApiOperation(value = "发起工作流流程")
    @RequestMapping(value = "/p/c/launch", method = {RequestMethod.POST})
    public AjaxResult launch(@RequestBody ProcessDto processDto) {
        return jFlowProcessService.launch(processDto);
    }
}
