-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from giwoong01/feature/refactor
code refactor
- Loading branch information
Showing
15 changed files
with
115 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...g/admin/api/request/NoticeSaveReqDto.java → ...min/api/dto/request/NoticeSaveReqDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/com/itcontest/skhuming/admin/application/AdminService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/com/itcontest/skhuming/main/application/MainService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/main/java/com/itcontest/skhuming/member/exception/NotFoundDepartmentException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.itcontest.skhuming.member.exception; | ||
|
||
public class NotFoundDepartmentException extends RuntimeException { | ||
public NotFoundDepartmentException(String message) { | ||
super(message); | ||
} | ||
|
||
public NotFoundDepartmentException() { | ||
this("해당 ID의 랭킹이 존재하지 않습니다."); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/com/itcontest/skhuming/member/util/ChangeDepartment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.itcontest.skhuming.member.util; | ||
|
||
import com.itcontest.skhuming.member.exception.NotFoundDepartmentException; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class ChangeDepartment { | ||
public static String departmentNumber(int departmentNumber) { | ||
validateDepartmentNumber(departmentNumber); | ||
return switch (departmentNumber) { | ||
case 1 -> "인문융합자율학부"; | ||
case 2 -> "사회융합자율학부"; | ||
case 3 -> "미디어콘텐츠융합자율학부"; | ||
case 4 -> "IT융합자율학부"; | ||
default -> null; | ||
}; | ||
} | ||
|
||
private static void validateDepartmentNumber(int departmentNumber) { | ||
if (departmentNumber >= 5) { | ||
throw new NotFoundDepartmentException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/com/itcontest/skhuming/ranking/application/RankingService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters