zoo-backend/README.md

143 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ZooSystem
#### **登录接口**
请求post请求
```
url: http://localhost:8080/zoo/login/login
```
输入参数 usernameadmin password123
返回类型为R
账户正确返回数据:
```
{"code": 1,"msg": null,"data": {"roleid": 1,"name": "管理员","permissions": 0 },"map": {} }
```
错误使返回数据:
```
{"code": 0,"msg": "账号密码错误","data": null,"map": {} }
```
输入参数 usernameadmin password123
返回类型为R
账户正确返回数据:
```
{"code": 1,"msg": null,"data": {"roleid": 1,"name": "管理员","permissions": 0 },"map": {} }
```
错误使返回数据:
```
{"code": 0,"msg": "账号密码错误","data": null,"map": {} }
```
#### **动物信息管理接口**
###### **查询接口**
```
GET http://localhost:8888/zoo/animal/info
```
当请求头带有查找的aid时就只查出对应id的动物信息
###### 返回如下:
```
{
"code": 1,
"msg": null,
"data": [
{
"aId": 1,
"name": "旺财",
"sex": "1",
"species": "中华田园犬",
"weight": 20,
"height": 90,
"state": 0,
"roleid": 1,
"color": "黄",
"features": "亲人,性格温和",
"phase": "成年期"
},
{
"aId": 2,
"name": "小黑",
"sex": "1",
"species": "蓝猫",
"weight": 10,
"height": 40,
"state": 0,
"roleid": 1,
"color": "蓝黑",
"features": "不爱动",
"phase": "幼年期"
}
],
"map": {}
}
```
#### 添加接口:
```
POST : http://localhost:8888/zoo/animal/add
```
在请求体中输入数据各个属性的值
返回如下:
```
{
"code": 1,
"msg": null,
"data": "添加成功",
"map": {}
}
```
#### 修改接口:
```
POST:http://localhost:8888/zoo/animal/update
```
在请求体中输入数据各个属性的值
返回如下:
```
{
"code": 1,
"msg": null,
"data": "修改成功",
"map": {}
}
```
#### 删除接口:
```
GET:http://localhost:8888/zoo/animal/delete?aid=3
```
返回数据
```
{
"code": 1,
"msg": null,
"data": "删除成功",
"map": {}
}
```
**其他各种接口信息都如以上接口一般实现了基本的增删改查接口当操作成功时返回码code为1失败时为0**