|
@@ -30,7 +30,7 @@ public class OnlineJudgeController {
|
|
|
@RequestMapping(value = "run", method = RequestMethod.POST)
|
|
|
public String run(@RequestBody OnlineJudgeVO onlineJudgeVO, HttpServletRequest request) {
|
|
|
log.info("输入参数:{}", onlineJudgeVO.toString());
|
|
|
- String host = request.getHeader("Host");
|
|
|
+ String host = "http://"+request.getHeader("Host");
|
|
|
if(onlineJudgeVO.getExamId()!=null&&onlineJudgeVO.getCaseId()!=null){
|
|
|
log.info("need data when running");
|
|
|
onlineJudgeVO.setMode(OnlineJudgeMode.RUN);
|
|
@@ -45,7 +45,7 @@ public class OnlineJudgeController {
|
|
|
@RequestMapping(value = "custom/run")
|
|
|
public String customRun(@RequestBody OnlineJudgeVO onlineJudgeVO, HttpServletRequest request ) {
|
|
|
log.info("输入参数:{}", onlineJudgeVO.toString());
|
|
|
- String host = request.getHeader("Host");
|
|
|
+ String host = "http://"+request.getHeader("Host");
|
|
|
onlineJudgeVO.setMode(OnlineJudgeMode.CUSTOMRUN);
|
|
|
return onlineJudgeLogic.postAnOnlineJudgeSubmission(onlineJudgeVO, host);
|
|
|
}
|
|
@@ -66,7 +66,7 @@ public class OnlineJudgeController {
|
|
|
|
|
|
@RequestMapping(value = "u/submit", method = RequestMethod.POST)
|
|
|
public String submit(@RequestBody OnlineJudgeVO onlineJudgeVO, HttpServletRequest request) {
|
|
|
- String host = request.getHeader("Host");
|
|
|
+ String host = "http://"+request.getHeader("Host");
|
|
|
Long userId = (Long)SecurityUtils.getSubject().getSession().getAttribute("userId");
|
|
|
if(userId == null) throw new HttpBadRequestException("请登录后操作~");
|
|
|
log.info("user:{}",userId);
|
|
@@ -86,7 +86,7 @@ public class OnlineJudgeController {
|
|
|
//@RequiresRoles(value = {"manager","admin"})
|
|
|
@RequestMapping(value = "u/execute",method = RequestMethod.POST)
|
|
|
public String runWithInput(@RequestBody OnlineJudgeVO onlineJudgeVO, HttpServletRequest request) {
|
|
|
- String host = request.getHeader("Host");
|
|
|
+ String host = "http://"+request.getHeader("Host");
|
|
|
userIdMustNotNull(onlineJudgeVO);
|
|
|
onlineJudgeVO.setMode(OnlineJudgeMode.RUN_WITH_INPUT);
|
|
|
|
|
@@ -97,7 +97,7 @@ public class OnlineJudgeController {
|
|
|
|
|
|
@RequestMapping(value = "u/pexecute",method = RequestMethod.POST)
|
|
|
public String runWithManyInput(@RequestBody OnlineJudgeVO onlineJudgeVO, HttpServletRequest request) {
|
|
|
- String host = request.getHeader("Host");
|
|
|
+ String host = "http://"+request.getHeader("Host");
|
|
|
userIdMustNotNull(onlineJudgeVO);
|
|
|
onlineJudgeVO.setMode(OnlineJudgeMode.RUN_WITH_MANY_INPUT);
|
|
|
|