|
|
|
@ -25,11 +25,7 @@ public class RasaCmdController {
|
|
|
|
|
@PostMapping("/trainExec")
|
|
|
|
|
public String trainExec(@RequestBody RasaCmdArgumentVo argument) throws IOException, ExecutionException, InterruptedException, TimeoutException {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isEmpty(argument.getModelId())){
|
|
|
|
|
throw new BusinessException("modelId参数不能为空! ");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
argument.setModelId("1");
|
|
|
|
|
return rasaCmdService.trainExec(argument);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -38,9 +34,7 @@ public class RasaCmdController {
|
|
|
|
|
@PostMapping("/runExec")
|
|
|
|
|
public String runExec(@RequestBody RasaCmdArgumentVo argument) throws ExecutionException, InterruptedException, TimeoutException {
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isEmpty(argument.getModelId())){
|
|
|
|
|
throw new BusinessException("modelId参数不能为空! ");
|
|
|
|
|
}
|
|
|
|
|
argument.setModelId("1");
|
|
|
|
|
String outString = rasaCmdService.runExec(argument);
|
|
|
|
|
if (StrUtil.isEmptyIfStr(outString) || !outString.contains(RasaConstant.RUN_SUCCESS_MESSAGE)){
|
|
|
|
|
throw new BusinessException("任务执行异常。详细日志:"+outString);
|
|
|
|
|