Browse Source

putting this on pause

Keith Brinker 6 years ago
parent
commit
901f2fcde5

+ 6
- 0
Client/src/main/java/Messages.java View File

13
         this.message = message;
13
         this.message = message;
14
     }
14
     }
15
 
15
 
16
+    public Messages(String fromid, String toid, String message){
17
+        this.fromid = fromid;
18
+        this.toid = toid;
19
+        this.message = message;
20
+    }
21
+
16
     @Override
22
     @Override
17
     public String toString() {
23
     public String toString() {
18
         return "Messages{" +
24
         return "Messages{" +

+ 5
- 0
Client/src/main/java/SimpleShell.java View File

93
                 }
93
                 }
94
                 // you need to add a bunch more.
94
                 // you need to add a bunch more.
95
 
95
 
96
+//                if (list.contains("POST-message")){
97
+//                    String 
98
+//
99
+//                }
100
+
96
                 //!! command returns the last command in history
101
                 //!! command returns the last command in history
97
                 if (list.get(list.size() - 1).equals("!!")) {
102
                 if (list.get(list.size() - 1).equals("!!")) {
98
                     pb.command(history.get(history.size() - 2));
103
                     pb.command(history.get(history.size() - 2));

+ 10
- 1
Client/src/main/java/YouAreEll.java View File

1
+import com.fasterxml.jackson.core.JsonProcessingException;
1
 import com.fasterxml.jackson.databind.ObjectMapper;
2
 import com.fasterxml.jackson.databind.ObjectMapper;
3
+import com.oracle.javafx.jmx.json.JSONException;
2
 import jdk.nashorn.internal.ir.RuntimeNode;
4
 import jdk.nashorn.internal.ir.RuntimeNode;
3
 import okhttp3.*;
5
 import okhttp3.*;
6
+import sun.plugin2.message.Message;
4
 
7
 
5
 import java.io.IOException;
8
 import java.io.IOException;
6
 
9
 
25
         }
28
         }
26
 
29
 
27
 
30
 
28
-
31
+    public String postMessage(String fromid, String toid, String message) throws JsonProcessingException{
32
+        ObjectMapper mapper = new ObjectMapper();
33
+        Messages myMessage = new Messages(fromid, toid, message);
34
+        String payload = mapper.writeValueAsString(myMessage);
35
+        String url = "/ids/" + toid + "/messages";
36
+       return  MakeURLCall(url, "POST", payload);
37
+    }
29
 
38
 
30
     public String get_ids() {
39
     public String get_ids() {
31
         return MakeURLCall("/ids", "GET", "");
40
         return MakeURLCall("/ids", "GET", "");