|
@@ -0,0 +1,28 @@
|
|
|
+package com.example.onlinejudge.judge.codesandbox.impl;
|
|
|
+
|
|
|
+import com.example.onlinejudge.judge.codesandbox.CodeSandbox;
|
|
|
+import com.example.onlinejudge.judge.codesandbox.model.ExecuteCodeRequest;
|
|
|
+import com.example.onlinejudge.judge.codesandbox.model.ExecuteCodeResponse;
|
|
|
+import com.example.onlinejudge.judge.codesandbox.model.JudgeInfo;
|
|
|
+import com.example.onlinejudge.model.enums.JudgeInfoMessageEnum;
|
|
|
+import com.example.onlinejudge.model.enums.QuestionSubmitStatusEnum;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+public class ExampleCodeSandbox implements CodeSandbox {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ExecuteCodeResponse executeCode(ExecuteCodeRequest executeCodeRequest) {
|
|
|
+ List<String> inputList = executeCodeRequest.getInputList();
|
|
|
+ ExecuteCodeResponse executeCodeResponse = new ExecuteCodeResponse();
|
|
|
+ executeCodeResponse.setOutputList(inputList);
|
|
|
+ executeCodeResponse.setMessage("测试执行成功");
|
|
|
+ executeCodeResponse.setStatus(QuestionSubmitStatusEnum.SUCCEED.getValue());
|
|
|
+ JudgeInfo judgeInfo = new JudgeInfo();
|
|
|
+ judgeInfo.setMessage(JudgeInfoMessageEnum.ACCEPTED.getText());
|
|
|
+ judgeInfo.setMemory(100L);
|
|
|
+ judgeInfo.setTime(100L);
|
|
|
+ executeCodeResponse.setJudgeInfo(judgeInfo);
|
|
|
+ return executeCodeResponse;
|
|
|
+ }
|
|
|
+}
|