|
@@ -51,7 +51,7 @@ public class SimpleShell {
|
51
|
51
|
|
52
|
52
|
public static void main(String[] args) throws java.io.IOException {
|
53
|
53
|
|
54
|
|
- YouAreEll webber = new YouAreEll();
|
|
54
|
+ //YouAreEll webber = new YouAreEll();
|
55
|
55
|
String commandLine;
|
56
|
56
|
BufferedReader console = new BufferedReader
|
57
|
57
|
(new InputStreamReader(System.in));
|
|
@@ -94,13 +94,16 @@ public class SimpleShell {
|
94
|
94
|
// ids
|
95
|
95
|
if (list.get(0).equals("ids")) {
|
96
|
96
|
if (list.size() == 3) {
|
97
|
|
- String userName = list.get(1);
|
98
|
|
- String gitHub = list.get(2);
|
99
|
|
- String payload = Mapper.mapper.writeValueAsString(new Id(userName, gitHub));
|
100
|
|
- webber.MakeURLCall("/ids", "POST", payload);
|
|
97
|
+// String userName = list.get(1);
|
|
98
|
+// String gitHub = list.get(2);
|
|
99
|
+// String payload = Mapper.mapper.writeValueAsString(new Id(userName, gitHub));
|
|
100
|
+// YouAreEll.MakeURLCall("/ids", "POST", payload);
|
|
101
|
+ new Thread(new IdController(IdCommand.POST_ID,commandLine)).start();
|
101
|
102
|
} else if (list.size() == 1) {
|
102
|
|
- String results = webber.get_ids();
|
103
|
|
- SimpleShell.prettyPrint(results, ObjectType.ID);
|
|
103
|
+// String results = YouAreEll.get_ids();
|
|
104
|
+// SimpleShell.prettyPrint(results, ObjectType.ID);
|
|
105
|
+ new Thread(new IdController(IdCommand.GETALL)).start();
|
|
106
|
+
|
104
|
107
|
} else System.out.println("Invalid Command");
|
105
|
108
|
continue;
|
106
|
109
|
}
|
|
@@ -109,9 +112,9 @@ public class SimpleShell {
|
109
|
112
|
if (list.get(0).equals("messages")) {
|
110
|
113
|
if (list.size() == 2) {
|
111
|
114
|
String id = list.get(1);
|
112
|
|
- SimpleShell.prettyPrint(webber.MakeURLCall("/ids/" + id + "/messages", "GET", ""), ObjectType.MESSAGE);
|
|
115
|
+ SimpleShell.prettyPrint(YouAreEll.MakeURLCall("/ids/" + id + "/messages", "GET", ""), ObjectType.MESSAGE);
|
113
|
116
|
} else if (list.size() == 1) {
|
114
|
|
- String results = webber.get_messages();
|
|
117
|
+ String results = YouAreEll.get_messages();
|
115
|
118
|
SimpleShell.prettyPrint(results, ObjectType.MESSAGE);
|
116
|
119
|
} else System.out.println("Invalid Command");
|
117
|
120
|
continue;
|
|
@@ -126,10 +129,10 @@ public class SimpleShell {
|
126
|
129
|
if (withTo.find()) {
|
127
|
130
|
String to = withTo.group(3);
|
128
|
131
|
String payload = Mapper.mapper.writeValueAsString(new Message(from, to, withTo.group(1)));
|
129
|
|
- webber.MakeURLCall("/ids/" + to + "/messages", "POST", payload);
|
|
132
|
+ YouAreEll.MakeURLCall("/ids/" + to + "/messages", "POST", payload);
|
130
|
133
|
} else if (noTo.find()) {
|
131
|
134
|
String payload = Mapper.mapper.writeValueAsString(new Message(from, noTo.group(1)));
|
132
|
|
- webber.MakeURLCall("/ids/" + from + "/messages", "POST", payload);
|
|
135
|
+ YouAreEll.MakeURLCall("/ids/" + from + "/messages", "POST", payload);
|
133
|
136
|
} else System.out.println("Invalid message format");
|
134
|
137
|
continue;
|
135
|
138
|
}
|