|
|
@ -40,7 +40,7 @@ public class CallbackController {
|
|
|
|
public String evaluation(@RequestParam Map<String, Object> params) {
|
|
|
|
public String evaluation(@RequestParam Map<String, Object> params) {
|
|
|
|
log.info("回调请求参数:{}", params);
|
|
|
|
log.info("回调请求参数:{}", params);
|
|
|
|
|
|
|
|
|
|
|
|
if (params == null) {
|
|
|
|
if (params == null || params.get("jsonTestDetails") == null) {
|
|
|
|
return RESULT;
|
|
|
|
return RESULT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -53,10 +53,8 @@ public class CallbackController {
|
|
|
|
|
|
|
|
|
|
|
|
long incr;
|
|
|
|
long incr;
|
|
|
|
String incrKey = String.format("evaluationResult:%s", tpiID);
|
|
|
|
String incrKey = String.format("evaluationResult:%s", tpiID);
|
|
|
|
boolean flag = (incr = redisUtil.increment(incrKey)) > 3;
|
|
|
|
if (matchOutPut(decodeOutPut) && (incr = redisUtil.increment(incrKey)) > 3) {
|
|
|
|
log.info("evaluationResult, tpiID:{},第{}次评测失败", tpiID, incr);
|
|
|
|
log.info("evaluationResult, tpiID:{},第{}次评测失败,需要发送钉钉通知", tpiID, incr);
|
|
|
|
if (matchOutPut(decodeOutPut) && flag) {
|
|
|
|
|
|
|
|
log.info("tpiID:{},需要发送钉钉通知", tpiID);
|
|
|
|
|
|
|
|
// 钉钉通知
|
|
|
|
// 钉钉通知
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
sb.append("【自动化评测】tpiID:").append(tpiID).append(" 错误:消息").append(decodeOutPut);
|
|
|
|
sb.append("【自动化评测】tpiID:").append(tpiID).append(" 错误:消息").append(decodeOutPut);
|
|
|
@ -65,7 +63,9 @@ public class CallbackController {
|
|
|
|
|
|
|
|
|
|
|
|
// 通知之后清空
|
|
|
|
// 通知之后清空
|
|
|
|
redisUtil.remove(incrKey);
|
|
|
|
redisUtil.remove(incrKey);
|
|
|
|
|
|
|
|
return RESULT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
log.info("tpiID:{},评测通过", tpiID);
|
|
|
|
|
|
|
|
|
|
|
|
return RESULT;
|
|
|
|
return RESULT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|