|
|
@@ -33,6 +33,7 @@ public class RabbitMQConsumer {
|
|
|
@RabbitListener(queuesToDeclare = @Queue("notice_queue"),concurrency = "20")
|
|
|
public void process(CodeJudgeDTO codeJudgeDTO) {
|
|
|
JudgeResult judgeResult = judgeService.judgeCode(codeJudgeDTO.getProblemId(), codeJudgeDTO.getCodeJudgeVO());
|
|
|
+ System.out.println(judgeResult);
|
|
|
CodeJudgeResultType message = CodeJudgeResultType.values()[JudgeResultType.ACCEPT.ordinal()];
|
|
|
for (JudgeResult.Item item : judgeResult.getResultList()) {
|
|
|
if (item.getResult() != JudgeResultType.ACCEPT) {
|
|
|
@@ -41,15 +42,16 @@ public class RabbitMQConsumer {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- int acNum = 0;
|
|
|
+ double acNum = 0;
|
|
|
for (JudgeResult.Item item : judgeResult.getResultList()) {
|
|
|
if (item.getResult() == JudgeResultType.ACCEPT) {
|
|
|
acNum++;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- int score = (acNum / judgeResult.getResultList().size())*100;
|
|
|
|
|
|
+ int score = (int)((acNum / judgeResult.getResultList().size())*100);
|
|
|
+
|
|
|
Optional<Commit> optionalCommit = commitDAO.findById(codeJudgeDTO.getCommitId());
|
|
|
if(optionalCommit.isPresent()){
|
|
|
Commit commit = optionalCommit.get();
|