当前位置:网站首页>管理系統-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)
边栏推荐
- Go from introduction to practice - polymorphism (note)
- Bit. Store: long bear market, stable stacking products may become the main theme
- STM32F107+LAN8720A使用STM32cubeMX配置网络连接+tcp主从机+UDP app
- Analysis of stone merging
- Gbase 8A OLAP analysis function cume_ Example of dist
- [LeetCode]100. 相同的树
- 软件测试自动化测试之——接口测试从入门到精通,每天学习一点点
- 百万年薪独家专访,开发人员不修复bug怎么办?
- Tiktok's interest in e-commerce has hit the traffic ceiling?
- GBase 8a的create database 会被查询耗时很长怀疑卡住的现象分析
猜你喜欢

美团20k软件测试工程师的经验分享

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

使用Jmeter进行性能测试的这套步骤,涨薪2次,升职一次

∫(0→1) ln(1+x) / (x² + 1) dx

Go from introduction to actual combat - package (notes)

The create database of gbase 8A takes a long time to query and is suspected to be stuck

Go from introduction to practice - Interface (notes)

语言弱点列表--CWE,一个值得学习的网站

Simulink method for exporting FMU model files

Go from introduction to practice -- coordination mechanism (note)
随机推荐
Go from starting to Real - Interface (note)
微服务之远程调用
.NET学习笔记(五)----Lambda、Linq、匿名类(var)、扩展方法
Software defect management - a must for testers
根据自定义excel标题模板快速excel导出
[LeetCode]100. Same tree
Go from entry to practice - multiple selection and timeout control (notes)
Go从入门到实战——package(笔记)
[LeetCode]572. 另一棵树的子树
Go从入门到实战——任务的取消(笔记)
Bean paste green protects your eyes
正则表达式
年薪50W+的测试大鸟都在用这个:Jmeter 脚本开发之——扩展函数
Go从入门到实战——Context与任务取消(笔记)
Go from introduction to actual combat - all tasks completed (notes)
畅游动态规划之区间DP
管理系统-ITclub(下)
STM32CubeIDE1.9.0\STM32CubeMX 6.5 F429IGT6加LAN8720A,配置ETH+LWIP
快速excel导出
[LeetCode]30. Concatenate substrings of all words