-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdmclient.js
73 lines (68 loc) · 1.86 KB
/
dmclient.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
var dm = require ('./dm_remote.js');
// Argumentos
var HOST = process.argv[2];
var PORT = process.argv[3];
dm.Start(HOST, PORT, function () {
switch(process.argv[4]){
case "get subject list":
dm.getSubjectList (function (ml) {
console.log ("get subject list:");
console.log (JSON.stringify(ml));
});
break;
case 'get user list':
dm.getUserList (function (ml) {
console.log ("get user list:");
console.log (JSON.stringify(ml));
});
break;
case 'get private message list':
dm.getPrivateMessageList (process.argv[5],process.argv[6],function (ml) {
console.log ("get private message list")
console.log (JSON.stringify(ml));
});
break;
case 'add user':
dm.addUser (process.argv[5],process.argv[6], function (ml) {
console.log ("add user")
console.log (JSON.stringify(ml));
});
break;
case 'add subject':
dm.addSubject (process.argv[5], function (ml) {
console.log ("add subject")
console.log (JSON.stringify(ml));
});
break;
case 'get public message list':
dm.getPublicMessageList (process.argv[5],function (ml) {
console.log ("get public message list")
console.log (JSON.stringify(ml));
});
break;
case 'add private message':
dm.addPrivateMessage (process.argv[5],function (ml) {
console.log ("add private message")
console.log (JSON.stringify(ml));
});
break;
case 'add public message':
dm.addPublicMessage (process.argv[5],function (ml) {
console.log ("add public message")
console.log (JSON.stringify(ml));
});
break;
case 'get subject':
dm.getSubject (process.argv[5],function (ml) {
console.log ("get subject")
console.log (JSON.stringify(ml));
});
break;
case 'login':
dm.login (process.argv[5],process.argv[6],function (ml) {
console.log ("login")
console.log (JSON.stringify(ml));
});
break;
}
});