|
|
@ -7,6 +7,7 @@ import cn.hutool.core.util.StrUtil;
|
|
|
|
import cn.hutool.http.HttpRequest;
|
|
|
|
import cn.hutool.http.HttpRequest;
|
|
|
|
import cn.hutool.http.HttpResponse;
|
|
|
|
import cn.hutool.http.HttpResponse;
|
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
|
|
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
@ -230,7 +231,7 @@ public class RasaServiceImpl implements RasaService {
|
|
|
|
public GlobalResult<String> trainRasa(String patientId) throws JsonProcessingException {
|
|
|
|
public GlobalResult<String> trainRasa(String patientId) throws JsonProcessingException {
|
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
|
|
param.put("modelId", patientId);
|
|
|
|
param.put("modelId", patientId);
|
|
|
|
String responseBody = HttpUtil.post(trainRasaUrl, param);
|
|
|
|
String responseBody = HttpUtil.post(trainRasaUrl, JSONUtil.toJsonStr(param));
|
|
|
|
return objectMapper.readValue(responseBody, new TypeReference<GlobalResult<String>>() {
|
|
|
|
return objectMapper.readValue(responseBody, new TypeReference<GlobalResult<String>>() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -239,7 +240,7 @@ public class RasaServiceImpl implements RasaService {
|
|
|
|
public GlobalResult<String> runRasa(String patientId) throws JsonProcessingException {
|
|
|
|
public GlobalResult<String> runRasa(String patientId) throws JsonProcessingException {
|
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
|
|
param.put("modelId", patientId);
|
|
|
|
param.put("modelId", patientId);
|
|
|
|
String responseBody = HttpUtil.post(runRasaUrl, param);
|
|
|
|
String responseBody = HttpUtil.post(runRasaUrl, JSONUtil.toJsonStr(param));
|
|
|
|
return objectMapper.readValue(responseBody, new TypeReference<GlobalResult<String>>() {
|
|
|
|
return objectMapper.readValue(responseBody, new TypeReference<GlobalResult<String>>() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|