API
Tiny Hippo 点餐系统API文档
顾客账号
POST /restaurant/customer/record
Customer info retrival
Parameters
- body (required) 顾客信息
- example value
{ "table": 0, "customerId": "string", "customerName": "string", "customerImageUrl": "string" }
- parameter content type:
application/json
- example value
Responses
- 200, OK
- 400
- Example Value
{ "code": "string", "message": "string" }
- Example Value
PUT /restaurant/customer/edit
Customer order editing
Parameters
- body (required) 更改后的订单信息
- example value
{ "orderInfo": { "orderId": 0, "table": 0, "dish": [ { "dishId": 0, "categoryId": 0, "name": "string", "price": 0, "imageUrl": "string", "number": 0, /* 该菜品的数量 */ "orderNumber": 0, /* 这个是已下单的数量 */ } ], "requirement": "string", "totalPrice": 0, "customerId": "string", "time": "2018-06-27T14:42:01.384Z", "paymentStatus": 0, "cookingStatus": "string" } }
- parameter content type:
application/json
- example value
Responses
- 200
400
- Example Value
{ "code": "string", "message": "string" }
- Example Value
GET /restaurant/table/read
Table order viewing
Parameters
无
Responses
- 200
- example value
[ { "orderInfo": { "orderId": 0, "table": 0, "dish": [ { "dishId": 0, "categoryId": 0, "name": "string", "price": 0, "imageUrl": "string", "number": 0, /* 正在点(还没确认)的某个菜品的数量 */ "orderNumber": 0, /* 已确认下单的数量 */ } ], "requirement": "string", "totalPrice": 0, "customerId": "string", "time": "2018-06-27T14:48:40.887Z", "paymentStatus": 0, "cookingStatus": "string" }, "customerName": "string", "customerImageUrl": "string" } ]
- example value
- 400
- example value
{ "code": "string", "message": "string" }
- example value
GET /restaurant/table/payment
Table order payment
Parameters
无
Responses
- 200
- 400
- example value
{ "code": "string", "message": "string" }
- example value
GET /restaurant/customer/category
Category retrival
Parameters
无
Responses
- 200
- example value
{ "categoryId": 0, "name": "string", "dish": { "dishId": 0, "categoryId": 0, "name": "string", "price": 0, "imageUrl": "string" } }
- example value
- 400
- example value
{ "code": "string", "message": "string" }
- example value
GET /restaurant/customer/history
Customer order history
Parameters
无
Responses
- 200
- example value
[ { "dish": [ { "dishId": 0, "categoryId": 0, "name": "string", "price": 0, "imageUrl": "string", "number": 0, "orderNumber": 0, } ], "requirement": "string" } ]
- example value
- 400
- example value
{ "code": "string", "message": "string" }
- example value
餐厅账号
POST /restaurant/session
Restaurant login
Parameters
- body (required)
- example value
{ "phone": "string", "password": "string" }
- parameter content type:
application/json
- example value
Responses
- 200
- 400
- example value
{ "code": "string", "message": "string" }
- example value
DELETE /restaurant/session
Restaurant logout
Parameters
无
Responses
- 200
- 400
- example value
{ "code": "string", "message": "string" }
- example value
GET /restaurant/category
Category retrival
Parameters
- body (required)
- example value
{ "categoryId": 0, "name": "string", "dish": { "dishId": 0, "categoryId": 0, "name": "string", "price": 0, "imageUrl": "string" } }
- example value
Responses
- 200
- 400
- example value
{ "code": "string", "message": "string" }
- example value
POST /restaurant/category
Dish addition
Parameters
- body (required)
- example value
{ "dishId": 0, "categoryId": 0, "name": "string", "price": 0, "imageUrl": "string" }
- parameter content type:
application/json
- example value
Responses
- 200
- 400
- example value
{ "code": "string", "message": "string" }
- example value
GET /restaurant/dish/{dishId}
Dish retrival
Parameters
dishId (string)
, 菜品ID
Responses
- 200
- example value
{ "dishId": 0, "categoryId": 0, "name": "string", "price": 0, "imageUrl": "string" }
- example value
- 400
- example value
{ "code": "string", "message": "string" }
- example value
PUT /restaurant/dish/{dishId}
Dish info modification
Parameters
dishId (string)
, 菜品ID- body
- example value
{ "dishId": 0, "categoryId": 0, "name": "string", "price": 0, "imageUrl": "string" }
- parameter content type:
application/json
- example value
Responses
- 200
- 400
- example value
{ "code": "string", "message": "string" }
- example value
DELETE /restaurant/dish/{dishId}
Dish deletion
Parameters
dishId (string)
, 待删除菜品名称
Responses
- 200
- 400
- example value
{ "code": "string", "message": "string" }
- example value
POST /restaurant/category/
Category addition
Parameters
- body (required)
- example value
{ "categoryName": "string" }
- parameter content type:
application/json
- example value
Responses
- 200
- 400
- example value
{ "code": "string", "message": "string" }
- example value
GET /restaurant/order
Order retrival
Parameters
pageSize (string) (query)
, 每页显示多少订单pageNumber (string) (query)
, 页数
Responses
- 200
[ { "orderId": 0, "table": 0, "dish": [ { "dishId": 0, "categoryId": 0, "name": "string", "price": 0, "imageUrl": "string", "number": 0, /* 某个菜点了多少份 */ } ], "requirement": "string", "totalPrice": 0, "customerId": "string", "time": "2018-06-27T15:07:15.590Z", "paymentStatus": 0, "cookingStatus": "string" } ]
- 400
- example value
{ "code": "string", "message": "string" }
- example value
推荐系统
GET /restaurant/recommendation
Recommendation retrival
Parameters
Responses
detail 是一个数组,每一组 detail 有一个 dish 和对应的推荐描述
- 200
- example value
[ { "details": [ { "description": "string", "dish": { "categoryId": 0, "dishID": 0, "imageUrl": "string", "name": "string", "price": 0 } } ], "imageUrl": "string", "recommendationId": 2, "tag": "string", "title": "string" } ]
- example value
- 400
- example value
{ "code": "string", "message": "string" }
- example value
POST /restaurant/recommendation
Recommendation addition
Parameters
- body (required)
- example value
{ "details": [ { "description": "string", "dishName": "string" } ], "imageUrl": "string", "tag": "string", "title": "string" }
- parameter content type:
application/json
- example value
模型
Record
{
table integer($int64)
customerId string
}
Restaurant
{
restaurantId integer($int64)
name string
phone string($int32)
email string
}
Customer
{
customerId string
}
Category
{
categoryId integer($int64)
name string
dish Dish{...}
}
Dish
{
dishId integer($int64)
categoryId integer($int64)
name string
price number
imageUrl string
}
DishDescription
{
comment string
monthlySales string
hot boolean
}
Requirement
{
number integer($int32)
description string
}
Order
{
orderId integer($int64)
table integer($int64)
dish Dish [...]
requirement Requirement [...]
totalPrice number
customerId string
time string($date-time)
paymentStatus integer($int32)
cookingStatus string
}
Table
{
TableID integer($int64)
}