1818import io .f1 .backend .domain .quiz .entity .Quiz ;
1919import io .f1 .backend .domain .user .dao .UserRepository ;
2020import io .f1 .backend .domain .user .entity .User ;
21-
2221import io .micrometer .common .util .StringUtils ;
23- import java .util .NoSuchElementException ;
24- import lombok .RequiredArgsConstructor ;
2522
23+ import lombok .RequiredArgsConstructor ;
2624import lombok .extern .slf4j .Slf4j ;
25+
2726import org .springframework .beans .factory .annotation .Value ;
2827import org .springframework .data .domain .Page ;
2928import org .springframework .data .domain .Pageable ;
@@ -115,7 +114,7 @@ public void deleteQuiz(Long quizId) {
115114 .orElseThrow (() -> new NoSuchElementException ("존재하지 않는 퀴즈입니다." ));
116115
117116 // TODO : util 메서드에서 사용자 ID 꺼내쓰는 식으로 수정하기
118- if (1L != quiz .getCreator ().getId ()) {
117+ if (1L != quiz .getCreator ().getId ()) {
119118 throw new RuntimeException ("권한이 없습니다." );
120119 }
121120
@@ -161,7 +160,7 @@ private void deleteOldThumbnailFileIfNeeded(String oldFilename) {
161160
162161 try {
163162 boolean deleted = deleteIfExists (filePath );
164- if ( deleted ) {
163+ if ( deleted ) {
165164 log .info ("기존 썸네일 삭제 완료 : {}" , filePath );
166165 } else {
167166 log .info ("기존 썸네일 존재 X : {}" , filePath );
@@ -178,9 +177,9 @@ public QuizListPageResponse getQuizzes(String title, String creator, Pageable pa
178177 Page <Quiz > quizzes ;
179178
180179 // 검색어가 있을 때
181- if (StringUtils .isBlank (title )) {
180+ if (StringUtils .isBlank (title )) {
182181 quizzes = quizRepository .findQuizzesByTitleContaining (title , pageable );
183- } else if (StringUtils .isBlank (creator )) {
182+ } else if (StringUtils .isBlank (creator )) {
184183 quizzes = quizRepository .findQuizzesByCreator_NicknameContaining (creator , pageable );
185184 } else { // 검색어가 없을 때 혹은 빈 문자열일 때
186185 quizzes = quizRepository .findAll (pageable );
0 commit comments