基于Python+flask+node.js+Mysql的书籍影视交流平台(类似豆瓣)

目 录
一、引言 1
1.1 编写目的 1
1.2 命名规范 1
1.3 参考资料 1
1.4 相关文档 1
1.5 涉及名词解释 1
1.6 版本更新记录 2
二、整体设计 2
2.1 运行环境 2
2.3 子系统清单 3
2.4 功能模块清单 3
三、数据库设计 5
四、系统功能使用设计 10
五、功能模块设计 19
六、存储过程设计 25
七、接口设计 29
7.1 用户接口 29
7.2 外部接口 29
7.3 内部接口 29
八、角色授权设计 30
九、系统错误处理 30
9.1 出错信息管理 30
9.2 故障预防与补救 30
9.3 系统维护设计 31
9.3.1 编码规范化 31
9.3.2 编码模块化 31
9.3.3 始终收集反馈 31
9.3.4错误日志 31
十、项目测试计划 31
二、整体设计

2.1 运行环境
使用Windows系统进行开发,开发环境如下:
操作系统:Windows 10 + Ubuntu 16.04
数据库系统:MySQL
IDE:Visual Studio Code
测试工具:Google Chrome
编码方式:UTF-8
运行环境如下:
操作系统:Windows、Android
运行后端:Flask
运行前端:Vue.js
浏览器:IE9及以上

2.3 子系统清单
本项目的子系统设置如下表2-1 子系统清单列表所示。
表2-1 子系统清单列表
编号 名称 子系统功能描述
1 账户管理系统 个人管理信息以及注册登录
2 后台管理系统 管理员管理用户和信息
3 影视书籍系统 内容展示、评论、赞、踩和举报
4 话题系统 用户参与话题以及发表相关内容
5 小组系统 用户参与小组发表帖子,小组管理员管理帖子

2.4 功能模块清单
本项目的功能模块清单见表2-2 功能模块清单列表即可
表2-2 功能模块清单列表
模块编号 名称 模块功能描述
101 注册 游客注册为正式用户
102 登录 已注册用户登录系统
103 找回密码 已注册用户丢失密码后,通过审核找回密码
104 查看个人信息 管理员或者已注册用户查看个人信息
105 修改个人信息 已注册用户登陆之后对资料进行管理
106 删除用户 管理员删除不合法用户
201 浏览内容 游客或者用户浏览网站内容
202 检索内容 游客或者用户检索网站内容
203 评论书籍 用户对书籍进行打分和评论
204 评论影视 用户对影视进行打分和评论
205 点赞评论 用户对书籍影视评论进行点赞
206 反对评论 用户对书籍影视评论表示反对
207 举报评论 用户举报书籍影视评论
301 浏览内容 游客或者用户浏览话题内容
302 检索内容 游客或者用户及检索话题内容
303 参与话题 用户成为某一个话题的参与者
304 创建话题 用户创建了一个新的话题
305 发表图文 用户在某一个话题下发表相关言论和图片
401 检索内容 用户检索小组相关的内容
402 浏览内容 用户浏览小组相关的内容
403 创建小组 用户创建了一个新的小组
404 参与小组 用户成为了某一个小组的参与者
405 发表帖子 用户在某一个小组中发表了帖子
406 置顶帖子 小组管理员置顶了一个帖子
407 加精帖子 小组管理员将某一个帖子设为精华帖
408 删除帖子 小组管理员删除了一个非法的帖子

#!/usr/bin/env python
# -*- coding:utf-8 -*-
from requests import post, get, put, delete


# Register
post('http://182.92.57.178:5000/register', data={'name': 'yzy', 'password': 'yzy123456',
                                             'email': '123@qq.com', 'phonenum': '123456789', 'motto': 'balabalabala'}).json()

# Login
post('http://localhost:5000/login',
     data={'name': 'yzy', 'password': 'yzy123456'}).json()

token = post('http://localhost:5000/login',
             data={'name': 'yzy', 'password': 'yzy123456'}).json()['result']['token']
# 添加 token到头
headers = {"User-Agent": "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.6) ",
           "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
           "Accept-Language": "en-us",
           "Connection": "keep-alive",
           "Accept-Charset": "GB2312,utf-8;q=0.7,*;q=0.7",
           "token": token}
# get测试
get('http://localhost:5000/movies/1').json()
get('http://127.0.0.1:5000/search/group_contents?keywords=testtesttest').json()
get('http://localhost:5000/users/book_approvals',headers = headers).json()
# post测试
# 下面我是用 postman测试的,token需要加在 header里
# ModifyPassword + token
post('http://localhost:5000/modify/passwd',
     data={'old_password': 'yzy123456', 'new_password': 'yzygod'}, headers=headers).json()

# Book_Comment + token
post('http://localhost:5000/books/1/comments',
     data={'book_comment_content': 'yzygoddddddddddddddddddddddddd', 'book_comment_title': 'yzygodd'}, headers=headers).json()

# Book_Score + token
post('http://localhost:5000/books/1/scores',
     data={'book_score': '9.0'}, headers=headers).json()

# Comment_Approve
post('http://localhost:5000/book_comments/6/approve',
     data={'type': 1}, headers=headers).json()
delete('http://localhost:5000/movie_comments/1/approve',headers = headers).json()

# Movie_Comment + token
post('http://localhost:5000/movies/1/comments',
     data={'movie_comment_content': 'test', 'movie_comment_title': 'test'}, headers=headers).json()

# Movie_Score + token
post('http://localhost:5000/movies/1/scores',
     data={'movie_score': '9.0'}, headers=headers).json()

# AddUserToGroup + token
post('http://localhost:5000/groups/1/join', headers=headers).json()

# AddUserToTopic + token
post('http://localhost:5000/topicss/1/join', headers=headers).json()
post('http://localhost:5000/topics/1/join', headers=headers).json()

# Add Group Content + token
post('http://localhost:5000/groups/1/add_content',
     data={'group_content_title': 'test123', 'group_content_content': 'testtesttest123', 'group_content_image': '/example'}, headers=headers).json()
# 删除,加精,置顶
post('http://localhost:5000/groups/delete_content/3', headers=headers).json()
post('http://localhost:5000/groups/highlighted_content/5', headers=headers).json()
post('http://localhost:5000/groups/pinned_content/5', headers=headers).json()
post('http://localhost:5000/groups/2/apply_manager',data={'group_apply_content': 'test'},headers=headers).json()

# Add Topic Content + token
post('http://localhost:5000/topics/1/add_content',
     data={'topic_content_content': 'testtesttest'}, headers=headers).json()

# Send_email
post('http://localhost:5000/users/reset_password/send_email', data={'user_email': '394739138@qq.com'}
     ).json()

# Reset_password + token
post('http://localhost:5000/users/reset_password',
     data={'new_password': 'zhk12345678'}, headers=headers).json()

# Book_comment_report + token
post('http://localhost:5000/report/books/1', data={'book_report_title': 'yzygod', 'book_report_reason':
                                                   'yzygoddddddddddddd'}, headers=headers).json()

# Movie_comment_report + token
post('http://localhost:5000/report/movies/1', data={'movie_report_title': 'yzygod', 'movie_report_reason':
                                                    'yzygoddddddddddddd'}, headers=headers).json()

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

shejizuopin

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值