Eric Barnaba 6 years ago
parent
commit
59c36a6cd2

+ 1
- 1
Client/src/main/java/IdCommand.java View File

@@ -1,6 +1,6 @@
1 1
 public enum IdCommand {
2 2
 
3
-    GETALL,
3
+    GET_ALL,
4 4
     POST_ID;
5 5
 
6 6
 

+ 1
- 4
Client/src/main/java/IdController.java View File

@@ -1,8 +1,5 @@
1 1
 import com.fasterxml.jackson.core.JsonProcessingException;
2 2
 
3
-import java.util.ArrayList;
4
-import java.util.List;
5
-
6 3
 public class IdController implements Runnable {
7 4
 
8 5
     private IdCommand command;
@@ -21,7 +18,7 @@ public class IdController implements Runnable {
21 18
 
22 19
     @Override
23 20
     public void run() {
24
-        if(this.command.equals(IdCommand.GETALL)){
21
+        if(this.command.equals(IdCommand.GET_ALL)){
25 22
             getAll();
26 23
         }
27 24
         else if (this.command.equals(IdCommand.POST_ID)){

+ 8
- 0
Client/src/main/java/MessageCommand.java View File

@@ -0,0 +1,8 @@
1
+public enum MessageCommand {
2
+
3
+    GET_ALL,
4
+    GET_TO_SPECIFIC,
5
+    SEND;
6
+
7
+
8
+}

+ 8
- 0
Client/src/main/java/MessageController.java View File

@@ -1,3 +1,11 @@
1 1
 public class MessageController {
2 2
 
3
+    private MessageCommand command;
4
+    private String commandLine;
5
+    private String[] commands;
6
+
7
+    public MessageController(){
8
+
9
+    }
10
+
3 11
 }

+ 1
- 9
Client/src/main/java/SimpleShell.java View File

@@ -1,5 +1,4 @@
1 1
 import com.fasterxml.jackson.core.type.TypeReference;
2
-import com.fasterxml.jackson.databind.JavaType;
3 2
 
4 3
 import java.io.BufferedReader;
5 4
 import java.io.IOException;
@@ -94,16 +93,9 @@ public class SimpleShell {
94 93
                 // ids
95 94
                 if (list.get(0).equals("ids")) {
96 95
                     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
-//                        YouAreEll.MakeURLCall("/ids", "POST", payload);
101 96
                         new Thread(new IdController(IdCommand.POST_ID,commandLine)).start();
102 97
                     } else if (list.size() == 1) {
103
-//                        String results = YouAreEll.get_ids();
104
-//                        SimpleShell.prettyPrint(results, ObjectType.ID);
105
-                        new Thread(new IdController(IdCommand.GETALL)).start();
106
-
98
+                        new Thread(new IdController(IdCommand.GET_ALL)).start();
107 99
                     } else System.out.println("Invalid Command");
108 100
                     continue;
109 101
                 }