|
|
@@ -133,5 +133,19 @@ public class JudgeServiceImpl implements JudgeService {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public JudgeResult mysqlAndMQ(Integer questionId, CodeJudgeVO codeJudgeVO) {
|
|
|
+ Commit commit = new Commit();
|
|
|
+ commit.setUserId(0);
|
|
|
+ commit.setProblemId(questionId);
|
|
|
+ commit.setCode(codeJudgeVO.getCode());
|
|
|
+ commit.setLanguage(codeJudgeVO.getLanguage());
|
|
|
+ commit.setCommitTime(new Date());
|
|
|
+ commitDAO.save(commit);
|
|
|
+ CodeJudgeDTO codeJudgeDTO = new CodeJudgeDTO(commit.getId(), questionId, codeJudgeVO);
|
|
|
+ rabbitTemplate.convertAndSend("test_queue", codeJudgeDTO);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|