# kill-virus-server **Repository Path**: ice-cream-th/kill-virus-server ## Basic Information - **Project Name**: kill-virus-server - **Description**: 为kill-coronavirus提供后台支持 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-04-21 - **Last Updated**: 2021-05-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 进行中 #### 疫情防控项目的后台支持 技术栈:ECMAScript\nodejs\express脚手架\mysql 本readme只展示数据表的设计、接口的设计和调用方式,不展示具体的实现细节 #### 目录结构 controller(放js文件,数据库的每一张表都对应一个js文件,该js文件中是所有操作该表的函数) public(可以放置网页所需资源,该网页用于描述该服务器的接口、开发细节等任何想展示给用户的信息) routes(因为接口个数较少层次分明,因此一律写在routes文件夹中) util(里面放置一些工具方法) app.js(入口文件,可导入可用的资源、中间件) #### 数据表 user_info(id_type, id, name, city_area, tele, password, regist_time, mail, gender, age) member_info(id, m_id, m_id_type, m_tele, relationship, m_name) appointment(id, name, test_area, test_place, date, time, state) result(id, name, sample_datetime, test_place, type, company, result_datetime, method, result) #### 接口 ##### 注册时调用,往user_info里添加一条记录 ``` url: http://localhost:3000/regist data: id_type, id, name, city_area, tele, password全是String response: status 200 ok ``` ##### 根据电话和密码查询用户 ``` url: http://localhost:3000/getuserinfo data: tele->String password->String response: user_info表中的除了密码外的一条记录->Object ``` ##### 登陆过后可以修改密码 ``` url: http://localhost:3000/changepassword data: id,password,newpassword response: status 200 ok ``` ##### 添加家人信息 ``` url: http://localhost:3000/addfamilymember data: id, m_id_type, m_id, m_tele, relationship, m_name response: status 200 ok ``` ##### 获取家人信息 ``` url: http://localhost:3000/getfamilymember data: id response: status 200 ok ``` ##### 新增预约 在appointment表中加入记录的同时往result中加入记录 ``` url: http://localhost:3000/setappointment date: id, name, test_area, test_place, date, time, state response: status 200 ok ``` ##### 获取预约信息 ``` url: http://localhost:3000/getappointment date: id test_place response: status 200 ok ``` ##### 更新采样状态 appointment更新采样状态的同时,修改result中对应记录的sample_datetime和样本类型type ``` url: http://localhost:3000/updateappointment date: id, test_place response: status 200 ok ``` ##### 完成检测报告 该接口不是给前端调用的,而是给后台管理系统使用 ``` url: http://localhost:3000/completeresult date: id, test_place, company, method, result response: status 200 ok ``` ##### 获取检测结果 同一个人只能在同一个检测点预约一次 因此同一个人在同一个检测点的检测结果也只有一个 ``` url: http://localhost:3000/getresult data: id, test_place response: status 200 ok result表中的一条记录 ```