rasa: 设置modelId默认为1

dev_2.0.0
xueqingkun 1 year ago
parent b5377bb305
commit 497a5a0ebc

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

@ -69,6 +69,7 @@ public class HumanUtil {
String res = HttpUtil.get(TEXT_DRIVEN_URL, param); String res = HttpUtil.get(TEXT_DRIVEN_URL, param);
HumanRes resDTO = JSONUtil.toBean(res, HumanRes.class); HumanRes resDTO = JSONUtil.toBean(res, HumanRes.class);
if (!"200".equals(resDTO.code)) { if (!"200".equals(resDTO.code)) {
log.info("播放结果:{}",res);
throw HumanException.humanError("播放语音失败"); throw HumanException.humanError("播放语音失败");
} }
} }

Loading…
Cancel
Save