add submit code max length 65535
This commit is contained in:
parent
66d6eabb5b
commit
1ace6d3ae0
|
@ -107,6 +107,14 @@ public class JudgeController {
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public CommonResult submitProblemJudge(@RequestBody ToJudgeDto judgeDto, HttpServletRequest request) {
|
public CommonResult submitProblemJudge(@RequestBody ToJudgeDto judgeDto, HttpServletRequest request) {
|
||||||
|
|
||||||
|
if (judgeDto.getCode().length() < 50 && !judgeDto.getLanguage().contains("Py")) {
|
||||||
|
return CommonResult.errorResponse("提交的代码是无效的,代码字符长度请不要低于50!", CommonResult.STATUS_FORBIDDEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (judgeDto.getCode().length() > 65535) {
|
||||||
|
return CommonResult.errorResponse("提交的代码是无效的,代码字符长度请不要超过65535!", CommonResult.STATUS_FORBIDDEN);
|
||||||
|
}
|
||||||
|
|
||||||
// 需要获取一下该token对应用户的数据
|
// 需要获取一下该token对应用户的数据
|
||||||
HttpSession session = request.getSession();
|
HttpSession session = request.getSession();
|
||||||
UserRolesVo userRolesVo = (UserRolesVo) session.getAttribute("userInfo");
|
UserRolesVo userRolesVo = (UserRolesVo) session.getAttribute("userInfo");
|
||||||
|
@ -131,10 +139,6 @@ public class JudgeController {
|
||||||
redisUtils.expire(lockKey, 3);
|
redisUtils.expire(lockKey, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (judgeDto.getCode().length() < 50 && !judgeDto.getLanguage().contains("Py")) {
|
|
||||||
return CommonResult.errorResponse("提交的代码是无效的,代码长度请不要低于50!", CommonResult.STATUS_FORBIDDEN);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 将提交先写入数据库,准备调用判题服务器
|
// 将提交先写入数据库,准备调用判题服务器
|
||||||
Judge judge = new Judge();
|
Judge judge = new Judge();
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue