Skip to content

Commit 4d22267

Browse files
committed
Update README
1 parent 93ba9f2 commit 4d22267

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed

README.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,91 @@ Content-Type: application/json
187187
"description": "This is a new location"
188188
}
189189
}
190+
```
191+
## 预约地点搜索接口
192+
193+
接口地址:/searchlocation
194+
195+
请求方法:POST
196+
197+
请求参数:
198+
- token:用户登录后生成的令牌,类型为字符串
199+
- keyword:搜索关键词,类型为字符串
200+
201+
请求示例:
202+
```
203+
POST /searchlocation
204+
Content-Type: application/json
205+
206+
{
207+
"token": "abcd1234",
208+
"keyword": "Location"
209+
}
210+
```
211+
212+
返回数据:
213+
- code:返回状态码,0 表示成功,非0 表示失败
214+
- message:返回信息,搜索地点成功或失败的提示信息
215+
- data:返回的数据,搜索成功后返回符合搜索条件的地点列表
216+
217+
返回示例:
218+
```
219+
{
220+
"code": 0,
221+
"message": "搜索成功",
222+
"data": [
223+
{
224+
"id": 1,
225+
"name": "Location 1",
226+
"description": "This is location 1"
227+
},
228+
{
229+
"id": 2,
230+
"name": "Location 2",
231+
"description": "This is location 2"
232+
}
233+
]
234+
}
235+
```
236+
237+
## 用户预约接口
238+
239+
接口地址:/reservation
240+
241+
请求方法:POST
242+
243+
请求参数:
244+
- token:用户登录后生成的令牌,类型为字符串
245+
- location_id:地点ID,类型为字符串
246+
- date:预约日期,类型为字符串
247+
248+
请求示例:
249+
```
250+
POST /reservation
251+
Content-Type: application/json
252+
253+
{
254+
"token": "abcd1234",
255+
"location_id": "1",
256+
"date": "2022-01-01"
257+
}
258+
```
259+
260+
返回数据:
261+
- code:返回状态码,0 表示成功,非0 表示失败
262+
- message:返回信息,预约成功或失败的提示信息
263+
- data:返回的数据,预约成功后返回预约记录信息
264+
265+
返回示例:
266+
```
267+
{
268+
"code": 0,
269+
"message": "预约成功",
270+
"data": {
271+
"id": 1,
272+
"user_id": 123,
273+
"location_id": 1,
274+
"date": "2022-01-01"
275+
}
276+
}
190277
```

0 commit comments

Comments
 (0)