Eric Barnaba 6 anos atrás
pai
commit
59c36a6cd2

+ 1
- 1
Client/src/main/java/IdCommand.java Ver arquivo

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

+ 1
- 4
Client/src/main/java/IdController.java Ver arquivo

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

+ 8
- 0
Client/src/main/java/MessageCommand.java Ver arquivo

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 Ver arquivo

1
 public class MessageController {
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 Ver arquivo

1
 import com.fasterxml.jackson.core.type.TypeReference;
1
 import com.fasterxml.jackson.core.type.TypeReference;
2
-import com.fasterxml.jackson.databind.JavaType;
3
 
2
 
4
 import java.io.BufferedReader;
3
 import java.io.BufferedReader;
5
 import java.io.IOException;
4
 import java.io.IOException;
94
                 // ids
93
                 // ids
95
                 if (list.get(0).equals("ids")) {
94
                 if (list.get(0).equals("ids")) {
96
                     if (list.size() == 3) {
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
                         new Thread(new IdController(IdCommand.POST_ID,commandLine)).start();
96
                         new Thread(new IdController(IdCommand.POST_ID,commandLine)).start();
102
                     } else if (list.size() == 1) {
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
                     } else System.out.println("Invalid Command");
99
                     } else System.out.println("Invalid Command");
108
                     continue;
100
                     continue;
109
                 }
101
                 }