Files
OldPeopleHome/server/README.md
jiangyuwei666 f66a4fb3f9 readme
2019-09-05 14:46:10 +08:00

81 lines
4.7 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.
## Server
### 数据库设计
* 老人表 parent
| id | longid | name | sex | birth | account | password | phone | height | weight |
| :--: | :----: | :--: | :--: | :---: | :-----: | :------: | :----: | ------ | ------ |
| 主键 | 身份证 | 姓名 | 性别 | 生日 | 账号 | 密码 | 电话号 | 身高 | 体重 |
* 子女表 child
| id | longid | name | sex | account | password | phone |
| :--: | :----: | :--: | :--: | :-----: | :------: | :----: |
| 主键 | 身份证 | 姓名 | 性别 | 账号 | 密码 | 电话号 |
* 子女老人关系表 pc
| pid | cid | relation |
| --------- | -------- | -------- |
| parent id | child id | 家属关系 |
* 房间表 room
| id | location | name | pid |
| :--: | :------: | :------: | :----: |
| 主键 | 房间位置 | 房间名称 | 老人id |
* 运动表 motion
| pid | date | count | distance | time |
| :-------------: | :--: | :---: | :------: | :--: |
| parent id(外键) | 日期 | 步数 | 距离 | 时长 |
* 睡眠表 sleep
| pid | date | deep | light | awake |
| :-------: | :--: | :------: | :------: | :------: |
| parent id | 日期 | 深睡时间 | 浅睡时间 | 清醒时间 |
* 房间实时状态表 rstate
| rid | time | temperature | humidity | isin |
| :----: | :------: | :---------: | :------: | ------------ |
| 房间号 | 测量时间 | 温度 | 湿度 | 是否在房间里 |
* 老人心率表 heartrate
| pid | time | rate |
| :--: | :------: | :--: |
| 老人 | 测量时间 | 心率 |
### 接口格式
使用实例http://39.105.65.209:8080/parent/list
基本的业务接口已经完成,如下
| 实体 | url示例 | 请求方式 | 功能概述 | 参数格式 |
| -------------- | ---------------------- | -------- | ----------------------------------------- | ------------------------------------------------------------ |
| Admin | /admin/login | POST | 后台管理员账号 | account:root,password:root |
| Room | /room/get/1 | GET | 查询id=1的room的详细信息 | |
| Room | /room/list | GET | 查询所有的room信息 | |
| Room | /room/list/empty | GET | 查询所有空置room信息(web端给老人分配房间) | |
| Room | /room/add | POST | 添加room | location:地点name:房间名 |
| Room | /room/delete/1 | DELETE | 删除id=1的room信息 | |
| Room | /room/update/1 | POST | 更新id=1的room信息 | **要更新的字段严格按照命名格式传参**比如name就传入roomName |
| Parent | /parent/get/1 | GET | 查询id=1的parent的详细信息 | |
| Parent | /parent/get_longid/111 | GET | 查询身份证=111的parent的详细信息 | |
| Parent | /parent/get_name/老王 | GET | 查询姓名=老王的parent的详细信息 | |
| Parent | /parent/get_room/1 | GET | 查询id=1的room对应老人的信息 | |
| Parent | /parent/list | GET | 查询所有老人信息 | |
| Parent | /parent/add | POST | 添加老人 | parentSex老人性别parentPassword老人密码parentAccount账号parentName姓名parentBirth生日parentLongId身份证 |
| Parent | /parent/update/1 | POST | 更新id=1的老人信息 | **要更新的字段严格按照命名格式传参**比如name就传入parentName |
| Parent | /parent/delete/1 | DELETE | 删除id=1的老人 | |