Skip to content

Commit 1d16ed5

Browse files
committed
style : 컨벤션 적용 안 됨 해결, 탭 문자 제거
1 parent 9e0a8c9 commit 1d16ed5

File tree

74 files changed

+1543
-1524
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1543
-1524
lines changed

src/main/java/org/ezcode/codetest/application/submission/aop/CodeReviewLock.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
@Retention(RetentionPolicy.RUNTIME)
1111
@Documented
1212
public @interface CodeReviewLock {
13-
String prefix();
13+
String prefix();
1414
}

src/main/java/org/ezcode/codetest/application/submission/aop/CodeReviewLockAspect.java

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,38 +20,38 @@
2020
@Order(Ordered.HIGHEST_PRECEDENCE)
2121
public class CodeReviewLockAspect {
2222

23-
private final LockManager lockManager;
24-
25-
@Around("@annotation(org.ezcode.codetest.application.submission.aop.CodeReviewLock)")
26-
public Object lock(ProceedingJoinPoint joinPoint) throws Throwable {
27-
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
28-
String prefix = signature.getMethod().getAnnotation(CodeReviewLock.class).prefix();
29-
Object[] args = joinPoint.getArgs();
30-
31-
Long problemId = null;
32-
Long userId = null;
33-
34-
for (Object arg : args) {
35-
if (arg instanceof Long) {
36-
problemId = (Long) arg;
37-
} else if (arg instanceof AuthUser) {
38-
userId = ((AuthUser)arg).getId();
39-
}
40-
}
41-
42-
if (problemId == null || userId == null) {
43-
throw new CodeReviewException(CodeReviewExceptionCode.REQUIRED_ARGS_NOT_FOUND);
44-
}
45-
46-
boolean locked = lockManager.tryLock(prefix, userId, problemId);
47-
if (!locked) {
48-
throw new CodeReviewException(CodeReviewExceptionCode.ALREADY_REVIEWING);
49-
}
50-
51-
try {
52-
return joinPoint.proceed();
53-
} finally {
54-
lockManager.releaseLock(prefix, userId, problemId);
55-
}
56-
}
23+
private final LockManager lockManager;
24+
25+
@Around("@annotation(org.ezcode.codetest.application.submission.aop.CodeReviewLock)")
26+
public Object lock(ProceedingJoinPoint joinPoint) throws Throwable {
27+
MethodSignature signature = (MethodSignature)joinPoint.getSignature();
28+
String prefix = signature.getMethod().getAnnotation(CodeReviewLock.class).prefix();
29+
Object[] args = joinPoint.getArgs();
30+
31+
Long problemId = null;
32+
Long userId = null;
33+
34+
for (Object arg : args) {
35+
if (arg instanceof Long) {
36+
problemId = (Long)arg;
37+
} else if (arg instanceof AuthUser) {
38+
userId = ((AuthUser)arg).getId();
39+
}
40+
}
41+
42+
if (problemId == null || userId == null) {
43+
throw new CodeReviewException(CodeReviewExceptionCode.REQUIRED_ARGS_NOT_FOUND);
44+
}
45+
46+
boolean locked = lockManager.tryLock(prefix, userId, problemId);
47+
if (!locked) {
48+
throw new CodeReviewException(CodeReviewExceptionCode.ALREADY_REVIEWING);
49+
}
50+
51+
try {
52+
return joinPoint.proceed();
53+
} finally {
54+
lockManager.releaseLock(prefix, userId, problemId);
55+
}
56+
}
5757
}

src/main/java/org/ezcode/codetest/application/submission/dto/request/compile/CodeCompileRequest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
public record CodeCompileRequest(
44

5-
String source_code,
5+
String source_code,
66

7-
Long language_id,
7+
Long language_id,
88

9-
String stdin
9+
String stdin
1010

1111
) {
1212
}

src/main/java/org/ezcode/codetest/application/submission/dto/request/language/LanguageUpdateRequest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
@Schema(description = "언어 업데이트 요청")
77
public record LanguageUpdateRequest(
88

9-
@Schema(description = "Judge0에서 사용하는 언어 ID", example = "62")
10-
@NotNull(message = "Judge0 아이디는 필수 입력 값입니다.")
11-
Long judge0Id
9+
@Schema(description = "Judge0에서 사용하는 언어 ID", example = "62")
10+
@NotNull(message = "Judge0 아이디는 필수 입력 값입니다.")
11+
Long judge0Id
1212

1313
) {
1414
}

src/main/java/org/ezcode/codetest/application/submission/dto/request/review/CodeReviewRequest.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@
77
@Schema(description = "코드 리뷰 요청 DTO")
88
public record CodeReviewRequest(
99

10-
@Schema(description = "언어 ID", example = "62")
11-
@NotNull(message = "언어 번호는 필수 입력 값입니다.")
12-
Long languageId,
10+
@Schema(description = "언어 ID", example = "62")
11+
@NotNull(message = "언어 번호는 필수 입력 값입니다.")
12+
Long languageId,
1313

14-
@Schema(
15-
description = "소스 코드",
16-
example = "public class Main { public static void main(String[] args) { System.out.println(\"Hello\"); } }"
17-
)
18-
@NotBlank(message = "소스 코드는 필수 입력 값입니다.")
19-
String sourceCode,
14+
@Schema(
15+
description = "소스 코드",
16+
example = "public class Main { public static void main(String[] args) { System.out.println(\"Hello\"); } }"
17+
)
18+
@NotBlank(message = "소스 코드는 필수 입력 값입니다.")
19+
String sourceCode,
2020

21-
@Schema(description = "정답 여부", example = "true")
22-
@NotNull(message = "정답 여부는 필수 입력 값입니다.")
23-
Boolean isCorrect
21+
@Schema(description = "정답 여부", example = "true")
22+
@NotNull(message = "정답 여부는 필수 입력 값입니다.")
23+
Boolean isCorrect
2424

2525
) {
2626
}

src/main/java/org/ezcode/codetest/application/submission/dto/request/review/ReviewPayload.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55

66
public record ReviewPayload(
77

8-
String problemDescription,
8+
String problemDescription,
99

10-
String languageName,
10+
String languageName,
1111

12-
String sourceCode,
12+
String sourceCode,
1313

14-
boolean isCorrect
14+
boolean isCorrect
1515

1616
) {
17-
public static ReviewPayload of(Problem problem, Language language, CodeReviewRequest request) {
18-
return new ReviewPayload(
19-
problem.getDescription(),
20-
language.getName(),
21-
request.sourceCode(),
22-
request.isCorrect()
23-
);
24-
}
17+
public static ReviewPayload of(Problem problem, Language language, CodeReviewRequest request) {
18+
return new ReviewPayload(
19+
problem.getDescription(),
20+
language.getName(),
21+
request.sourceCode(),
22+
request.isCorrect()
23+
);
24+
}
2525
}

src/main/java/org/ezcode/codetest/application/submission/dto/request/submission/CodeSubmitRequest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
@Schema(description = "코드 제출 요청 DTO")
88
public record CodeSubmitRequest(
99

10-
@Schema(description = "언어 ID", example = "1")
11-
@NotNull(message = "언어 번호는 필수 입력 값입니다.")
12-
Long languageId,
10+
@Schema(description = "언어 ID", example = "1")
11+
@NotNull(message = "언어 번호는 필수 입력 값입니다.")
12+
Long languageId,
1313

14-
@Schema(
15-
description = "소스 코드",
16-
example = "public class Main { public static void main(String[] args) { System.out.println(\"Hello World\"); } }"
17-
)
18-
@NotBlank(message = "소스 코드는 필수 입력 값입니다.")
19-
String sourceCode
14+
@Schema(
15+
description = "소스 코드",
16+
example = "public class Main { public static void main(String[] args) { System.out.println(\"Hello World\"); } }"
17+
)
18+
@NotBlank(message = "소스 코드는 필수 입력 값입니다.")
19+
String sourceCode
2020

2121
) {
2222
}

src/main/java/org/ezcode/codetest/application/submission/dto/response/compile/ExecutionResultResponse.java

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,38 @@
22

33
public record ExecutionResultResponse(
44

5-
String stdout,
5+
String stdout,
66

7-
Double time,
7+
Double time,
88

9-
Long memory,
9+
Long memory,
1010

11-
String stderr,
11+
String stderr,
1212

13-
String token,
13+
String token,
1414

15-
String compile_output,
15+
String compile_output,
1616

17-
int exit_code,
17+
int exit_code,
1818

19-
ExecutionStatus status
19+
ExecutionStatus status
2020

2121
) {
2222

23-
public long getMemory() {
24-
return this.memory == null ? 0L : memory;
25-
}
23+
public long getMemory() {
24+
return this.memory == null ? 0L : memory;
25+
}
2626

27-
public double getTime() {
28-
return this.time == null ? 0.0 : time;
29-
}
27+
public double getTime() {
28+
return this.time == null ? 0.0 : time;
29+
}
3030

31-
public record ExecutionStatus(
31+
public record ExecutionStatus(
3232

33-
int id,
33+
int id,
3434

35-
String description
35+
String description
3636

37-
) {}
37+
) {
38+
}
3839
}

src/main/java/org/ezcode/codetest/application/submission/dto/response/language/LanguageResponse.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55
import io.swagger.v3.oas.annotations.media.Schema;
66

77
@Schema(description = "언어 응답 정보")
8-
public record LanguageResponse (
8+
public record LanguageResponse(
99

10-
@Schema(description = "언어 ID", example = "1")
11-
Long id,
10+
@Schema(description = "언어 ID", example = "1")
11+
Long id,
1212

13-
@Schema(description = "언어 이름", example = "Java")
14-
String name,
13+
@Schema(description = "언어 이름", example = "Java")
14+
String name,
1515

16-
@Schema(description = "언어 버전", example = "17")
17-
String version,
16+
@Schema(description = "언어 버전", example = "17")
17+
String version,
1818

19-
@Schema(description = "Judge0에서 사용하는 언어 ID", example = "62")
20-
Long judge0Id
19+
@Schema(description = "Judge0에서 사용하는 언어 ID", example = "62")
20+
Long judge0Id
2121

22-
){
23-
public static LanguageResponse from(Language language) {
24-
return new LanguageResponse(
25-
language.getId(), language.getName(), language.getVersion(), language.getJudge0Id()
26-
);
27-
}
22+
) {
23+
public static LanguageResponse from(Language language) {
24+
return new LanguageResponse(
25+
language.getId(), language.getName(), language.getVersion(), language.getJudge0Id()
26+
);
27+
}
2828
}

src/main/java/org/ezcode/codetest/application/submission/dto/response/review/CodeReviewResponse.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
@Schema(description = "코드 리뷰 응답 DTO")
66
public record CodeReviewResponse(
77

8-
@Schema(description = "리뷰 내용", example = "변수명이 명확하지 않습니다. 의미 있는 이름을 사용해주세요.")
9-
String reviewContent
8+
@Schema(description = "리뷰 내용", example = "변수명이 명확하지 않습니다. 의미 있는 이름을 사용해주세요.")
9+
String reviewContent
1010

1111
) {
1212
}

0 commit comments

Comments
 (0)