All Projects → iHealth-ecnu → Ihealth_site

iHealth-ecnu / Ihealth_site

Licence: gpl-2.0
iHealth 项目的后台程序(一个基于 Django 和 MongoDB 的 Web 后端)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Ihealth site

Django Microservices
UNMAINTAINED
Stars: ✭ 124 (+327.59%)
Mutual labels:  mongodb, django
Djongo
Django and MongoDB database connector
Stars: ✭ 1,222 (+4113.79%)
Mutual labels:  mongodb, django
Django Rest Framework Mongoengine
Mongoengine support for Django Rest Framework
Stars: ✭ 544 (+1775.86%)
Mutual labels:  mongodb, django
Distributed Multi User Scrapy System With A Web Ui
Django based application that allows creating, deploying and running Scrapy spiders in a distributed manner
Stars: ✭ 88 (+203.45%)
Mutual labels:  mongodb, django
Mayblog
Yet another django based blog created in May 2015
Stars: ✭ 171 (+489.66%)
Mutual labels:  mongodb, django
Django Dbbackup
Management commands to help backup and restore your project database and media files
Stars: ✭ 471 (+1524.14%)
Mutual labels:  mongodb, django
Python Spider
豆瓣电影top250、斗鱼爬取json数据以及爬取美女图片、淘宝、有缘、CrawlSpider爬取红娘网相亲人的部分基本信息以及红娘网分布式爬取和存储redis、爬虫小demo、Selenium、爬取多点、django开发接口、爬取有缘网信息、模拟知乎登录、模拟github登录、模拟图虫网登录、爬取多点商城整站数据、爬取微信公众号历史文章、爬取微信群或者微信好友分享的文章、itchat监听指定微信公众号分享的文章
Stars: ✭ 615 (+2020.69%)
Mutual labels:  mongodb, django
Media Hub
A Django based Web app that allows users to access information about movies present in their computer even when offline(Initial Setup requires Internet)
Stars: ✭ 20 (-31.03%)
Mutual labels:  django
Project16 B Account Book
👥👤👥뭐야..👤👥👥👤👥👤 이거쓰면 부자된다고..?👥👤👥👤👤👥👥 웅성웅성..👤👥👤👥👤궁금하다..👥👥👤👥
Stars: ✭ 28 (-3.45%)
Mutual labels:  mongodb
E Commerce 2 django
Guest register, user register, user login, user logout, account home page, product view history, change password, reset password, change name, send activation email when register, resend activation email, add shipping address, add billing address, add nickname to the addresses, edit shipping address, edit billing address, view list of your addresses, reuse shipping addresses when order products, reuse billing addresses when ordeer products, show sales analytics if staff or admin only using -chart.js-, get analytics data with Ajax, receive marketing email, change if user will receive marketing email or not by admin, send contact message with Ajax, products list, product detail, download product detail as a PDF file, download digital product files -if the user purchased that digital product only-, orders list, list of digital products files, order detail, download order detail as a PDF file, verify order ownership with Ajax -to secure order detail page-, show cart products, add or remove product from cart, checkout page, thanks page when order placed successfully, add or reuse payment method, add or reuse payment method with Ajax, search products by title, search products by description, search products by price, search products by tag title, write tags for products -by admin only-, auto fill contact email, full name if user logged in.
Stars: ✭ 20 (-31.03%)
Mutual labels:  django
Celeryproject
The official Celery Project website
Stars: ✭ 15 (-48.28%)
Mutual labels:  django
Seven23 server
Fully manual budget app to track your expenses. Opensource, with privacy by design.
Stars: ✭ 20 (-31.03%)
Mutual labels:  django
Book Code
《Django开发从入门到实战》书籍各章节源代码
Stars: ✭ 28 (-3.45%)
Mutual labels:  django
Shopify Mern Boilerplate
A Boilerplate for creating MERN stack Shopify app.
Stars: ✭ 20 (-31.03%)
Mutual labels:  mongodb
P2p
一个基于 python 的 flask 框架的资讯网站, http://119.29.100.53:8086/
Stars: ✭ 28 (-3.45%)
Mutual labels:  mongodb
Django Login Required Middleware
Requires login to all requests through middleware.
Stars: ✭ 20 (-31.03%)
Mutual labels:  django
Placementmnit
Official Placement Portal : MNIT Jaipur
Stars: ✭ 29 (+0%)
Mutual labels:  mongodb
Django Spectator
A Django app to track book reading, and event going.
Stars: ✭ 28 (-3.45%)
Mutual labels:  django
Django Cloud Tasks
Integrate Google Cloud Tasks with Django
Stars: ✭ 27 (-6.9%)
Mutual labels:  django
Sentry
Sentry is cross-platform application monitoring, with a focus on error reporting.
Stars: ✭ 29,700 (+102313.79%)
Mutual labels:  django

iHealth-site

iHealth 项目的后台程序

依赖

  • Django==1.8.17
  • pymongo==3.4.0
  • uWSGI==2.0.15

启动项目

  1. 本地启动(windows):
python manage.py runserver 0.0.0.0:8000
  1. 打开浏览器访问 http://127.0.0.1:8000/
    出现 Hello, I am iHealth ' backend! 表示启动成功

  2. 测试其它接口
    获取文章列表:http://127.0.0.1:8000/api/v1/articlelist
    获取文章详情:http://127.0.0.1:8000/api/v1/articledetail?id=59eefad4e6c80c707840adc2

TODO

  • [x] 【接口】获取文章首页列表
  • [x] 【接口】获取文章详情
  • [x] 【接口】用户登陆验证
  • [x] 【接口】模糊匹配指定用户名,返回符合的用户列表
  • [x] 【接口】获取用户详情
  • [x] 【接口】用户注册
  • [x] 【接口】根据 id 批量请求用户信息
  • [x] 【接口】点赞数更新
  • [x] 【接口】推荐列表 个性化推荐文章
  • [ ] 【接口】获取用户个人病历
  • [ ] 【接口】获取某用户的主治医生信息
  • [x] 【接口】个人信息的修改
  • [x] 【接口】医生为病人添加病历

接口说明

API 接口采用 RESTful 规范设计

什么是 RESTful 请看:怎样用通俗的语言解释REST,以及RESTful? - 知乎


  • 获取首页文章列表

示例:http://ihealth.yangyingming.com/api/v1/articlelist?page=1&limit=10&userID=5a02e30be6c80c1c9ecdaea7&cate=recommend

请求方式:GET

参数 默认值 说明
page 1 取第几页的数据
limit 10 一次取多少个
userID None 用户ID,个性化推荐用
cate None 首页文章分类,'recommend'为推荐

  • 获取文章详情

示例:http://ihealth.yangyingming.com/api/v1/articledetail?id=59eefad4e6c80c707840adc2&userID=5a02e30be6c80c1c9ecdaea7

请求方式:GET

参数 默认值 说明
id None 取指定id的文章详情
userID None 用户ID,个性化推荐用

  • 点赞接口

示例:http://ihealth.yangyingming.com/api/v1/updateUpvote?id=59eefad4e6c80c707840adc2&userID=5a02e30be6c80c1c9ecdaea7

请求方式:GET

参数 默认值 说明
id None 取指定id的文章详情
userID None 用户ID,个性化推荐用

  • 用户登陆验证

示例:http://ihealth.yangyingming.com/api/v1/usercheck

请求方式:POST

参数 默认值 说明
email None 待验证用户的邮箱
password None 待验证用户的密码

  • 模糊匹配指定用户名,返回符合的用户列表

示例:http://ihealth.yangyingming.com/api/v1/userlist?name=小明

请求方式:GET

参数 默认值 说明
name '' 模糊匹配条件
selfname '' 需要排除的name值
limit 10 最多匹配多少条结果

  • 获取用户详情

示例:http://ihealth.yangyingming.com/api/v1/user?id=59fb1595dfdeee2b4c26c346

请求方式:GET

参数 默认值 说明
id None 用户id

  • 用户注册

示例:http://ihealth.yangyingming.com/api/v1/reguser

请求方式:POST

参数 默认值 说明
email None 注册邮箱
password None 密码
nickname None 用户昵称
name None 用户真实姓名
sex None 性别 0:女 1:男
usertype None 用户类别 0:游客 1:患者 2:医生 3:管理员
birthday None 用户出生日期
introduction None 个人介绍
age None 用户年龄
phone None 注册手机号

  • 根据ID批量获取用户信息

示例:http://ihealth.yangyingming.com/api/v1/userlistbyid?id=59fb1595dfdeee2b4c26c347,59fb1595dfdeee2b4c26c348

请求方式:GET

参数 默认值 说明
id None 要获取的用户id,可以是多个

  • 修改昵称

示例:http://ihealth.yangyingming.com/api/v1/changeNickname

请求方式:POST

参数 默认值 说明
id None 要修改昵称的用户id
newName None 修改后的昵称

  • 修改手机号

示例:http://ihealth.yangyingming.com/api/v1/changePhone

请求方式:POST

参数 默认值 说明
id None 要修改手机号的用户id
newPhone None 修改后的手机号

  • 修改姓名

示例:http://ihealth.yangyingming.com/api/v1/changeName

请求方式:POST

参数 默认值 说明
id None 要修改姓名的用户id
newName None 修改后的姓名

  • 修改性别

示例:http://ihealth.yangyingming.com/api/v1/changeSex

请求方式:POST

参数 默认值 说明
id None 要修改性别的用户id
newSex None 修改后的性别

  • 修改密码

示例:http://ihealth.yangyingming.com/api/v1/changePassword

请求方式:POST

参数 默认值 说明
id None 要修改密码的用户id
oldPassword None 原密码
newPassword None 新密码

  • 修改出生日期

示例:http://ihealth.yangyingming.com/api/v1/changeBirthday

请求方式:POST

参数 默认值 说明
id None 要修改出生日期的用户id
newBirthday None 新的出生日期

  • 添加病历

示例:http://ihealth.yangyingming.com/api/v1/addMedicalRecord

请求方式:POST

参数 默认值 说明
id None 要添加病历的用户id
date None 添加病历的日期
doctor None 添加病历的主治医生
content None 病历内容

Django 搭建笔记(笔记部分,和项目无关)

  1. 创建项目目录
django-admin startproject iHealth_site
  1. 运行自带服务器进行测试
python manage.py runserver 0.0.0.0:8000

注意:想要外网访问需要在 settings.py 的 ALLOWED_HOSTS = ['*']

  1. 创建app目录
python manage.py startapp mysite

MongoDB 配置

  1. 开启 MongoDB 权限认证:在配置文件中加入 auth = true

  2. 创建管理员用户(如果你是第一次使用 MongoDB)

use admin
db.createUser({user:"admin",pwd:"admin123",roles:["userAdminAnyDatabase"]})

管理员用户用来创建其他数据库和用户

  1. 使用管理员账户远程登录
C:\Users\cs>mongo [your_ip]:27017
> use admin
switched to db admin
> db.auth('admin','admin123')
1
  1. 创建 iHealth 数据库,以及操作该数据库的用户
use iHealth         // 创建 iHealth 数据库,并作为认证数据库
db.createUser({
    user:'admin',   // 用户名
    pwd:'admin123', // 用户密码
    roles:[{role:'readWrite',db:'iHealth'}]     // 为该用户赋予数据库的读写权限
})
  1. 使用该用户远程登录 iHealth 数据库
C:\Users\cs>mongo [your_ip]:27017
> use iHealth
switched to db iHealth
> db.auth('admin','admin123')
1
> db.getCollectionNames()
[ ]

数据库刚刚创建,所以没有数据

参考资料

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].