Commit c042bad4 authored by jennie chen's avatar jennie chen

修改部分细节

parent 9c34cbfd
...@@ -142,7 +142,8 @@ public class AgentApplicationInfoConvert { ...@@ -142,7 +142,8 @@ public class AgentApplicationInfoConvert {
Variable variable = new Variable(); Variable variable = new Variable();
String input = variableStructure[i]; String input = variableStructure[i];
// 定义正则表达式模式 // 定义正则表达式模式
Pattern pattern = Pattern.compile("(key|default):([^,]+)"); String regex = "\"key\":\"(.*?)\",\"default\":\"(.*?)\"";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(input); Matcher matcher = pattern.matcher(input);
if (matcher.find()) { if (matcher.find()) {
variable.setKey(matcher.group(1)); variable.setKey(matcher.group(1));
...@@ -202,7 +203,7 @@ public class AgentApplicationInfoConvert { ...@@ -202,7 +203,7 @@ public class AgentApplicationInfoConvert {
for (int i = 0; i < variables.size(); i++) { for (int i = 0; i < variables.size(); i++) {
String key = variables.get(i).getKey(); String key = variables.get(i).getKey();
String variableDefault = variables.get(i).getVariableDefault(); String variableDefault = variables.get(i).getVariableDefault();
result[i] = "key:" + key + "," + "default:" + variableDefault; result[i] = "\"key\":\"" + key + "\"," + "\"default\":\"" + variableDefault + "\"";
} }
entity.setVariableStructure(result); entity.setVariableStructure(result);
} }
......
...@@ -124,11 +124,13 @@ public class BizAgentApplicationPublishConvert { ...@@ -124,11 +124,13 @@ public class BizAgentApplicationPublishConvert {
commConfig.setContinuousQuestionTurn(entity.getContinuousQuestionTurn()); commConfig.setContinuousQuestionTurn(entity.getContinuousQuestionTurn());
List<Variable> variables = new ArrayList<>(); List<Variable> variables = new ArrayList<>();
String[] variableStructure = entity.getVariableStructure(); String[] variableStructure = entity.getVariableStructure();
if(variableStructure != null){
for (int i = 0; i < variableStructure.length; i++) { for (int i = 0; i < variableStructure.length; i++) {
Variable variable = new Variable(); Variable variable = new Variable();
String input = variableStructure[i]; String input = variableStructure[i];
// 定义正则表达式模式 // 定义正则表达式模式
Pattern pattern = Pattern.compile("(key|default):([^,]+)"); String regex = "\"key\":\"(.*?)\",\"default\":\"(.*?)\"";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(input); Matcher matcher = pattern.matcher(input);
if (matcher.find()) { if (matcher.find()) {
variable.setKey(matcher.group(1)); variable.setKey(matcher.group(1));
...@@ -136,6 +138,7 @@ public class BizAgentApplicationPublishConvert { ...@@ -136,6 +138,7 @@ public class BizAgentApplicationPublishConvert {
variables.add(variable); variables.add(variable);
} }
} }
}
commConfig.setVariableStructure(variables); commConfig.setVariableStructure(variables);
commConfig.setIsLongMemory(entity.getIsLongMemory()); commConfig.setIsLongMemory(entity.getIsLongMemory());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment