Skip to content

Commit da95d0c

Browse files
author
github-actions
committed
chore: Java 스타일 수정
1 parent 5af3bb7 commit da95d0c

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

backend/src/main/java/io/f1/backend/domain/question/app/QuestionService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@
1212
import io.f1.backend.global.exception.CustomException;
1313
import io.f1.backend.global.exception.errorcode.AuthErrorCode;
1414
import io.f1.backend.global.exception.errorcode.QuestionErrorCode;
15-
1615
import io.f1.backend.global.security.enums.Role;
1716
import io.f1.backend.global.util.SecurityUtils;
18-
import java.util.Objects;
17+
1918
import lombok.RequiredArgsConstructor;
2019

2120
import org.springframework.stereotype.Service;
2221
import org.springframework.transaction.annotation.Transactional;
2322

23+
import java.util.Objects;
24+
2425
@Service
2526
@RequiredArgsConstructor
2627
public class QuestionService {
@@ -51,15 +52,14 @@ public void updateQuestionContent(Long questionId, String content) {
5152
.orElseThrow(
5253
() -> new CustomException(QuestionErrorCode.QUESTION_NOT_FOUND));
5354

54-
5555
verifyUserAuthority(question.getQuiz());
5656

5757
TextQuestion textQuestion = question.getTextQuestion();
5858
textQuestion.changeContent(content);
5959
}
6060

6161
private static void verifyUserAuthority(Quiz quiz) {
62-
if(SecurityUtils.getCurrentUserRole() == Role.USER) {
62+
if (SecurityUtils.getCurrentUserRole() == Role.USER) {
6363
validateOwner(quiz.getCreator().getId());
6464
}
6565
}

backend/src/main/java/io/f1/backend/domain/quiz/app/QuizService.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919
import io.f1.backend.global.exception.CustomException;
2020
import io.f1.backend.global.exception.errorcode.AuthErrorCode;
2121
import io.f1.backend.global.exception.errorcode.QuizErrorCode;
22-
2322
import io.f1.backend.global.exception.errorcode.UserErrorCode;
2423
import io.f1.backend.global.security.enums.Role;
2524
import io.f1.backend.global.util.SecurityUtils;
26-
import java.util.Objects;
25+
2726
import lombok.RequiredArgsConstructor;
2827
import lombok.extern.slf4j.Slf4j;
2928

@@ -40,6 +39,7 @@
4039
import java.nio.file.Paths;
4140
import java.util.List;
4241
import java.util.NoSuchElementException;
42+
import java.util.Objects;
4343
import java.util.UUID;
4444

4545
@Slf4j
@@ -70,8 +70,10 @@ public QuizCreateResponse saveQuiz(MultipartFile thumbnailFile, QuizCreateReques
7070
}
7171

7272
Long creatorId = SecurityUtils.getCurrentUserId();
73-
User creator = userRepository.findById(creatorId)
74-
.orElseThrow(() -> new CustomException(UserErrorCode.USER_NOT_FOUND));
73+
User creator =
74+
userRepository
75+
.findById(creatorId)
76+
.orElseThrow(() -> new CustomException(UserErrorCode.USER_NOT_FOUND));
7577

7678
Quiz quiz = quizCreateRequestToQuiz(request, thumbnailPath, creator);
7779

@@ -136,7 +138,7 @@ public void deleteQuiz(Long quizId) {
136138
}
137139

138140
private static void verifyUserAuthority(Quiz quiz) {
139-
if(SecurityUtils.getCurrentUserRole() == Role.USER) {
141+
if (SecurityUtils.getCurrentUserRole() == Role.USER) {
140142
validateOwner(quiz.getCreator().getId());
141143
}
142144
}

backend/src/main/java/io/f1/backend/domain/quiz/mapper/QuizMapper.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ public static Quiz quizCreateRequestToQuiz(
2626
quizCreateRequest.getDescription(),
2727
quizCreateRequest.getQuizType(),
2828
imgUrl,
29-
creator
30-
);
29+
creator);
3130
}
3231

3332
public static QuizCreateResponse quizToQuizCreateResponse(Quiz quiz) {

backend/src/main/java/io/f1/backend/global/util/SecurityUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import io.f1.backend.domain.user.entity.User;
66
import io.f1.backend.global.exception.CustomException;
77
import io.f1.backend.global.exception.errorcode.AuthErrorCode;
8-
98
import io.f1.backend.global.security.enums.Role;
9+
1010
import jakarta.servlet.http.HttpSession;
1111

1212
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;

0 commit comments

Comments
 (0)