Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ public class SubmissionService {
private final GitHubPushService gitHubPushService;

public SubmitResponse prepareSubmission(Long problemId, AuthUser authUser) {

if (authUser == null) {
throw new SubmissionException(SubmissionExceptionCode.AUTH_REQUIRED);
}

boolean acquired = lockManager.tryLock("submission", authUser.getId(), problemId);
if (!acquired) {
throw new SubmissionException(SubmissionExceptionCode.ALREADY_JUDGING);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class SecurityPath {
"/actuator/**",
"/chatting",
"/submit-test/**",
"/problems/**",
"/api/problems/**",
"/ws/**",
"/swagger-ui/**",
"/swagger-resources/**",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public enum SubmissionExceptionCode implements ResponseCode {
TESTCASE_TIMEOUT(false, HttpStatus.GATEWAY_TIMEOUT, "테스트케이스 채점 시간이 초과되었습니다."),
REDIS_SERVER_ERROR(false, HttpStatus.INTERNAL_SERVER_ERROR, "Redis 서버 연결 실패"),
ALREADY_JUDGING(false, HttpStatus.CONFLICT, "이미 해당 문제에 대한 채점이 진행 중입니다."),
AUTH_REQUIRED(false, HttpStatus.UNAUTHORIZED, "로그인 후 이용해주세요."),
UNKNOWN_ERROR(false, HttpStatus.INTERNAL_SERVER_ERROR, "알 수 없는 예외가 발생했습니다."),
;
private final boolean success;
Expand Down