|
|
@@ -7,6 +7,7 @@ import cn.seecoder.ojserver.dao.TestCaseDAO;
|
|
|
import cn.seecoder.ojserver.exception.ThirdPartyServiceException;
|
|
|
import cn.seecoder.ojserver.model.vo.CompleteQuestionVO;
|
|
|
import cn.seecoder.ojserver.utils.thirdparty.QuestionThirdPartyService;
|
|
|
+import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.List;
|
|
|
@@ -25,11 +26,16 @@ public class QuestionManager {
|
|
|
this.testCaseDAO = testCaseDAO;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Cacheable(value = "problem")
|
|
|
public Optional<Problem> getProblemById(Integer id){
|
|
|
+ System.out.println("getProblemById:"+id);
|
|
|
return problemDAO.findById(id);
|
|
|
}
|
|
|
|
|
|
+ @Cacheable(value = "testCaseByProblemId")
|
|
|
public List<TestCase> getTestCaseByProblemId(Integer problemId){
|
|
|
+ System.out.println("getTestCaseByProblemId:"+problemId);
|
|
|
return testCaseDAO.findByProblem_Id(problemId);
|
|
|
}
|
|
|
}
|