|
@@ -71,14 +71,17 @@ public class SimpleShell {
|
71
|
71
|
|
72
|
72
|
// ids
|
73
|
73
|
if (list.contains("ids")) {
|
|
74
|
+ //get a buncha ids from the basic /ids url
|
74
|
75
|
if(list.size() == 1) {
|
75
|
76
|
String results = webber.get_ids();
|
76
|
77
|
SimpleShell.prettyPrint(results);
|
77
|
78
|
} else if (!list.get(1).equalsIgnoreCase("put")){
|
|
79
|
+ //create a new user
|
78
|
80
|
Id id = new Id("-",list.get(1), list.get(2));
|
79
|
81
|
String result = webber.post_id(mapper.writeValueAsString(id));
|
80
|
82
|
SimpleShell.prettyPrint(result);
|
81
|
83
|
} else {
|
|
84
|
+ //SUPPOSED TO UPDATE A USER BUT IT DOESNT WORK FML
|
82
|
85
|
Id id = new Id("",list.get(2) , list.get(3));
|
83
|
86
|
String result = webber.put_id(id);
|
84
|
87
|
SimpleShell.prettyPrint(result);
|
|
@@ -86,28 +89,34 @@ public class SimpleShell {
|
86
|
89
|
continue;
|
87
|
90
|
}
|
88
|
91
|
|
89
|
|
- // messages
|
|
92
|
+ // messages get requests
|
90
|
93
|
if (list.contains("messages")) {
|
91
|
94
|
if(list.size() == 1) {
|
|
95
|
+ // get messages from the /messages url
|
92
|
96
|
String results = webber.get_messages();
|
93
|
97
|
SimpleShell.prettyPrint(results);
|
94
|
98
|
} else if (list.size() == 2){
|
|
99
|
+ // get messages for a given person
|
95
|
100
|
String results = webber.get_messages(list.get(1));
|
96
|
101
|
SimpleShell.prettyPrint(results);
|
97
|
102
|
} else if (list.size() == 3){
|
|
103
|
+ // get messages for a person from another person DOESNT WORK
|
98
|
104
|
String results = webber.get_messages(list.get(1), list.get(2));
|
99
|
105
|
SimpleShell.prettyPrint(results);
|
100
|
106
|
}
|
101
|
107
|
continue;
|
102
|
108
|
}
|
103
|
|
- // send
|
104
|
109
|
|
|
110
|
+
|
|
111
|
+ // sending messages
|
105
|
112
|
if(list.contains("send")){
|
|
113
|
+ //send a message from a given id to that users messages url
|
106
|
114
|
if(list.size() == 3){
|
107
|
115
|
Message msg = new Message("-", list.get(1), "", list.get(2));
|
108
|
116
|
String response = webber.post_messages(msg);
|
109
|
117
|
SimpleShell.prettyPrint(response);
|
110
|
118
|
} else if (list.size() == 4){
|
|
119
|
+ //send a message from given id to a different users messages url
|
111
|
120
|
Message msg = new Message("-", list.get(1), list.get(2), list.get(3));
|
112
|
121
|
String response = webber.post_messages(msg);
|
113
|
122
|
SimpleShell.prettyPrint(response);
|