当前位置:网站首页>管理系统-ITclub(下)
管理系统-ITclub(下)
2022-06-27 19:37:00 【大眼(◉ɷ◉ )萌】
管理系统-ITclub(下)
作者:贤大蛋
目标:完成项目
描述:ITclub是一个程序员分享生活动态的平台
文章目录
标签接口开发
思路:一个动态可以有多个标签,一个标签也可以对应多个动态
创建标签表
CREATE TABLE IF NOT EXISTS `label`(
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(10) NOT NULL UNIQUE,
createAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updateAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
定义创建标签接口
1. 路由配置Router

2. 验证用户登录
中间件(verifyAuthor)
3. 创建标签


创建标签和动态关系表
CREATE TABLE IF NOT EXISTS `moment_label`(
moment_id INT NOT NULL,
label_id INT NOT NULL,
createAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updateAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY(moment_id, label_id),
FOREIGN KEY (moment_id) REFERENCES moment(id) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (label_id) REFERENCES label(id) ON DELETE CASCADE ON UPDATE CASCADE
);
定义给动态添加标签接口
1. 给动态添加新的接口



2. 给动态内容绑定标签


查询标签接口
查询动态列表,展示标签数量

查询动态详情,展示标签列表

上传图片
上传头像逻辑
需求:图片(文件)上传 /upload/avatar
目的:服务器可以保存一张图片
解决:提供一个接口,可以让用户获取图片—>将URL存储到用户信息中—> 获取信息时,获取用户头像
1. 定义上传头像接口



2. 定义获取图像接口


3. 请求用户信息时,获取头像

上传动态配图
1. 定义上传动态配图接口

2. 定义获取动态配图的接口


3. 获取动态时,获取配图信息

添加:处理图片大小



项目完结(2022-6-3)
边栏推荐
- .NET学习笔记(五)----Lambda、Linq、匿名类(var)、扩展方法
- Common problems encountered by burp Suite
- [leetcode] dynamic programming solution partition array ii[arctic fox]
- [LeetCode]572. A subtree of another tree
- 【Redis】零基础十分钟学会Redis
- 洛谷P5706 再分肥宅水
- win11桌面出现“了解此图片”如何删除
- 图解基于AQS队列实现的CountDownLatch和CyclicBarrier
- 根据自定义excel标题模板快速excel导出
- Go 访问GBase 8a 数据库的一个方法
猜你喜欢

Simulink导出FMU模型文件方法

Go从入门到实战——channel的关闭和广播(笔记)

MYSQL和MongoDB的分析

STM32F107+LAN8720A使用STM32cubeMX配置网络连接+tcp主从机+UDP app

Express e stack - small items in array

Set code exercise

Go from introduction to actual combat -- channel closing and broadcasting (notes)

STM32CubeIDE1.9.0\STM32CubeMX 6.5 F429IGT6加LAN8720A,配置ETH+LWIP
![[leetcode] dynamic programming solution partition array i[red fox]](/img/b2/df87c3138c28e83a8a58f80b2938b8.png)
[leetcode] dynamic programming solution partition array i[red fox]

Bit. Store: long bear market, stable stacking products may become the main theme
随机推荐
Example of using gbase 8A OLAP function group by grouping sets
Bean paste green protects your eyes
Test automatique de Test logiciel - test d'interface de l'introduction à la maîtrise, apprendre un peu chaque jour
The create database of gbase 8A takes a long time to query and is suspected to be stuck
Go from starting to Real - Interface (note)
Go from entry to practice - multiple selection and timeout control (notes)
Matlab finds the position of a row or column in the matrix
Go从入门到实战——协程机制(笔记)
GBase 8a V8版本节点替换期间通过并发数控制资源使用减少对系统影响的方法
微服务之远程调用
. Net learning notes (V) -- lambda, LINQ, anonymous class (VaR), extension method
猜拳游戏专题训练
使用Jmeter进行性能测试的这套步骤,涨薪2次,升职一次
如何做好功能测试?你确定不想知道吗?
Xiao Wang's interview training task
神奇的POI读取excel模板文件报错
C语言程序设计详细版 (学习笔记1) 看完不懂,我也没办法。
[LeetCode]513. 找树左下角的值
Go从入门到实战——仅执行一次(笔记)
Go from introduction to actual combat - panic and recover (notes)