当前位置:网站首页>管理系统-ITclub(中)
管理系统-ITclub(中)
2022-06-27 19:37:00 【大眼(◉ɷ◉ )萌】
管理系统-ITclub(中)
作者:贤大蛋
目标:完成项目
描述:ITclub是一个程序员分享生活动态的平台
发布和修改动态内容
创建新的表moment
建表语句:
CREATE TABLE IF NOT EXISTS `moment`(
id INT PRIMARY KEY AUTO_INCREMENT,
content VARCHAR(1000) NOT NULL,
user_id INT NOT NULL,
createAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updateAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY(user_id) REFERENCES user(id)
);
定义发布动态内容的接口
1.定义路由接口
2. 验证用户登录
3. Controller和Service中处理内容
√完成发布动态接口(2022-5-27)
定义修改动态内容的接口
1. 定义路由接口
2. 验证用户登录(verifyAuth)
PS: 很多的内容都需要验证权限: 修改/删除动态,修改/删除评论
接口:业务接口系统/后端管理系统
- 一对多:user—>role
- 多对多:role—>menu(删除动态和修改动态)
3. 验证用户权限(verifyPermission)
4. Controller和Service中的处理
定义删除和查询动态内容
定义删除动态内容的接口
1. 定义路由接口
2. 验证用户登录和验证用户权限
见上面(verifyAuth)和(verifyPermission)
3. Controller和Service中的处理
定义查询内容的接口(单个)
定义查询多条内容的接口(列表)
更新:2022-5-30
发表和修改评论内容
创建新的表comment
CREATE TABLE IF NOT EXISTS `comment`(
id INT PRIMARY KEY AUTO_INCREMENT,
content VARCHAR(1000) NOT NULL,
moment_id INT NOT NULL,
user_id INT NOT NULL,
comment_id INT DEFAULT NULL,
createAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updateAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
FOREIGN KEY(moment_id) REFERENCES moment(id) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY(user_id) REFERENCES user(id) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY(comment_id) REFERENCES comment(id) ON DELETE CASCADE ON UPDATE CASCADE
);
定义发布评论内容接口
1. 定义路由接口–>验证用户登录
2. Controller和Service中处理内容
定义修改评论内容接口
1. 定义理由接口
2. 验证用户登录(更新verifyPermission)
见上面(verifyAuth)
3. 验证用户权限
PS:这里原本是封装了verifyPermission中间件,现在稍作更改
定义更为符合RESTful风格的接口代码
4. Controller和Service中处理内容
定义回复评论内容接口
1. 定义路由接口
2. 验证用户登录
见上面(verifyAuth)
3. Controller和Service中处理内容
删除和查询评论内容
定义删除评论内容接口
1. 定义路由接口
2. 验证用户登录和验证用户权限
3. Controller和Service中处理内容
查询动态时,同时显示评论信息
1. 查询多个动态时,显示评论的个数
2. 查询单个动态时,显示评论的列表
√完成动态和评论接口(2022-05-31)
PS:往后文章继续(下)
边栏推荐
- What is the core competitiveness of front-line R & D personnel aged 35~40 in this position?
- AQS SOS AQS with me
- Go从入门到实战——仅执行一次(笔记)
- Go from introduction to actual combat - task cancellation (note)
- How to design an elegant caching function
- Go from introduction to actual combat - package (notes)
- 豆沙绿保护你的双眼
- xpath
- 快速excel导出
- Special training of guessing game
猜你喜欢
Go从入门到实战——接口(笔记)
Go从入门到实战——Panic和recover(笔记)
Go从入门到实战——任务的取消(笔记)
管理系统-ITclub(下)
百万年薪独家专访,开发人员不修复bug怎么办?
. Net learning notes (V) -- lambda, LINQ, anonymous class (VaR), extension method
Go from starting to Real - Interface (note)
Interval DP of Changyou dynamic programming
Special training of guessing game
[LeetCode]动态规划解分割数组II[Arctic Fox]
随机推荐
Process control task
鲜为人知的mysql导入数据
How to delete "know this picture" on win11 desktop
Go from introduction to actual combat - task cancellation (note)
TreeSet details
Go from starting to Real - Interface (note)
Test automatique de Test logiciel - test d'interface de l'introduction à la maîtrise, apprendre un peu chaque jour
Go from introduction to actual combat - context and task cancellation (notes)
Bean paste green protects your eyes
Set code exercise
.NET学习笔记(五)----Lambda、Linq、匿名类(var)、扩展方法
STM32CubeIDE1.9.0\STM32CubeMX 6.5 F429IGT6加LAN8720A,配置ETH+LWIP
哈希表-数组之和
[LeetCode]508. 出現次數最多的子樹元素和
I think I should start writing my own blog.
我想我要开始写我自己的博客了。
STM32F107+LAN8720A使用STM32cubeMX配置网络连接+tcp主从机+UDP app
Go from introduction to actual combat - all tasks completed (notes)
[LeetCode]100. 相同的树
Open source technology exchange - Introduction to Chengying, a one-stop fully automated operation and maintenance manager