从零搭建个人资讯系统1
生活随笔
收集整理的這篇文章主要介紹了
从零搭建个人资讯系统1
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
1.設(shè)計表
SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0;-- ---------------------------- -- Table structure for taimi_blog -- ---------------------------- DROP TABLE IF EXISTS `taimi_blog`; CREATE TABLE `taimi_blog` (`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '內(nèi)容ID',`title` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '標(biāo)題',`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '內(nèi)容',`category_id` int(11) NULL DEFAULT NULL COMMENT '分類ID',`category_title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '分類的標(biāo)題',`img` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '封面地址(oss文件存儲)',`user_id` int(11) NULL DEFAULT NULL COMMENT '用戶ID',`create_time` datetime(0) NULL DEFAULT NULL COMMENT '創(chuàng)建時間',`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新時間',`status` int(1) NULL DEFAULT NULL COMMENT '控制內(nèi)容是否在前臺進(jìn)行展示 0 不展示 1展示',`is_delete` int(1) NULL DEFAULT NULL COMMENT '邏輯刪除 0 未刪除 1刪除',PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;-- ---------------------------- -- Records of taimi_blog -- ------------------------------ ---------------------------- -- Table structure for taimi_blog_category -- ---------------------------- DROP TABLE IF EXISTS `taimi_blog_category`; CREATE TABLE `taimi_blog_category` (`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '分類ID',`category_title` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '分類標(biāo)題',`create_time` datetime(0) NULL DEFAULT NULL COMMENT '創(chuàng)建時間',`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新時間',`status` int(1) NULL DEFAULT NULL COMMENT '發(fā)布0未發(fā)1發(fā)布 用于控制前臺的顯示問題',`sorted` int(11) NULL DEFAULT NULL COMMENT '排序字段,控制前臺顯示的順序,用升序',PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;-- ---------------------------- -- Records of taimi_blog_category -- ------------------------------ ---------------------------- -- Table structure for taimi_favorite -- ---------------------------- DROP TABLE IF EXISTS `taimi_favorite`; CREATE TABLE `taimi_favorite` (`id` int(11) NOT NULL AUTO_INCREMENT COMMENT ' 收藏夾的ID',`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '收藏夾的標(biāo)題',`link` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '收藏夾的連接',`create_time` datetime(0) NULL DEFAULT NULL COMMENT '創(chuàng)建時間',`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新時間',`status` int(1) NULL DEFAULT NULL COMMENT '發(fā)布0未發(fā)布 1發(fā)布',`user_id` int(11) NULL DEFAULT NULL COMMENT '添加用戶',PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;-- ---------------------------- -- Records of taimi_favorite -- ------------------------------ ---------------------------- -- Table structure for taimi_params -- ---------------------------- DROP TABLE IF EXISTS `taimi_params`; CREATE TABLE `taimi_params` (`id` int(11) NOT NULL COMMENT '參數(shù)ID',`logo` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '控制網(wǎng)站的logo',`skin` varbinary(10) NULL DEFAULT NULL COMMENT '網(wǎng)站換膚 black ,white',`footer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '底部信息',PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;-- ---------------------------- -- Records of taimi_params -- ------------------------------ ---------------------------- -- Table structure for taimi_user -- ---------------------------- DROP TABLE IF EXISTS `taimi_user`; CREATE TABLE `taimi_user` (`id` int(11) NOT NULL COMMENT '用戶id',`nickname` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用戶昵稱',`password` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用戶密碼',`telephone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用戶手機(jī)(用于登錄)',`email` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用戶郵箱',`avatar` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用戶頭像的地址',`sign` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用戶簽名',`create_time` datetime(0) NULL DEFAULT NULL COMMENT '創(chuàng)建時間',`update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新時間',`active` int(1) NULL DEFAULT NULL COMMENT '1激活 0未激活',`role` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'admin是超級管理員 nornal是普通用戶',PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;-- ---------------------------- -- Records of taimi_user -- ------------------------------ ---------------------------- -- Table structure for taimi_user_blog -- ---------------------------- DROP TABLE IF EXISTS `taimi_user_blog`; CREATE TABLE `taimi_user_blog` (`user_id` int(11) NULL DEFAULT NULL COMMENT '用戶ID',`blog_id` int(11) NULL DEFAULT NULL COMMENT '文章ID',`create_time` datetime(0) NULL DEFAULT NULL COMMENT '收藏時間' ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;-- ---------------------------- -- Records of taimi_user_blog -- ----------------------------SET FOREIGN_KEY_CHECKS = 1;2.用docker構(gòu)建mysql數(shù)據(jù)庫,navicat連接服務(wù)器的數(shù)據(jù)庫!
內(nèi)存和cpu建議:4core + 8g 、 4core + 16g
客戶端連接遠(yuǎn)程服務(wù)器
- finalshell(推薦)
Windows版下載地址:
http://www.hostbuf.com/downloads/finalshell_install.exe - docker安裝官網(wǎng)地址:https://docs.docker.com/engine/install/centos/
根據(jù)官網(wǎng)安裝即可!
至此mysql安裝完畢!
navicat連接也成功
3.創(chuàng)建數(shù)據(jù)庫taimi-web-db
將上面sql代碼導(dǎo)入即可!
4. maven用3.6.3
idea插件:
— Lombok
— Free Mybatis Plugin
5.用idea工具新建springboot工程
application.yml
# 配置端口 server:port: 8080# 配置freemarker spring:freemarker:suffix: .htmlcache: false做一個springboot啟動測試,
index.html
IndexController.java
package com.taimi.web;import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping;@Controller public class IndexController {/*** Description: 首頁* @date 2021/11/9* @author yykk* @throws Exception*/@GetMapping(value = {"/","/index"})public String index(){return "index";} }總結(jié)
以上是生活随笔為你收集整理的从零搭建个人资讯系统1的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 个人的收藏夹
- 下一篇: IDEA价格对程序员来说九牛一毛,为啥这