-
Notifications
You must be signed in to change notification settings - Fork 165
Expand file tree
/
Copy pathVoucherManagementSystemApplication.java
More file actions
40 lines (31 loc) · 1.22 KB
/
VoucherManagementSystemApplication.java
File metadata and controls
40 lines (31 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package team.marco.voucher_management_system;
import java.util.function.Consumer;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.context.annotation.ComponentScan;
import team.marco.voucher_management_system.type_enum.ApplicationType;
import team.marco.voucher_management_system.util.Console;
@ComponentScan
@ConfigurationPropertiesScan
public class VoucherManagementSystemApplication {
public static void main(String[] args) {
Console.print("""
=== 실행할 애플리케이션을 선택해주세요. ===
0. Console Application
1. Web Application""");
selectApplication(args);
Console.close();
}
private static void selectApplication(String[] args) {
Consumer<String[]> mainMethod = getMainMethod();
mainMethod.accept(args);
}
private static Consumer<String[]> getMainMethod() {
try {
int input = Console.readInt();
return ApplicationType.getMainMethod(input);
} catch (IllegalArgumentException e) {
Console.print("사용할 수 없는 애플리케이션 입니다.");
return getMainMethod();
}
}
}