Kaynağa Gözat

Revert "more merging"

This reverts commit d9716f3560f5ff19b204b842df951e88e8f809f4.
Trinh Tong 6 yıl önce
ebeveyn
işleme
4ab5ed2364

+ 1
- 4
Client/Client.iml Dosyayı Görüntüle

@@ -1,6 +1,6 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3
-  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
3
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
4 4
     <output url="file://$MODULE_DIR$/target/classes" />
5 5
     <output-test url="file://$MODULE_DIR$/target/test-classes" />
6 6
     <content url="file://$MODULE_DIR$">
@@ -10,10 +10,7 @@
10 10
     </content>
11 11
     <orderEntry type="inheritedJdk" />
12 12
     <orderEntry type="sourceFolder" forTests="false" />
13
-<<<<<<< HEAD
14 13
 
15
-=======
16
->>>>>>> parent of decda75... ugh
17 14
     <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
18 15
     <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
19 16
     <orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.8.6" level="project" />

+ 0
- 3
Client/pom.xml Dosyayı Görüntüle

@@ -29,7 +29,4 @@
29 29
             <version>4.12</version>
30 30
             <scope>test</scope>
31 31
         </dependency>
32
-
33
-    </dependencies>
34
-
35 32
 </project>

+ 6
- 2
Client/src/main/java/SimpleShell.java Dosyayı Görüntüle

@@ -1,6 +1,8 @@
1
+import com.sun.tools.javac.tree.Pretty;
1 2
 import ids.Id;
2 3
 import ids.IdController;
3 4
 import message.MessageController;
5
+import message.PrettyPrintMessage;
4 6
 import shellutilities.YouAreEll;
5 7
 
6 8
 import java.io.BufferedReader;
@@ -67,8 +69,10 @@ public class SimpleShell {
67 69
 
68 70
                 // messages - all messages
69 71
                 if (commands[0].equals("message")) {
70
-                    MessageController mc = new MessageController(commands);
71
-                    mc.messageController();
72
+//                    MessageController mc = new MessageController(commands);
73
+//                    mc.messageController();
74
+                    YouAreEll webber =  new YouAreEll();
75
+                    PrettyPrintMessage.prettyPrintMessageArray(webber.get_messages());
72 76
                     continue;
73 77
                 }
74 78
                 // you need to add a bunch more.

+ 14
- 2
Client/src/main/java/message/MessageController.java Dosyayı Görüntüle

@@ -8,7 +8,7 @@ import java.io.IOException;
8 8
 
9 9
 public class MessageController {
10 10
     private YouAreEll url;
11
-    private final String MAIN_URL = "/message";
11
+    private final String MAIN_URL = "/messages";
12 12
     private Console c;
13 13
     private String[] userLine;
14 14
     private int size;
@@ -20,8 +20,14 @@ public class MessageController {
20 20
         size = userLine.length;
21 21
     }
22 22
 
23
-    public void messageController() throws IOException {
23
+    /*
24
+    messagees - returns last 20 messages
25
+    messages your_github_id - last 20 sent to you
26
+    send your_github_id "Hello World" - sends to everyone
27
+    send your_github_id 'my string message' to some_friend_githubid
28
+     */
24 29
 
30
+    public void messageController() throws IOException {
25 31
         PrettyPrintMessage.prettyPrintMessageArray(get_messages());
26 32
     }
27 33
 
@@ -30,4 +36,10 @@ public class MessageController {
30 36
         return url.MakeURLCall(MAIN_URL, RequestType.GET, "");
31 37
     }
32 38
 
39
+    private String getMessagesToMe() {
40
+
41
+
42
+        return null;
43
+    }
44
+
33 45
 }

+ 2
- 2
Client/src/main/java/message/PrettyPrintMessage.java Dosyayı Görüntüle

@@ -13,9 +13,9 @@ public class PrettyPrintMessage {
13 13
         ObjectMapper mapper = new ObjectMapper();
14 14
         mapper.registerModule(new JsonOrgModule());
15 15
 
16
-        List<Message> idArray = mapper.readValue(output, new TypeReference<List<Message>>(){});
16
+        List<Message> messageArray = mapper.readValue(output, new TypeReference<List<Message>>(){});
17 17
 
18
-        System.out.println(idArray.toString());
18
+        System.out.println(messageArray.toString());
19 19
 
20 20
     }
21 21
     //

+ 1
- 0
Client/src/main/java/shellutilities/YouAreEll.java Dosyayı Görüntüle

@@ -7,6 +7,7 @@ import org.apache.http.client.methods.HttpPost;
7 7
 import org.apache.http.client.methods.HttpPut;
8 8
 import org.apache.http.entity.StringEntity;
9 9
 import org.apache.http.impl.client.HttpClientBuilder;
10
+import sun.net.www.http.HttpClient;
10 11
 
11 12
 import java.io.BufferedReader;
12 13
 import java.io.IOException;