# security **Repository Path**: Agneszyp/security ## Basic Information - **Project Name**: security - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-06-20 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 一、数据库 创建数据库 ``` CREATE DATABASE `smart_community`; ``` 实体类中属性 名对应表中属性名的驼峰命名。 ## 1、管理员 | 属性名 | 含义 | 类别 | 数据类型 | 取值说明 | | ----------- | -------- | ---- | -------- | ------------------- | | admin_id | ID | 主码 | INT | 从20200101递增 | | admin_name | 姓名 | | VARCHAR | | | admin_pass | 密码 | | VARCHAR | | | admin_sex | 性别 | | INT | 0未知,1男,2女 | | admin_phone | 联系电话 | | VARCHAR | | | admin_email | 邮箱 | | VARCHAR | | | admin_role | 角色 | | INT | 0超级管理员,1管理员 | ``` DROP TABLE IF EXISTS `admin`; create table `admin`( `admin_id` int primary key auto_increment, `admin_name` varchar(255) not null, `admin_pass` varchar(255) not null, `admin_sex` int not null, `admin_phone` varchar(11), `admin_email` varchar(255), `admin_role` int not null )AUTO_INCREMENT=20200101 DEFAULT CHARSET=utf8; insert into `admin`(admin_id,admin_name,admin_pass,admin_sex,admin_phone,admin_email,admin_role) values (20200001,'郑燕萍','123456','2','15012345678','123456@qq.com','0'); insert into `admin`(admin_id,admin_name,admin_pass,admin_sex,admin_phone,admin_email,admin_role) values (20200002,'陈和斌','123456','1','15112345678','654321@qq.com','0'); insert into `admin`(admin_name,admin_pass,admin_sex,admin_phone,admin_email,admin_role) values ('杨睿','123456','2','15912345678','112233@qq.com','1'); ``` ## 2、小程序用户 | 属性名 | 含义 | 类别 | 数据类型 | 取值说明 | | ----------- | -------------- | ---- | -------- | ------------------- | | openid | 用户OpenID | 主码 | VARCHAR | | | user_id | 身份证 | | CHAR(18) | | | name | 真实姓名 | | VARCHAR | | | role | 角色 | | INT | 0居民、1检查人员 | | sex | 用户性别 | | INT | 0未知、1男、2女 | | address | 住址 | | VARCHAR | | | picture | 用户头像 | | VARCHAR | | | nick | 用户昵称 | | VARCHAR | | | phone | 手机号 | | VARCHAR | | | is_lock | 是否被锁定 | | INT | 0否、1是 | | is_resident | 是否本社区住户 | | INT | 0否、1是 | | status | 当前健康状态 | | INT | 0正常、1预警、2高危 | | skey | 当前会话关键词 | | VARCHAR | | ``` DROP TABLE IF EXISTS `user`; create table `user`( `openid` varchar(255) primary key, `user_id` char(18), `name` varchar(255), `role` int, `sex` int, `address` varchar(255), `picture` varchar(255), `nick` varchar(255) , `phone` varchar(11) , `is_lock` int, `is_resident` int, `status` int, `skey` varchar(255) )DEFAULT CHARSET=utf8; insert into `user`(openid,user_id,name,role,sex,address,picture,nick,phone,is_lock,is_resident,status,skey) values ('asdf_43mZfANIfwdoIVe_L309OfE','440582199810189999','王晓红','0','2','2栋209号房','picture.png','Agnes','15012345678','0','1','0','11e05a02-62ba-bdc4-3bd1ee399bd9'); insert into `user`(openid,user_id,name,role,sex,address,picture,nick,phone,is_lock,is_resident,status,skey) values ('sssf_43mZfANIfwdoIVe_L309OfE','440582199810180000','张三','1','1','20栋209号房','picture.png','冰','15012345678','0','1','0','221e05a02-62ba-bdc4-3bd1ee399bd9'); ``` ## 3、住户健康信息 | 属性名 | 含义 | 类别 | 数据类型 | 取值说明 | | ----------- | ------------------------------- | ---- | -------- | ------------------- | | health_id | 信息ID | 主码 | INT | 从1递增 | | openid | 住户账号ID | | VARCHAR | | | temperature | 体温 | | FLOAT | | | status | 身体状况 | | INT | 0正常、1预警、2高危 | | is_contact | 近14天是否是否接触疑似/确诊病例 | | INT | 0否、1是 | | is_arrive | 近14天是否是否到达/途经国外 | | INT | 0否、1是 | | time | 登记时间 | | DATETIME | | | access | 出入 | | INT | 0进、1出 | ``` DROP TABLE IF EXISTS `health`; create table `health`( `health_id` int primary key auto_increment, `openid` varchar(255) not null, `temperature` float not null, `status` int not null, `is_contact` int not null, `is_arrive` int not null , `time` datetime not null, `access` int not null )DEFAULT CHARSET=utf8; insert into `health`(openid,temperature,status,is_contact,is_arrive,time,access) values ('asdf_43mZfANIfwdoIVe_L309OfE','37.1',0,0,0,'2020-4-1 10:10:10',0); ``` 所有数据库操作可以通过Druid监控 ``` 测试:localhost:8080/druid //登录使用的用户名和密码 initParams.put("loginUsername","Agnes"); initParams.put("loginPassword","123456"); ``` # 二、API ## 1、小程序端 ### 1、登录 ``` Post请求 /user/login ``` 参数 ``` code(String):"033QiIOE1iy4W40p6eOE1mGLOE1QiIOg" rawData(String):"{"nickName":"冰","gender":1,"language":"zh_CN","city":"Dongguan","province":"Guangdong","country":"China","avatarUrl":"https://wx.qlogo.cn/mmopen/vi_32/dQQR8nfd3k8zO9Z7TjOxSpAFNcACz3WfETNMuu7JUGYAQaDZUYBD45REcrX1Iia5O3hIicdb2jH9du1BzwBVqzgw/132"}" signature(String):1dd84c550cba6299fbdf7ee00c8a1063ca27f6d1 ``` 返回 ``` { "status": 200, "msg": "成功", "data": { "openid": "oUX3_43mZfANIfwdoIVe_L309OfE", "userId": null, "name": null, "role": 0, "sex": 1, "address": null, "picture": "https://wx.qlogo.cn/mmopen/vi_32/dQQR8nfd3k8zO9Z7TjOxSpAFNcACz3WfETNMuu7JUGYAQaDZUYBD45REcrX1Iia5O3hIicdb2jH9du1BzwBVqzgw/132", "nick": "冰", "phone": null, "isLock": 0, "isResident": null, "status": 0, "skey": "9ffd9de2-f323-4b35-9e54-0b7c229c9d5b", "healthInfos": null } } { "status": 500, "msg": "签名校验失败", "data": null } { "status": 500, "msg": "该账号被锁定,无法登录", "data": null } ``` ### 2、完善用户信息 登录后前端根据返回信息判断是否需要 ``` put请求 /user/register ``` 参数 ``` //表单填写的内容 userId(String):"440582199810189911"(身份证) name(String):"王小红" address(String):"21栋501房" phone(String):"13355667788" isResident(Int):1([0,1]) openid(String):asdf_43mZfANIfwdoIVe_L309OfE ``` 返回 ```` { "status": 200, "msg": "成功", "data": null } { "status": 500, "msg": "修改异常", "data": null } ```` ### 3、根据id获取用户信息 ``` get请求 /user/{openid} 例如:http://localhost:8080/user/asdf_43mZfANIfwdoIVe_L309OfE ``` 参数 ``` openid(String):"asdf_43mZfANIfwdoIVe_L309OfE" skey(String):11e05a02-62ba-bdc4-3bd1ee399bd9 ``` 返回 ``` { "status": 200, "msg": "成功", "data": { "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "userId": "440582199810189911", "name": "王小红", "role": 0, "sex": 2, "address": "21栋501房", "picture": "picture.png", "nick": "Agnes", "phone": "13355667788", "isLock": 0, "isResident": 1, "status": 0, "skey": "11e05a02-62ba-bdc4-3bd1ee399bd9", "healthInfos": null } } 或 { "status": 500, "msg": "查询异常", "data": null } { "status": 500, "msg": "skey校验异常", "data": null } ``` ### 4、修改用户信息 需要显示用户信息可以通过第三点 `get请求 /user/{openid}` ``` put请求 /user ``` 参数 ``` //表单填写的内容 userId(String):"440582199810189911"(身份证) name(String):"王小红" address(String):"2栋501房" phone(String):"13355667788" isResident(Int):1([0,1]) sex(Int):2([0,1,2]) skey(String):11e05a02-62ba-bdc4-3bd1ee399bd9 openid(String):asdf_43mZfANIfwdoIVe_L309OfE ``` 返回 ```` { "status": 200, "msg": "成功", "data": null } { "status": 500, "msg": "修改异常", "data": null } { "status": 500, "msg": "skey校验异常", "data": null } ```` ### 5、填写健康信息 需要显示用户信息可以通过第三点 `get请求 /user/{openid}` ``` POST /health ``` 参数 ``` //表单填写的内容 temperature(float):37.1 isContact(Int):1([0,1]) isArrive(Int):0([0,1]) access(Int):1([0,1]) openid(String):"asdf_43mZfANIfwdoIVe_L309OfE" skey(String):221e05a02-62ba-bdc4-3bd1ee399bd9 ``` 返回 ``` { "status": 200, "msg": "成功", "data": null } { "status": 500, "msg": "添加异常", "data": null } { "status": 500, "msg": "更新用户当前身体状况异常", "data": null } { "status": 500, "msg": "skey校验异常", "data": null } ``` ## 2、管理后端 ### 1、登录 ``` Post请求 /admin/login ``` 参数 ``` name(String):"20200001" (name可以是id:"20200001",phone:"15012345678",email:"123456@qq.com") password(String):"123456" ``` 返回 ``` { "status": 200, "msg": "成功", "data": { "adminId": 20200001, "adminName": "郑燕萍", "adminPass": "123456", "adminSex": 2, "adminPhone": "15012345678", "adminEmail": "123456@qq.com", "adminRole": 0 } } { "status": 500, "msg": "密码错误", "data": null } { "status": 500, "msg": "没有该账号", "data": null } ``` ### 2、管理员账号管理 (超级管理员的权限,所有操作不针对超级管理员) #### 1、管理员账号查找 1、查询所有管理员 ``` GET /admins ``` 参数: ``` 无 ``` 返回: ``` { "status": 200, "msg": "成功", "data": [ { "adminId": 20200101, "adminName": "杨睿", "adminPass": "123456", "adminSex": 2, "adminPhone": "15912345678", "adminEmail": "112233@qq.com", "adminRole": 1 } ] } 或 { "status": 200, "msg": "成功", "data": [] } ``` 2、查询某个 ``` GET /admin/{adminId} ``` 参数: ``` adminId(Integer):20200101 ``` 返回: ``` { "status": 200, "msg": "成功", "data": { "adminId": 20200101, "adminName": "杨睿", "adminPass": "123456", "adminSex": 2, "adminPhone": "15912345678", "adminEmail": "112233@qq.com", "adminRole": 1 } } 或 { "status": 200, "msg": "成功", "data": null } ``` 3、根据关键词查找 ``` GET /admins/{key} ``` 参数: ``` key(String):"杨" (key可以是adminId:20200101,adminName:杨,adminSex:女) ``` 返回 ``` { "status": 200, "msg": "成功", "data": [ { "adminId": 20200101, "adminName": "杨睿", "adminPass": "123456", "adminSex": 2, "adminPhone": "15912345678", "adminEmail": "112233@qq.com", "adminRole": 1 } ] } 或 { "status": 200, "msg": "成功", "data": [] } ``` #### 2、管理员账号增加 ``` POST /admin ``` 参数 ``` //表单填的内容 adminName(String):李四 adminPass(String):123456 adminSex(Int):1 //以下两个我觉得填不填无所谓,让管理员自己完善也行 adminPhone(String):13322334455 adminEmail(String):987854@qq.com ``` 返回 ``` { "status": 200, "msg": "成功", "data": null } { "status": 500, "msg": "添加异常", "data": null } ``` #### 3、管理员账号删除 ``` DELETE /admin/{adminId} ``` 参数 ``` adminId(Integer):20200102 ``` 返回 ``` { "status": 200, "msg": "成功", "data": null } { "status": 500, "msg": "删除异常", "data": null } ``` #### 4、管理员账号修改 ``` //需要显示信息可以通过GET /admin/{id} //修改 PUT /admin ``` 参数 ``` //表单可填内容 adminName(String):杨睿 adminPass(String):123456 adminSex(Integer):1 adminPhone(String):13322334455 adminEmail(String):987854@qq.com adminId(Integer):20200101 ``` 返回 ``` { "status": 200, "msg": "成功", "data": null } { "status": 500, "msg": "修改异常", "data": null } ``` ### 3、用户账号管理 增只能由住户注册(授权);管理员也不要删除和修改住户信息 #### 1、查询 1、查询所有 ``` GET /users ``` 参数: ``` 无 ``` 返回 ``` { "status": 200, "msg": "成功", "data": [ { "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "userId": "440582199810189911", "name": "王小红", "role": 1, "sex": 2, "address": "21栋501房", "picture": "picture.png", "nick": "Agnes", "phone": "13355667788", "isLock": 0, "isResident": 1, "status": 2, "skey": "11e05a02-62ba-bdc4-3bd1ee399bd9", "healthInfos": null }, { "openid": "sssf_43mZfANIfwdoIVe_L309OfE", "userId": "440582199810180000", "name": "张三", "role": 1, "sex": 1, "address": "20栋209号房", "picture": "picture.png", "nick": "冰", "phone": "15012345678", "isLock": 0, "isResident": 1, "status": 0, "skey": "221e05a02-62ba-bdc4-3bd1ee399bd9", "healthInfos": null }, { "openid": "oUX3_43mZfANIfwdoIVe_L309OfE", "userId": null, "name": null, "role": null, "sex": 1, "address": null, "picture": "https://wx.qlogo.cn/mmopen/vi_32/dQQR8nfd3k8zO9Z7TjOxSpAFNcACz3WfETNMuu7JUGYAQaDZUYBD45REcrX1Iia5O3hIicdb2jH9du1BzwBVqzgw/132", "nick": "冰", "phone": null, "isLock": 0, "isResident": null, "status": 0, "skey": "9ffd9de2-f323-4b35-9e54-0b7c229c9d5b", "healthInfos": null } ] } ``` 2、id查询 ``` GET /user ``` 参数 ``` openid(String):asdf_43mZfANIfwdoIVe_L309OfE ``` 返回 ``` { "status": 200, "msg": "成功", "data": { "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "userId": "440582199810189911", "name": "王小红", "role": 1, "sex": 2, "address": "21栋501房", "picture": "picture.png", "nick": "Agnes", "phone": "13355667788", "isLock": 0, "isResident": 1, "status": 2, "skey": "11e05a02-62ba-bdc4-3bd1ee399bd9", "healthInfos": null } } ``` 3、关键词搜索 姓名或房号的模糊查询,根据身份证搜索 ``` GET /users/{key} 例如:http://localhost:8080/residents/王 ``` 参数 ``` key(String):王 (name:王 or address:501 or id:440582199810189911) ``` 返回 ``` { "status": 200, "msg": "成功", "data": [ { "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "userId": "440582199810189911", "name": "王小红", "role": 1, "sex": 2, "address": "21栋501房", "picture": "picture.png", "nick": "Agnes", "phone": "13355667788", "isLock": 0, "isResident": 1, "status": 2, "skey": "11e05a02-62ba-bdc4-3bd1ee399bd9", "healthInfos": null } ] } ``` #### 2、锁定或解锁账号 ``` PUT /user/lock/{openid} ``` 参数 ``` openid(String):asdf_43mZfANIfwdoIVe_L309OfE ``` 返回 ``` { "status": 200, "msg": "成功", "data": null } { "status": 500, "msg": "锁定账号异常", "data": null } { "status": 500, "msg": "解锁账号异常", "data": null } ``` #### 3、将用户角色修改为检查人员或住户 ``` PUT /user/role/{openid} ``` 参数 ``` openid(String):asdf_43mZfANIfwdoIVe_L309OfE ``` 返回 ``` { "status": 200, "msg": "成功", "data": null } { "status": 500, "msg": "修改为检查人员异常", "data": null } { "status": 500, "msg": "修改为住户异常", "data": null } ``` ### 4、健康信息管理 健康信息只能由住户被扫描二维码时检查人员添加,详见小程序端第五点 管理人员不能删除,但可以修改 这部分返回的数据有带所属用户的信息 #### 1、查询健康信息 1、查询所有 ``` GET /healths ``` 参数 ``` 无 ``` 返回 ``` { "status": 200, "msg": "成功", "data": [ { "healthId": 1, "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "temperature": 37.1, "status": 0, "isContact": 0, "isArrive": 0, "time": "2020-04-01T10:10:10", "access": 0, "resident": { "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "userId": "440582199810189911", "name": "王小红", "role": 0, "sex": 2, "address": "2栋501房", "picture": "picture.png", "nick": "Agnes", "phone": "13355667788", "isLock": 0, "isResident": 1, "status": 1, "skey": "11e05a02-62ba-bdc4-3bd1ee399bd9", "healthInfos": null } }, { "healthId": 2, "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "temperature": 37.1, "status": 1, "isContact": 1, "isArrive": 0, "time": "2020-06-06T18:14:27", "access": 1, "resident": { "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "userId": "440582199810189911", "name": "王小红", "role": 0, "sex": 2, "address": "2栋501房", "picture": "picture.png", "nick": "Agnes", "phone": "13355667788", "isLock": 0, "isResident": 1, "status": 1, "skey": "11e05a02-62ba-bdc4-3bd1ee399bd9", "healthInfos": null } } ] } ``` 2、id查询 ``` GET /health/id http://localhost:8080/health/1 ``` 参数 ``` healthId(Integer):1 ``` 返回 ``` { "status": 200, "msg": "成功", "data": { "healthId": 1, "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "temperature": 37.1, "status": 0, "isContact": 0, "isArrive": 0, "time": "2020-04-01T10:10:10", "access": 0, "resident": { "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "userId": "440582199810189911", "name": "王小红", "role": 0, "sex": 2, "address": "2栋501房", "picture": "picture.png", "nick": "Agnes", "phone": "13355667788", "isLock": 0, "isResident": 1, "status": 1, "skey": "11e05a02-62ba-bdc4-3bd1ee399bd9", "healthInfos": null } } } ``` 3、搜索:根据进出查询,或根据状态查询 ``` GET /healths/key 例如:http://localhost:8080/healths/进 ``` 参数 ``` key(String):进 (access:进 or status:健康) ``` 返回 ``` { "status": 200, "msg": "成功", "data": [ { "healthId": 1, "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "temperature": 37.1, "status": 0, "isContact": 0, "isArrive": 0, "time": "2020-04-01T10:10:10", "access": 0, "resident": { "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "userId": "440582199810189911", "name": "王小红", "role": 0, "sex": 2, "address": "2栋501房", "picture": "picture.png", "nick": "Agnes", "phone": "13355667788", "isLock": 0, "isResident": 1, "status": 1, "skey": "11e05a02-62ba-bdc4-3bd1ee399bd9", "healthInfos": null } } ] } ``` #### 2、修改健康信息 健康信息录入错误,可以通过后台管理员改 要显示该健康信息可以`GET /health/id`得到 ``` PUT /health ``` 参数 ``` //表单修改内容 temperature(float):39.1 isContact(Int):0 isArrive(Int):0 access(Int):0 healthId (Int):1 ``` 返回 ``` { "status": 200, "msg": "成功", "data": null } { "status": 500, "msg": "修改异常", "data": null } { "status": 500, "msg": "更新用户当前身体状况异常", "data": null } ``` #### 3、预警模块 经过我们之前讨论后决定,这块只是显示当前状态为预警和高危两部分的用户而已 还有前端将二维码的变成三种颜色 这一块后端返回的数据为用户,还可以通过用户openid查询历史健康信息 1、状态为预警的用户 ``` GET /healths/warn ``` 参数 ``` 无 ``` 返回 ``` { "status": 200, "msg": "成功", "data": [ { "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "userId": "440582199810189911", "name": "王小红", "role": 0, "sex": 2, "address": "2栋501房", "picture": "picture.png", "nick": "Agnes", "phone": "13355667788", "isLock": 0, "isResident": 1, "status": 1, "skey": "11e05a02-62ba-bdc4-3bd1ee399bd9", "healthInfos": null } ] } ``` 2、状态为高危的用户 ``` GET /healths/danger ``` 参数 ``` 无 ``` 返回 ``` { "status": 200, "msg": "成功", "data": [ { "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "userId": "440582199810189911", "name": "王小红", "role": 0, "sex": 2, "address": "2栋501房", "picture": "picture.png", "nick": "Agnes", "phone": "13355667788", "isLock": 0, "isResident": 1, "status": 2, "skey": "11e05a02-62ba-bdc4-3bd1ee399bd9", "healthInfos": null } ] } ``` 3、通过用户openid查询历史健康信息 ``` GET /healths/byOpenid/{openid} 例如:http://localhost:8080/healths/byOpenid/asdf_43mZfANIfwdoIVe_L309OfE ``` 参数 ``` openid(String):asdf_43mZfANIfwdoIVe_L309OfE ``` 返回 ``` { "status": 200, "msg": "成功", "data": [ { "healthId": 1, "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "temperature": 38.1, "status": 1, "isContact": 0, "isArrive": 0, "time": "2020-06-06T22:48:50", "access": 0, "resident": null }, { "healthId": 2, "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "temperature": 37.1, "status": 1, "isContact": 1, "isArrive": 0, "time": "2020-06-06T18:14:27", "access": 1, "resident": null }, { "healthId": 9, "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "temperature": 39.1, "status": 2, "isContact": 0, "isArrive": 0, "time": "2020-06-06T22:52:36", "access": 0, "resident": null } ] } ``` ### 5、数据统计 #### 1、出入数据 这个我会传给你所有的健康信息,里面有包括出入信息 ``` GET /healths(这个api与查询所有健康信息一致) ``` 参数 ``` 无 ``` 返回 ``` { "status": 200, "msg": "成功", "data": [ { "healthId": 1, "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "temperature": 37.1, "status": 0, "isContact": 0, "isArrive": 0, "time": "2020-04-01T10:10:10", "access": 0, "resident": { "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "userId": "440582199810189911", "name": "王小红", "role": 0, "sex": 2, "address": "2栋501房", "picture": "picture.png", "nick": "Agnes", "phone": "13355667788", "isLock": 0, "isResident": 1, "status": 1, "skey": "11e05a02-62ba-bdc4-3bd1ee399bd9", "healthInfos": null } }, { "healthId": 2, "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "temperature": 37.1, "status": 1, "isContact": 1, "isArrive": 0, "time": "2020-06-06T18:14:27", "access": 1, "resident": { "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "userId": "440582199810189911", "name": "王小红", "role": 0, "sex": 2, "address": "2栋501房", "picture": "picture.png", "nick": "Agnes", "phone": "13355667788", "isLock": 0, "isResident": 1, "status": 1, "skey": "11e05a02-62ba-bdc4-3bd1ee399bd9", "healthInfos": null } } ] } ``` #### 2、健康数据 这个我会传给你每个用户的信息,再根据用户的openid可以查询他所有的健康信息 1、所有用户信息 ``` GET /users ``` 参数 ``` 无 ``` 返回 ``` { "status": 200, "msg": "成功", "data": [ { "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "userId": "440582199810189911", "name": "王小红", "role": 0, "sex": 2, "address": "2栋501房", "picture": "picture.png", "nick": "Agnes", "phone": "13355667788", "isLock": 0, "isResident": 1, "status": 2, "skey": "11e05a02-62ba-bdc4-3bd1ee399bd9", "healthInfos": null }, { "openid": "sssf_43mZfANIfwdoIVe_L309OfE", "userId": "440582199810180000", "name": "张三", "role": 1, "sex": 1, "address": "20栋209号房", "picture": "picture.png", "nick": "冰", "phone": "15012345678", "isLock": 0, "isResident": 1, "status": 0, "skey": "221e05a02-62ba-bdc4-3bd1ee399bd9", "healthInfos": null }, { "openid": "oUX3_43mZfANIfwdoIVe_L309OfE", "userId": null, "name": null, "role": null, "sex": 1, "address": null, "picture": "https://wx.qlogo.cn/mmopen/vi_32/dQQR8nfd3k8zO9Z7TjOxSpAFNcACz3WfETNMuu7JUGYAQaDZUYBD45REcrX1Iia5O3hIicdb2jH9du1BzwBVqzgw/132", "nick": "冰", "phone": null, "isLock": 0, "isResident": null, "status": 0, "skey": "9ffd9de2-f323-4b35-9e54-0b7c229c9d5b", "healthInfos": null } ] } ``` 2、通过用户openid查询历史健康信息(这个跟预警模块的第三点一样的) ``` GET /healths/byOpenid/{openid} 例如:http://localhost:8080/healths/byOpenid/asdf_43mZfANIfwdoIVe_L309OfE ``` 参数 ``` openid(String):asdf_43mZfANIfwdoIVe_L309OfE ``` 返回 ``` { "status": 200, "msg": "成功", "data": [ { "healthId": 1, "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "temperature": 38.1, "status": 1, "isContact": 0, "isArrive": 0, "time": "2020-06-06T22:48:50", "access": 0, "resident": null }, { "healthId": 2, "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "temperature": 37.1, "status": 1, "isContact": 1, "isArrive": 0, "time": "2020-06-06T18:14:27", "access": 1, "resident": null }, { "healthId": 9, "openid": "asdf_43mZfANIfwdoIVe_L309OfE", "temperature": 39.1, "status": 2, "isContact": 0, "isArrive": 0, "time": "2020-06-06T22:52:36", "access": 0, "resident": null } ] } ``` ### 6、登出 ``` Post请求 /admin/logout ``` 参数 ``` 无 ``` 返回 ``` 无 logoutSuccessUrl为/admin/login ``` ### 7、腾讯防水墙 ``` Get /loginAuthen ``` 参数 ``` ticket(String):t02-QnlZCvsOId27bCXaQKiWmKAYAAvl9VhPK3lBd975MNNzqYVJDfAMInM7cCM3QUasDKyrJi4dHgZZ7NyBlMElCdJruYyCK_zuKE9b-v0C9A-kZQFJIer1Q** randstr(String):@d8y ``` 返回 ``` { "response": "1", "evil_level": "0", "err_msg": "OK" } { "response": "8", "evil_level": "0", "err_msg": "verify timeout" } ```