-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresource.apib
211 lines (173 loc) · 4.37 KB
/
resource.apib
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
FORMAT: 1A
HOST: http://47.93.188.36:3000
# Treering
> NOTE: 每个请求的返回格式都按照如下返回
```
{
code:'', //请求状态值
message:'', //错误信息
data:'' //正常数据
}
```
> code 值分200和非200,当code为200时说明返回的data数据是预期数据,如果是非200则查看message报告错误信息
> 其中非200的code值对应意义如下
|code值|意义|
|------|-------|
|201| 注册用户名格式不正确|
|202| 注册密码格式不正确|
|203| 注册用户不成功|
|204| 用户名已被注册|
|205| 登陆用户不存在|
|206| 用户验证登录密码不正确|
|301| 数据库插入错误|
|303| 没有数据|
## Group Account
## 注册 [POST /register]
+ Parameters
- name (string)
- password (string)
+ Response 200 (application/json)
{
code:200,
message:'',
data:'success'
}
## 登录 [POST /login]
+ Response 200 (application/json)
{
code:200,
message:'',
data:{
_id: '12314345345',
name: 'shangxinbo',
join_time: '2017-06-28T09:45:40.853Z',
last_time: '2017-06-28T09:45:40.853Z'
}
}
## 重置密码 [POST /resetpass]
+ Parameters
- name (string)
- keyword (string)
+ Response 200 (application/json)
{
code:200,
message:'',
data:'验证通过'
}
## 退出 [POST /logout]
+ Response 200 (application/json)
{
code:200,
message:'',
data:'success'
}
## 验证登录密码 [POST /verifypass]
+ Parameters
- password (string)
+ Response 200 (application/json)
{
code:200,
message:'',
data:'success'
}
# Group Todos
## 创建任务 [POST /todos/create]
+ Parameters
- type (number) - 0: default 创建紧急任务,1:创建重要任务
- text (string)
+ Response 200 (application/json)
{
code:200,
message:'',
data:'success'
}
## 任务列表 [POST /todos/find]
+ Parameters
- type (number) - 0: default 创建紧急任务,1:创建重要任务
+ Response 200 (application/json)
{
code:200,
message:'',
data:[
'asdfa',
'asdfas'
]
}
## 待办事项整体保存 [POST /todos/save]
+ Parameters
- type (number)
- arr (array) [
'asdfasf',
'asdfas',
'asdfasd'
]
+ Response 200 (application/json)
{
code:200,
message:'',
data:'success'
}
## 获取当前任务 [POST /current]
+ Response 200 (application/json)
{
code:200,
message:'',
data:'123123'
}
# Group History
## 历史列表 [POST /history/list]
+ Response 200 (application/json)
{
code:200,
message:'',
data:[
{
_id:'asdfasdfasd',
user_id:'123123123',
text:'asdasf',
status:1,
end_time:'2017-06-28T09:45:40.853Z'
},
{
_id:'asdfasdfasd',
user_id:'123123123',
text:'asdasf',
status:-1,
end_time:'2017-06-28T09:45:40.853Z'
},
{
_id:'asdfasdfasd',
user_id:'123123123',
text:'asdasf',
status:1,
end_time:'2017-06-28T09:45:40.853Z'
}
]
}
## 处理任务 [POST /history/add]
+ Parameters
- text (string)
- status (number) - 1:完成,-1:放弃
+ Response 200 (application/json)
{
code:200,
message:'',
data:'success'
}
# Group Memo
## 查看备忘 [POST /memo/view]
+ Response 200 (application/json)
{
code:200,
message:'',
data:'@@@asdafa'
}
## 保存备忘 [POST /memo/save]
+ Parameters
- content (string)
+ Response 200 (application/json)
{
code:200,
message:'',
data:'success'
}