|
|
|
@@ -34,6 +34,12 @@ public class MovieChatTemplate implements BaseTemplate{ |
|
|
|
|
|
|
|
@Override |
|
|
|
public JSONObject handle(String devId, String content) { |
|
|
|
// 判断content如果小于5五个字,返回msg:对不起,能否再描述清除一些。 |
|
|
|
if(content.length() < 5){ |
|
|
|
JSONObject resultJson = new JSONObject(); |
|
|
|
resultJson.put("msg","对不起,能否再描述清除一些。"); |
|
|
|
return resultJson; |
|
|
|
} |
|
|
|
Long operatorId = TerminalSecurityContextHolder.getOperatorId(); |
|
|
|
String redisKey = "group:nlp:" + SecurityContextHolder.getLocalMap().get("enterprise_id") + ":" + operatorId; |
|
|
|
// 根据content内容调用模版并返回结果 |
|
|
|
@@ -61,7 +67,10 @@ public class MovieChatTemplate implements BaseTemplate{ |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(!StringUtils.isEmpty(result)){ |
|
|
|
redisTemplate.opsForList().rightPush(redisKey,content); |
|
|
|
redisTemplate.opsForList().rightPush(redisKey,result); |
|
|
|
} |
|
|
|
|
|
|
|
JSONObject resultJson = new JSONObject(); |
|
|
|
resultJson.put("msg",result); |
|
|
|
|