-- MySQL dump 10.13 Distrib 8.0.40, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: blog
-- ------------------------------------------------------
-- Server version 8.0.40
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `administrators`
--
DROP TABLE IF EXISTS `administrators`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `administrators` (
`admin_id` int NOT NULL AUTO_INCREMENT,
`user_id` int NOT NULL,
PRIMARY KEY (`admin_id`),
UNIQUE KEY `user_id` (`user_id`),
CONSTRAINT `administrators_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `administrators`
--
LOCK TABLES `administrators` WRITE;
/*!40000 ALTER TABLE `administrators` DISABLE KEYS */;
/*!40000 ALTER TABLE `administrators` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `announcements`
--
DROP TABLE IF EXISTS `announcements`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `announcements` (
`announcement_id` int NOT NULL AUTO_INCREMENT,
`admin_id` int NOT NULL,
`title` varchar(255) NOT NULL,
`content` text NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`is_published` tinyint(1) DEFAULT '0',
PRIMARY KEY (`announcement_id`),
KEY `admin_id` (`admin_id`),
CONSTRAINT `announcements_ibfk_1` FOREIGN KEY (`admin_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `announcements`
--
LOCK TABLES `announcements` WRITE;
/*!40000 ALTER TABLE `announcements` DISABLE KEYS */;
INSERT INTO `announcements` VALUES (1,1,'公告1','Content of the first announcement.','2024-12-12 11:38:49','2024-12-28 00:09:37',1),(2,1,'公告2','Content of the second announcement.','2024-12-12 11:38:49','2024-12-28 00:09:37',1),(3,1,'公告3','Content of the twentieth announcement.','2024-12-12 11:38:49','2024-12-28 00:09:37',1);
/*!40000 ALTER TABLE `announcements` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `comments`
--
DROP TABLE IF EXISTS `comments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `comments` (
`comment_id` int NOT NULL AUTO_INCREMENT,
`post_id` int NOT NULL,
`user_id` int NOT NULL,
`content` varchar(1024) NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`is_deleted` tinyint(1) DEFAULT '0',
PRIMARY KEY (`comment_id`),
KEY `post_id` (`post_id`),
KEY `user_id` (`user_id`),
CONSTRAINT `comments_ibfk_1` FOREIGN KEY (`post_id`) REFERENCES `posts` (`post_id`) ON DELETE CASCADE,
CONSTRAINT `comments_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `comments`
--
LOCK TABLES `comments` WRITE;
/*!40000 ALTER TABLE `comments` DISABLE KEYS */;
INSERT INTO `comments` VALUES (1,9,1,'001','2024-12-27 13:35:21','2024-12-27 13:35:21',0),(2,9,1,'002','2024-12-27 13:35:21','2024-12-27 13:35:21',0),(3,37,4,'vue评论示例001','2024-12-27 14:57:50','2024-12-27 14:57:50',0),(11,52,4,'测试,时间为2024年12月29日21:46:29','2024-12-29 13:46:31','2024-12-29 13:46:31',0);
/*!40000 ALTER TABLE `comments` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `posts`
--
DROP TABLE IF EXISTS `posts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `posts` (
`post_id` int NOT NULL AUTO_INCREMENT,
`user_id` int NOT NULL,
`title` varchar(255) NOT NULL,
`content` longtext,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`priority` int DEFAULT '0',
PRIMARY KEY (`post_id`),
KEY `user_id` (`user_id`),
CONSTRAINT `posts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `posts`
--
LOCK TABLES `posts` WRITE;
/*!40000 ALTER TABLE `posts` DISABLE KEYS */;
INSERT INTO `posts` VALUES (9,2,'Third Post by User2','This is the content of the third post by user2. It is a detailed explanation of the topic.','2024-12-12 11:47:15','2024-12-12 11:47:15',0),(11,3,'Fourth Post by User2','This is the content of the fourth post by user2. It is a detailed explanation of the topic.','2024-12-12 11:47:15','2024-12-16 11:23:21',0),(12,1,'Fifth Post by User1','This is the content of the fifth post by user1. It is a detailed explanation of the topic.','2024-12-12 11:47:15','2024-12-12 11:47:15',0),(13,3,'Fifth Post by User2','This is the content of the fifth post by user2. It is a detailed explanation of the topic.','2024-12-12 11:47:15','2024-12-16 11:23:21',0),(14,3,'Sixth Post by User1','This is the content of the sixth post by user1. It is a detailed explanation of the topic.','2024-12-12 11:47:15','2024-12-16 11:23:21',0),(15,2,'Sixth Post by User2','This is the content of the sixth post by user2. It is a detailed explanation of the topic.','2024-12-12 11:47:15','2024-12-12 11:47:15',0),(16,1,'Seventh Post by User1','This is the content of the seventh post by user1. It is a detailed explanation of the topic.','2024-12-12 11:47:15','2024-12-12 11:47:15',0),(17,2,'Seventh Post by User2','This is the content of the seventh post by user2. It is a detailed explanation of the topic.','2024-12-12 11:47:15','2024-12-12 11:47:15',0),(18,1,'Eighth Post by User1','This is the content of the eighth post by user1. It is a detailed explanation of the topic.','2024-12-12 11:47:15','2024-12-12 11:47:15',0),(19,2,'Eighth Post by User2','This is the content of the eighth post by user2. It is a detailed explanation of the topic.','2024-12-12 11:47:15','2024-12-12 11:47:15',0),(20,1,'小20改','2024年12月17日12:56:12','2024-12-12 11:47:15','2024-12-17 04:57:08',0),(21,2,'Ninth Post by User2','This is the content of the ninth post by user2. It is a detailed explanation of the topic.','2024-12-12 11:47:15','2024-12-12 11:47:15',0),(22,1,'Tenth Post by User1','This is the content of the tenth post by user1. It is a detailed explanation of the topic.','2024-12-12 11:47:15','2024-12-12 11:47:15',0),(23,2,'Tenth Post by User2','This is the content of the tenth post by user2. It is a detailed explanation of the topic.','2024-12-12 11:47:15','2024-12-12 11:47:15',0),(25,1,'文章标题示例1','文章内容示例1','2024-12-13 16:36:32','2024-12-13 16:36:32',0),(26,4,'# 我的宠物','我有一只非常可爱的小狗,它的名字叫球球。球球全身毛茸茸的,颜色像雪一样白。它的眼睛又大又圆,每次看到我都会摇着尾巴欢迎我回家。\n\n球球最喜欢玩的游戏是“接飞盘”。每天放学后,我都会带它到公园去玩这个游戏。球球跑得非常快,总能准确地接住我扔出去的飞盘。我们玩得很开心,常常引来其他小朋友羡慕的目光。\n\n除了游戏,球球还是我的好伙伴。当我遇到困难或者心情不好时,它总是静静地坐在我身边,仿佛在安慰我。球球不仅是我最好的朋友,也是我家的一员。\n','2024-12-14 16:31:47','2024-12-14 16:31:47',0),(27,4,'我的理想','# 我的理想\n\n每个人都有自己的理想,而我的理想是成为一名医生。从小我就对医学充满了好奇,经常看一些关于人体构造的书籍,梦想着有一天能够帮助病人恢复健康。\n\n我知道要实现这个理想并不容易,需要学习很多知识,并且还要经过长时间的训练。但是我不怕困难,因为这是我真心想要做的事情。我会努力学习,争取考上一所好的医学院校,将来成为一名优秀的医生。\n\n我相信只要坚持不懈地努力,就一定可以实现自己的理想。我要用自己的双手去治愈更多的人,让他们重新获得健康的笑容。','2024-12-14 16:34:12','2024-12-14 16:34:12',0),(28,4,'美丽的校园','# 美丽的校园\n\n我们的学校坐落在一条宁静的小河边,周围环绕着青山绿水,环境十分优美。走进校园,首先映入眼帘的是宽阔的操场,那里是我们课间活动的好地方。操场上铺满了绿色的草坪,旁边还有几棵高大的松树,夏天的时候可以为我们遮挡阳光。\n\n沿着操场往前走,就是教学楼了。教学楼里有明亮的教室、整洁的走廊以及现代化的教学设备。在这里,我们不仅可以学到丰富的知识,还能参加各种有趣的课外活动。老师们也非常关心我们,总是耐心地解答我们的问题。\n\n每当清晨来临,整个校园都充满了生机与活力。同学们背着书包走进校园,脸上洋溢着灿烂的笑容。这就是我美丽的校园,一个充满希望与梦想的地方。','2024-12-14 16:34:12','2024-12-14 16:34:12',0),(29,4,'快乐的周末','# 快乐的周末\n\n每个周末都是我最期待的日子之一。周六早上,我会早早起床,穿上运动服,跟着爸爸妈妈一起去爬山。站在山顶上,望着远处连绵起伏的山脉,呼吸着新鲜空气,感觉整个人都变得神清气爽。\n\n下午回到家后,我们会一起做一顿丰盛的晚餐。爸爸负责炒菜,妈妈帮忙打下手,而我则在一旁观看并学习烹饪技巧。一家人围坐在一起享用美食,其乐融融。\n\n晚上则是属于我的自由时间。有时候我会看书,沉浸在精彩的故事中;有时候我会画画,用画笔记录下美好的瞬间。这样的周末既充实又快乐,让我感到无比幸福。','2024-12-14 16:34:12','2024-12-14 16:34:12',0),(35,4,'zxc','朝霞不出门\n','2024-12-17 04:26:59','2024-12-22 14:14:37',0),(36,4,'36','3621321','2024-12-17 04:57:55','2024-12-22 13:45:39',2),(37,4,'vue3','# 1. Vue3简介\n- 2020年9月18日,`Vue.js`发布版`3.0`版本,代号:`One Piece`(n\n- 经历了:[4800+次提交](https://github.com/vuejs/core/commits/main)、[40+个RFC](https://github.com/vuejs/rfcs/tree/master/active-rfcs)、[600+次PR](https://github.com/vuejs/vue-next/pulls?q=is%3Apr+is%3Amerged+-author%3Aapp%2Fdependabot-preview+)、[300+贡献者](https://github.com/vuejs/core/graphs/contributors)\n- 官方发版地址:[Release v3.0.0 One Piece · vuejs/core](https://github.com/vuejs/core/releases/tag/v3.0.0)\n- 截止2023年10月,最新的公开版本为:`3.3.4`\n\n \n\n## 1.1. 【性能的提升】\n\n- 打包大小减少`41%`。\n\n- 初次渲染快`55%`, 更新渲染快`133%`。\n\n- 内存减少`54%`。\n\n \n## 1.2.【 源码的升级】\n\n- 使用`Proxy`代替`defineProperty`实现响应式。\n\n- 重写虚拟`DOM`的实现和`Tree-Shaking`。\n\n \n## 1.3. 【拥抱TypeScript】\n\n- `Vue3`可以更好的支持`TypeScript`。\n\n \n## 1.4. 【新的特性】\n\n1. `Composition API`(组合`API`):\n - `setup`\n - `ref`与`reactive`\n - `computed`与`watch`\n \n ......\n \n2. 新的内置组件:\n - `Fragment`\n - `Teleport`\n - `Suspense`\n\n ......\n\n3. 其他改变:\n - 新的生命周期钩子\n - `data` 选项应始终被声明为一个函数\n - 移除`keyCode`支持作为` v-on` 的修饰符\n\n ......\n\n\n\n# 2. 创建Vue3工程\n\n## 2.1. 【基于 vue-cli 创建】\n点击查看[官方文档](https://cli.vuejs.org/zh/guide/creating-a-project.html#vue-create)\n\n> 备注:目前`vue-cli`已处于维护模式,官方推荐基于 `Vite` 创建项目。\n\n```powershell\n## 查看@vue/cli版本,确保@vue/cli版本在4.5.0以上\nvue --version\n\n## 安装或者升级你的@vue/cli \nnpm install -g @vue/cli\n\n## 执行创建命令\nvue create vue_test\n\n## 随后选择3.x\n## Choose a version of Vue.js that you want to start the project with (Use arrow keys)\n## > 3.x\n## 2.x\n\n## 启动\ncd vue_test\nnpm run serve\n```\n\n---\n\n## 2.2. 【基于 vite 创建】(推荐)\n`vite` 是新一代前端构建工具,官网地址:[https://vitejs.cn](https://vitejs.cn/),`vite`的优势如下:\n\n- 轻量快速的热重载(`HMR`),能实现极速的服务启动。\n- 对 `TypeScript`、`JSX`、`CSS` 等支持开箱即用。\n- 真正的按需编译,不再等待整个应用编译完成。\n- `webpack`构建 与 `vite`构建对比图如下:\n\n* 具体操作如下(点击查看[官方文档](https://cn.vuejs.org/guide/quick-start.html#creating-a-vue-application))\n\n```powershell\n## 1.创建命令\nnpm create vue@latest\n\n## 2.具体配置\n## 配置项目名称\n√ Project name: vue3_test\n## 是否添加TypeScript支持\n√ Add TypeScript? Yes\n## 是否添加JSX支持\n√ Add JSX Support? No\n## 是否添加路由环境\n√ Add Vue Router for Single Page Application development? No\n## 是否添加pinia环境\n√ Add Pinia for state management? No\n## 是否添加单元测试\n√ Add Vitest for Unit Testing? No\n## 是否添加端到端测试方案\n√ Add an End-to-End Testing Solution? » No\n## 是否添加ESLint语法检查\n√ Add ESLint for code quality? Yes\n## 是否添加Prettiert代码格式化\n√ Add Prettier for code formatting? No\n```\n自己动手编写一个App组件\n\n```vue\n\n