提交 fca08723 编写于 作者: minghao.wu's avatar minghao.wu

feature: hint按照逗号拆分

上级 a051b68d
流水线 #2182 已通过 于阶段
in 23 second
...@@ -212,7 +212,7 @@ public class AntiSpamServiceImpl implements AntiSpamService { ...@@ -212,7 +212,7 @@ public class AntiSpamServiceImpl implements AntiSpamService {
* 保留第一个label 记录所有的提示信息 * 保留第一个label 记录所有的提示信息
*/ */
int resLabel = 0; int resLabel = 0;
List<String> hint = new ArrayList<>(); List<String> hintList = new ArrayList<>();
for (JsonElement labelElement : labelArray) { for (JsonElement labelElement : labelArray) {
JsonObject lObject = labelElement.getAsJsonObject(); JsonObject lObject = labelElement.getAsJsonObject();
int label = lObject.get("label").getAsInt(); int label = lObject.get("label").getAsInt();
...@@ -226,7 +226,7 @@ public class AntiSpamServiceImpl implements AntiSpamService { ...@@ -226,7 +226,7 @@ public class AntiSpamServiceImpl implements AntiSpamService {
for (JsonElement eleHint : hintArray) { for (JsonElement eleHint : hintArray) {
String[] hints = eleHint.getAsString().split(","); String[] hints = eleHint.getAsString().split(",");
for (String ht : hints) { for (String ht : hints) {
hint.add(ht.trim()); hintList.add(ht.trim());
} }
} }
} }
...@@ -234,9 +234,9 @@ public class AntiSpamServiceImpl implements AntiSpamService { ...@@ -234,9 +234,9 @@ public class AntiSpamServiceImpl implements AntiSpamService {
/** /**
* 保存记录 * 保存记录
*/ */
insertRecord(userId, sysCode, content, response, (byte)action, resLabel, hint.toString()); insertRecord(userId, sysCode, content, response, (byte)action, resLabel, hintList.toString());
return ReturnUtil.getPicaResponse(PicaResultCode.DATA_IS_WRONG.code(), msg, hint.toString()); return ReturnUtil.getPicaResponse(PicaResultCode.DATA_IS_WRONG.code(), msg, hintList);
} }
} else { } else {
return ReturnUtil.getPicaResponse(jObject.get("code").getAsString(), msg, ""); return ReturnUtil.getPicaResponse(jObject.get("code").getAsString(), msg, "");
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册