springboot-jpa个人博客开发

数据库设计

/*
Navicat MySQL Data Transfer

Source Server         : 本地数据库
Source Server Version : 80018
Source Host           : 127.0.0.1:3306
Source Database       : myblogs

Target Server Type    : MYSQL
Target Server Version : 80018
File Encoding         : 65001

Date: 2020-10-02 21:43:54
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for blog
-- ----------------------------
DROP TABLE IF EXISTS `blog`;
CREATE TABLE `blog` (
  `id` bigint(20) NOT NULL,
  `apprication` bit(1) NOT NULL,
  `comment_abled` bit(1) NOT NULL,
  `content` varchar(255) DEFAULT NULL,
  `create_time` datetime(6) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `first_picture` varchar(255) DEFAULT NULL,
  `flag` varchar(255) DEFAULT NULL,
  `published` bit(1) NOT NULL,
  `recommend` bit(1) NOT NULL,
  `share_status` bit(1) NOT NULL,
  `title` varchar(255) DEFAULT NULL,
  `update_time` datetime(6) DEFAULT NULL,
  `views` int(11) DEFAULT NULL,
  `type_id` bigint(20) DEFAULT NULL,
  `user_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `FKpk1w92t3gjjrk7wich8n3urp9` (`type_id`),
  KEY `FKpxk2jtysqn41oop7lvxcp6dqq` (`user_id`),
  CONSTRAINT `FKpk1w92t3gjjrk7wich8n3urp9` FOREIGN KEY (`type_id`) REFERENCES `type` (`id`),
  CONSTRAINT `FKpxk2jtysqn41oop7lvxcp6dqq` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for blog_tags
-- ----------------------------
DROP TABLE IF EXISTS `blog_tags`;
CREATE TABLE `blog_tags` (
  `blogs_id` bigint(20) NOT NULL,
  `tags_id` bigint(20) NOT NULL,
  KEY `FKmw8u76fxjdexf049slt8qds7k` (`tags_id`),
  KEY `FKti2koe4o5wgd9bw1unuxwsby4` (`blogs_id`),
  CONSTRAINT `FKmw8u76fxjdexf049slt8qds7k` FOREIGN KEY (`tags_id`) REFERENCES `tag` (`id`),
  CONSTRAINT `FKti2koe4o5wgd9bw1unuxwsby4` FOREIGN KEY (`blogs_id`) REFERENCES `blog` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for comment
-- ----------------------------
DROP TABLE IF EXISTS `comment`;
CREATE TABLE `comment` (
  `id` bigint(20) NOT NULL,
  `avatar` varchar(255) DEFAULT NULL,
  `content` varchar(255) DEFAULT NULL,
  `create_time` datetime(6) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `nickname` varchar(255) DEFAULT NULL,
  `blog_id` bigint(20) DEFAULT NULL,
  `parent_comment_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `FKkap39f76wn135k7ru564fbjb7` (`blog_id`),
  KEY `FKhvh0e2ybgg16bpu229a5teje7` (`parent_comment_id`),
  CONSTRAINT `FKhvh0e2ybgg16bpu229a5teje7` FOREIGN KEY (`parent_comment_id`) REFERENCES `comment` (`id`),
  CONSTRAINT `FKkap39f76wn135k7ru564fbjb7` FOREIGN KEY (`blog_id`) REFERENCES `blog` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for hibernate_sequence
-- ----------------------------
DROP TABLE IF EXISTS `hibernate_sequence`;
CREATE TABLE `hibernate_sequence` (
  `next_val` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for tag
-- ----------------------------
DROP TABLE IF EXISTS `tag`;
CREATE TABLE `tag` (
  `id` bigint(20) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for type
-- ----------------------------
DROP TABLE IF EXISTS `type`;
CREATE TABLE `type` (
  `id` bigint(20) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` bigint(20) NOT NULL,
  `avatar` varchar(255) DEFAULT NULL,
  `create_time` datetime(6) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `nickname` varchar(255) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  `type` int(11) DEFAULT NULL,
  `update_time` datetime(6) DEFAULT NULL,
  `username` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

博客插件以及插件的地址

static文件的lib主要放置插件
插件的集成:
    编辑器:Markdown
        地址:https://pandao.github.io/editor.md/
    内容的排版:typo.css
        地址:https://github.com/sofish/typo.css
    动画插件:animate.css
        https://animate.style
        地址(cdn): <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.0.0/animate.min.css"/>
     代码高亮的插件:prism
        地址:https://prismjs.com/
    目录生成:Tocbot
            地址:https://tscanlin.github.io/tocbot/
    頁面生成二維碼的:qrcode
            地址:https://davidshimjs.github.io/qrcodejs/
    平滑滚动:jquery.scrollTo
        地址:https://github.com/flesler/jquery.scrollTo
    滚动侦测:waypoints
        地址:http://imakewebthings.com/waypoints/

    framgment:
        可以直接替换很多的东西_fragment.html
实体类的设计:
    采用JPA的结果来进行表和实体之间的映射,也就是只设计实体,表的那部分会更新,
    评论是自关联的  parentComment和replyComment  关系是一对多的
    博客: Blog  创建实体中的图片少了一个是否推荐
    博客分类: Type
    博客标签: Tag
    博客评论: Comment
    用户: User
把文本的内容转化为markdown格式的内容  commonmark-java
    地址:https://github.com/atlassian/commonmark-java
    也就是加入下面的三个依赖:
                <!--集成markdown的语法的文本转化为html格式的插件-->
                <dependency>
                    <groupId>com.atlassian.commonmark</groupId>
                    <artifactId>commonmark</artifactId>
                    <version>0.15.0</version>
                </dependency>
                <!--集成table需要的插件-->
                <dependency>
                    <groupId>com.atlassian.commonmark</groupId>
                    <artifactId>commonmark-ext-gfm-tables</artifactId>
                    <version>0.15.0</version>
                </dependency>
                <!--引入加上id的包,便于生成目录-->
                <dependency>
                    <groupId>com.atlassian.commonmark</groupId>
                    <artifactId>commonmark-ext-heading-anchor</artifactId>
                    <version>0.15.0</version>
                </dependency>

pom依赖

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.0.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.timous</groupId>
    <artifactId>springboot_blog_develope</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>springboot_blog_develope</name>
    <description>Demo project for Spring Boot</description>

    <properties>
        <java.version>1.8</java.version>
        <springboot-thymeleaf.version>3.0.9.RELEASE</springboot-thymeleaf.version>
        <thymeleaf-layout-dialect.version>2.3.0</thymeleaf-layout-dialect.version>
    </properties>

    <dependencies>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-aop</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>


        <!--集成markdown的语法的文本转化为html格式的插件-->
        <dependency>
            <groupId>com.atlassian.commonmark</groupId>
            <artifactId>commonmark</artifactId>
            <version>0.15.0</version>
        </dependency>
        <!--集成table需要的插件-->
        <dependency>
            <groupId>com.atlassian.commonmark</groupId>
            <artifactId>commonmark-ext-gfm-tables</artifactId>
            <version>0.15.0</version>
        </dependency>
        <!--引入加上id的包,便于生成目录-->
        <dependency>
            <groupId>com.atlassian.commonmark</groupId>
            <artifactId>commonmark-ext-heading-anchor</artifactId>
            <version>0.15.0</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
免费个人博客系统(兼多用户博客系统)是支持一个空间2个网站的全能型网站管理系统,本免费个人博客系统通用和拓展性强,博客、文章系统、商城、企业网站、个性化论坛等类型网站都可以使用,将来网站无论如何转型或拓展,只需要修改模板就可以实现,无需重建网站。本系统不同于以往任何逻辑架构的网站程序。本软件开发者希望通过注重商业化开发,助力用户通过网络创业和赚钱,当然您也可以通过这个软件在互联网高效地展示自己。 详细说明: 1.本个人博客系统可以用于商业用途,本软件官方、开发者不收取任何授权费用; 2.本个人博客系统是支持一个空间2个网站的全能型博客系统; 3.本个人博客系统通用和拓展性强,博客、文章系统、商城、企业网站、个性化论坛等类型网站都可以使用; 4.本个人博客系统功能强大,代码少,运行效率更高,程序运行速度是其它主流同类软件的3~4倍,内存占用不到其它主流同类软件的五分之一; 5.开启和关闭会员注册,开启和关闭普通会员投稿功能; 6.会员功能拓展到了兼职专题功能,SEO设置和开放特约编辑的多用户不同权限管理功能等; 7.超级管理员可无密码一键登录任意会员后台,管理员用受限登录会员身份后台发布信息,也可让网站攻击者无法猜解密码; 8.自动生成手机版网站,系统默认带www的域名为PC模板站,不带www的顶级域名为手机站,不增加维护难度,就可以同时拥有2个网站; 9.博客程序还包含订单、秒杀、限时抢购和数量虚拟功能,助力用户互联网创业和商业化运营,就看脑洞大开的你怎么使用了; 10.本个人博客系统能够适应各种界面浏览器,后台可手机随时随地访问、管理和更新网站; 11.可一键切换成.shtml、.html、.htm、.asp、.aspx、.cgi、.php、.jsp、.cgi、/ 等网页后缀,模拟不同语言编程的网站程序; 12.前端页面精简,前端编码不用div标签,不用id、class规则的CSS样式,最大限度精简前端代码,鼓励用户抛弃div+CSS前端代码编写模式,我们这样做不是为了迎合HTML5,只是为了更合理的应用HTML标签; 13.安装程序自动识别和设置伪静态; 14.全站无死角SEO设置; 15.强大的内链逻辑,特别适应大数据类型网站使用; 16.强大的广告和精准广告设置; 17.数据缓存模式,不依赖外部服务器组件和其它插件,不额外占用服务器系统内存资源; 18.删除局部缓存和一键清除全部缓存; 19.可设置邮件实时通知新订单和访客留言; 20.可设置管理员回复留言可同时邮件通知留言者; 21.可查看和删除无用上传文件,为将来数据备份节省时间和空间; 22.特色的tag标签功能; 23.分类、tag标签、url表单填写自动补缺; 24.url表单可自动生成拼音,也可以用汉字,自动转码,有利于SEO搜索引擎排名; 25.开放式PHP原生态模板,用户任意修改、穿插内容或广告,无需花时间研究额外规则,模板修改成本更低; 26.可对模板备份,使用备份模板,并可对模板恢复系统初始状态; 27.模板修改全站页面秒更新; 28.可自定义SQL语句的图片展示页面; 29.后台可控制各个模块是否开启验证码、设置验证码长度,以及设置验证码破解难度; 30.访客留言关键词过滤; 31.可自定义导航; 32.可在线编辑js和CSS文件; 33.本免费个人博客系统(兼多用户博客系统)无后门。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值