当前位置:网站首页>管理系統-ITclub(下)
管理系統-ITclub(下)
2022-06-27 21:59: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)
边栏推荐
- Have time to look at ognl expressions
- Express e stack - small items in array
- Slow bear market, bit Store provides stable stacking products to help you cross the bull and bear
- Open source technology exchange - Introduction to Chengying, a one-stop fully automated operation and maintenance manager
- matlab查找某一行或者某一列在矩阵中的位置
- [LeetCode]508. 出現次數最多的子樹元素和
- 清华大学教授:软件测试已经走入一个误区——“非代码不可”
- . Net learning notes (V) -- lambda, LINQ, anonymous class (VaR), extension method
- AI painting minimalist tutorial
- Simulink导出FMU模型文件方法
猜你喜欢

Simulink method for exporting FMU model files

Go from introduction to actual combat - package (notes)

VMware virtual machine PE startup
![[LeetCode]动态规划解分割数组I[Red Fox]](/img/b2/df87c3138c28e83a8a58f80b2938b8.png)
[LeetCode]动态规划解分割数组I[Red Fox]

Common problems encountered by burp Suite

vmware虚拟机PE启动

Go从入门到实战——共享内存并发机制(笔记)

Stm32f107+lan8720a use stm32subemx to configure network connection +tcp master-slave +udp app

Special training of guessing game

C语言程序设计详细版 (学习笔记1) 看完不懂,我也没办法。
随机推荐
[LeetCode]515. Find the maximum value in each tree row
Set code exercise
[LeetCode]508. 出现次数最多的子树元素和
win11桌面出现“了解此图片”如何删除
VMware virtual machine PE startup
Analysis of stone merging
[leetcode] dynamic programming solution partition array ii[arctic fox]
语言弱点列表--CWE,一个值得学习的网站
Little known MySQL import data
C language programming detailed version (learning note 1) I can't understand it after reading, and I can't help it.
[leetcode] dynamic programming solution split integer i[silver fox]
At 19:00 on Tuesday evening, the 8th live broadcast of battle code Pioneer - how to participate in openharmony's open source contribution in multiple directions
根据自定义excel标题模板快速excel导出
Dynamic refresh mapper
Slow bear market, bit Store provides stable stacking products to help you cross the bull and bear
美团20k软件测试工程师的经验分享
[LeetCode]186. 翻转字符串里的单词 II
[LeetCode]513. 找树左下角的值
Go from introduction to actual combat -- channel closing and broadcasting (notes)
Bit.Store:熊市漫漫,稳定Staking产品或成主旋律