Skip to content

Commit 12cfc7b

Browse files
author
github-actions
committed
chore: Java 스타일 수정
1 parent 43ac5e2 commit 12cfc7b

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

backend/src/main/java/io/f1/backend/domain/game/app/GameService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
import io.f1.backend.domain.game.store.RoomRepository;
1111
import io.f1.backend.domain.quiz.app.QuizService;
1212
import io.f1.backend.domain.quiz.entity.Quiz;
13-
1413
import io.f1.backend.global.exception.CustomException;
1514
import io.f1.backend.global.exception.errorcode.GameErrorCode;
1615
import io.f1.backend.global.exception.errorcode.RoomErrorCode;
16+
1717
import lombok.RequiredArgsConstructor;
1818

1919
import org.springframework.context.ApplicationEventPublisher;
@@ -32,9 +32,9 @@ public class GameService {
3232
public GameStartData gameStart(Long roomId, Long quizId) {
3333

3434
Room room =
35-
roomRepository
36-
.findRoom(roomId)
37-
.orElseThrow(() -> new CustomException(RoomErrorCode.ROOM_NOT_FOUND));
35+
roomRepository
36+
.findRoom(roomId)
37+
.orElseThrow(() -> new CustomException(RoomErrorCode.ROOM_NOT_FOUND));
3838

3939
if (!validateReadyStatus(room)) {
4040
throw new CustomException(RoomErrorCode.PLAYER_NOT_READY);

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@
99
import io.f1.backend.domain.question.entity.Question;
1010
import io.f1.backend.domain.question.entity.TextQuestion;
1111
import io.f1.backend.domain.quiz.entity.Quiz;
12-
1312
import io.f1.backend.global.exception.CustomException;
1413
import io.f1.backend.global.exception.errorcode.QuestionErrorCode;
14+
1515
import lombok.RequiredArgsConstructor;
1616

1717
import org.springframework.stereotype.Service;
1818
import org.springframework.transaction.annotation.Transactional;
1919

20-
import java.util.NoSuchElementException;
21-
2220
@Service
2321
@RequiredArgsConstructor
2422
public class QuestionService {
@@ -46,7 +44,8 @@ public void updateQuestionContent(Long questionId, String content) {
4644
Question question =
4745
questionRepository
4846
.findById(questionId)
49-
.orElseThrow(() -> new CustomException(QuestionErrorCode.QUESTION_NOT_FOUND));
47+
.orElseThrow(
48+
() -> new CustomException(QuestionErrorCode.QUESTION_NOT_FOUND));
5049

5150
TextQuestion textQuestion = question.getTextQuestion();
5251
textQuestion.changeContent(content);
@@ -60,7 +59,8 @@ public void updateQuestionAnswer(Long questionId, String answer) {
6059
Question question =
6160
questionRepository
6261
.findById(questionId)
63-
.orElseThrow(() -> new CustomException(QuestionErrorCode.QUESTION_NOT_FOUND));
62+
.orElseThrow(
63+
() -> new CustomException(QuestionErrorCode.QUESTION_NOT_FOUND));
6464

6565
question.changeAnswer(answer);
6666
}
@@ -71,7 +71,8 @@ public void deleteQuestion(Long questionId) {
7171
Question question =
7272
questionRepository
7373
.findById(questionId)
74-
.orElseThrow(() -> new CustomException(QuestionErrorCode.QUESTION_NOT_FOUND));
74+
.orElseThrow(
75+
() -> new CustomException(QuestionErrorCode.QUESTION_NOT_FOUND));
7576

7677
questionRepository.delete(question);
7778
}

backend/src/main/java/io/f1/backend/domain/quiz/api/QuizController.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
import org.springframework.web.bind.annotation.RestController;
2929
import org.springframework.web.multipart.MultipartFile;
3030

31-
import java.io.IOException;
32-
3331
@RestController
3432
@RequestMapping("/quizzes")
3533
@RequiredArgsConstructor

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
import io.f1.backend.domain.quiz.entity.Quiz;
1818
import io.f1.backend.domain.user.dao.UserRepository;
1919
import io.f1.backend.domain.user.entity.User;
20-
2120
import io.f1.backend.global.exception.CustomException;
2221
import io.f1.backend.global.exception.errorcode.AuthErrorCode;
2322
import io.f1.backend.global.exception.errorcode.QuizErrorCode;
23+
2424
import lombok.RequiredArgsConstructor;
2525
import lombok.extern.slf4j.Slf4j;
2626

@@ -93,12 +93,12 @@ private void validateImageFile(MultipartFile thumbnailFile) {
9393
throw new CustomException(QuizErrorCode.UNSUPPORTED_IMAGE_FORMAT);
9494
}
9595

96-
if(thumbnailFile.getSize() > MAX_FILE_SIZE) {
96+
if (thumbnailFile.getSize() > MAX_FILE_SIZE) {
9797
throw new CustomException(QuizErrorCode.FILE_SIZE_TOO_LARGE);
9898
}
9999
}
100100

101-
private String convertToThumbnailPath(MultipartFile thumbnailFile){
101+
private String convertToThumbnailPath(MultipartFile thumbnailFile) {
102102
String originalFilename = thumbnailFile.getOriginalFilename();
103103
String ext = getExtension(originalFilename);
104104
String savedFilename = UUID.randomUUID().toString() + "." + ext;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static QuizCreateResponse quizToQuizCreateResponse(Quiz quiz) {
4545

4646
private static Long getUserIdIfExists(Quiz quiz) {
4747
Long userId = null;
48-
if(quiz.getCreator()!=null){
48+
if (quiz.getCreator() != null) {
4949
userId = quiz.getCreator().getId();
5050
}
5151

@@ -54,7 +54,7 @@ private static Long getUserIdIfExists(Quiz quiz) {
5454

5555
private static String getUserNicknameIfExists(Quiz quiz) {
5656
String nickname = null;
57-
if(quiz.getCreator()!=null){
57+
if (quiz.getCreator() != null) {
5858
nickname = quiz.getCreator().getNickname();
5959
}
6060

backend/src/main/java/io/f1/backend/global/exception/errorcode/GameErrorCode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
import lombok.Getter;
44
import lombok.RequiredArgsConstructor;
5+
56
import org.springframework.http.HttpStatus;
67

78
@Getter
89
@RequiredArgsConstructor
910
public enum GameErrorCode implements ErrorCode {
10-
1111
GAME_SETTING_CONFLICT("E409002", HttpStatus.CONFLICT, "게임 설정이 맞지 않습니다.");
1212

1313
private final String code;

backend/src/main/java/io/f1/backend/global/exception/errorcode/QuizErrorCode.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ public enum QuizErrorCode implements ErrorCode {
1111
FILE_SIZE_TOO_LARGE("E400005", HttpStatus.BAD_REQUEST, "파일 크기가 너무 큽니다."),
1212
INVALID_TITLE_LENGTH("E400009", HttpStatus.BAD_REQUEST, "제목은 2자 이상 30자 이하로 입력해주세요."),
1313
INVALID_DESC_LENGTH("E400010", HttpStatus.BAD_REQUEST, "설명은 10자 이상 50자 이하로 입력해주세요."),
14-
UNSUPPORTED_IMAGE_FORMAT("E400013", HttpStatus.BAD_REQUEST, "지원하지 않는 이미지 형식입니다. (jpg, jpeg, png, webp 만 가능)"),
14+
UNSUPPORTED_IMAGE_FORMAT(
15+
"E400013", HttpStatus.BAD_REQUEST, "지원하지 않는 이미지 형식입니다. (jpg, jpeg, png, webp 만 가능)"),
1516
UNSUPPORTED_MEDIA_TYPE("E415001", HttpStatus.UNSUPPORTED_MEDIA_TYPE, "지원하지 않는 파일 형식입니다."),
1617
INVALID_FILTER("E400007", HttpStatus.BAD_REQUEST, "title 또는 creator 중 하나만 입력 가능합니다."),
1718
QUIZ_NOT_FOUND("E404002", HttpStatus.NOT_FOUND, "존재하지 않는 퀴즈입니다."),

0 commit comments

Comments
 (0)