|
|
|
package com.superversion.rasa.controller;
|
|
|
|
|
|
|
|
import com.superversion.rasa.pojo.vo.RasaArgument;
|
|
|
|
import com.superversion.rasa.service.RasaCmdService;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import java.io.*;
|
|
|
|
import java.util.concurrent.*;
|
|
|
|
|
|
|
|
@Api(tags = "rasa文件保存")
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("rasaCmd")
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
public class RasaCmdController {
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private RasaCmdService rasaCmdService;
|
|
|
|
|
|
|
|
@ApiOperation("执行训练shell命令")
|
|
|
|
@PostMapping("/trainExec")
|
|
|
|
public String trainExec(@RequestBody RasaArgument argument) throws IOException, ExecutionException, InterruptedException, TimeoutException {
|
|
|
|
|
|
|
|
return rasaCmdService.trainExec(argument);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@ApiOperation("执行启动shell命令")
|
|
|
|
@PostMapping("/runExec")
|
|
|
|
public String runExec(@RequestBody RasaArgument argument) throws ExecutionException, InterruptedException, TimeoutException {
|
|
|
|
|
|
|
|
return rasaCmdService.runExec(argument);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|