-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSmartStoreApp.java
More file actions
87 lines (70 loc) · 2.92 KB
/
SmartStoreApp.java
File metadata and controls
87 lines (70 loc) · 2.92 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package me.smartstore;
import me.smartstore.customer.Customer;
import me.smartstore.customer.Customers;
import me.smartstore.group.Group;
import me.smartstore.group.GroupType;
import me.smartstore.group.Groups;
import me.smartstore.group.Parameter;
import me.smartstore.menu.MainMenu;
public class SmartStoreApp {
private final Groups allGroups = Groups.getInstance();
private final Customers allCustomers = Customers.getInstance();
private final MainMenu mainMenu = MainMenu.getInstance();
private static SmartStoreApp smartStoreApp;
// singletone pattern
public static SmartStoreApp getInstance() {
if (smartStoreApp==null) {
smartStoreApp = new SmartStoreApp();
}
return smartStoreApp;
}
private SmartStoreApp() {
}
public void details() {
System.out.println("\n\n===========================================");
System.out.println(" Title : SmartStore Customer Classification");
System.out.println(" Release Date : 23.05.00");
System.out.println(" Copyright 2023 JeonghoSong All rights reserved.");
System.out.println("===========================================\n");
}
public SmartStoreApp test() {
allGroups.add(new Group(new Parameter(0, 0), GroupType.NONE));
allGroups.add(new Group(new Parameter(10, 100000), GroupType.GENERAL));
allGroups.add(new Group(new Parameter(20, 200000), GroupType.VIP));
allGroups.add(new Group(new Parameter(30, 300000), GroupType.VVIP));
for (int i=0; i<26; i++) {
int spentTime = ((int) (Math.random() * 5) + 1) * 10;
int totalPay = ((int) (Math.random() * 5) + 1) * 100000;
// Group customerGroup = allGroups.getGroupByParameter(spentTime, totalPay);
// allCustomers.add(new Customer(
// Character.toString(
// (char) ('a' + i)),
// (char) ('a' + i) + "123",
// ((int) (Math.random() * 5) + 1) * 10,
// ((int) (Math.random() * 5) + 1) * 100000));
// allCustomers.add(new Customer(
// Character.toString(
// (char) ('a' + i) + "123",
// spentTime,
// totalPay,
// customerGroup
// )
// ));
// // 마지막 사용하던 코드
// allCustomers.add(new Customer(
// Character.toString(
// (char) ('a' + i)),
// (char) ('a' + i) + "123",
// spentTime,
// totalPay,
// customerGroup));
}
System.out.println("allCustomers = " + allCustomers);
System.out.println("allGroups = " + allGroups);
return this;
}
public void run() {
details();
mainMenu.manage();
}
}