Skip to content

Commit a413a87

Browse files
committed
add
0 parents  commit a413a87

File tree

197 files changed

+21758
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+21758
-0
lines changed

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# 基础镜像使用Java
2+
FROM java:8
3+
# 作者
4+
MAINTAINER wander
5+
# VOLUME指定了临时文件目录为/tmp
6+
# 其效果是在主机 /var/lib/docker 目录下创建了一个临时文件,并链接到容器的/tmp
7+
VOLUME /tmp
8+
# 将jar包添加到容器中并更名为app.jar
9+
ADD target/*.jar app.jar
10+
# 运行jar包
11+
RUN bash -c "touch /app.jar"
12+
# ENTRYPOINT是容器启动命令
13+
ENTRYPOINT ["java","-jar","app.jar"]
14+
# 指定容器需要映射到主机的端口
15+
EXPOSE 8080

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Spring Boot Blog
2+
3+
Spring Boot Blog是由Docker + SpringBoot + Mybatis + Thymeleaf等技术实现的Java博客系统。
4+
5+
- **你可以拿它作为博客模板,因为Spring Boot Blog界面十分美观简洁,满足私人博客的一切要求**
6+
- **你也可以把它作为Spring Boot技术的学习项目,Spring Boot Blog也足够符合要求,且代码和功能完备**
7+
8+
#### tips
9+
10+
- **数据库文件目录为```docs/mysql/schema.sql```**
11+
- **部署后你可以根据自己需求修改版权文案、logo图片、备案记录等信息**
12+
13+
演示站点:http://xxxx.xxx

docs/mysql/privileges.sql

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
use mysql;
2+
3+
select host, user from user;
4+
5+
create user tale identified by '123456';
6+
7+
grant all on tale.* to tale@'%' identified by '123456' with grant option;
8+
9+
flush privileges;
10+
11+
-- privileges.sql

docs/mysql/schema.sql

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
2+
-- 创建数据库
3+
create database `tale` default character set utf8 collate utf8_general_ci;
4+
5+
use tale;
6+
7+
DROP TABLE IF EXISTS `t_logs`;
8+
9+
CREATE TABLE `t_logs` (
10+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT ,
11+
`action` varchar(100) DEFAULT NULL ,
12+
`data` varchar(2000) DEFAULT NULL ,
13+
`author_id` int(10) DEFAULT NULL ,
14+
`ip` varchar(20) DEFAULT NULL ,
15+
`created` int(10) DEFAULT NULL ,
16+
PRIMARY KEY (`id`)
17+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
18+
19+
DROP TABLE IF EXISTS `t_attach`;
20+
21+
CREATE TABLE `t_attach` (
22+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
23+
`fname` varchar(100) NOT NULL DEFAULT '',
24+
`ftype` varchar(50) DEFAULT '',
25+
`fkey` varchar(100) NOT NULL DEFAULT '',
26+
`author_id` int(10) DEFAULT NULL,
27+
`created` int(10) NOT NULL,
28+
PRIMARY KEY (`id`)
29+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
30+
31+
DROP TABLE IF EXISTS `t_comments`;
32+
33+
CREATE TABLE `t_comments` (
34+
`coid` int(10) unsigned NOT NULL AUTO_INCREMENT ,
35+
`cid` int(10) unsigned DEFAULT '0' ,
36+
`created` int(10) unsigned DEFAULT '0' ,
37+
`author` varchar(200) DEFAULT NULL ,
38+
`author_id` int(10) unsigned DEFAULT '0' ,
39+
`owner_id` int(10) unsigned DEFAULT '0' ,
40+
`mail` varchar(200) DEFAULT NULL ,
41+
`url` varchar(200) DEFAULT NULL ,
42+
`ip` varchar(64) DEFAULT NULL ,
43+
`agent` varchar(200) DEFAULT NULL ,
44+
`content` text ,
45+
`type` varchar(16) DEFAULT 'comment' ,
46+
`status` varchar(16) DEFAULT 'approved' ,
47+
`parent` int(10) unsigned DEFAULT '0',
48+
PRIMARY KEY (`coid`),
49+
KEY `cid` (`cid`),
50+
KEY `created` (`created`)
51+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
52+
53+
DROP TABLE IF EXISTS `t_contents`;
54+
55+
CREATE TABLE `t_contents` (
56+
`cid` int(10) unsigned NOT NULL AUTO_INCREMENT ,
57+
`title` varchar(200) DEFAULT NULL ,
58+
`slug` varchar(200) DEFAULT NULL ,
59+
`created` int(10) unsigned DEFAULT '0' ,
60+
`modified` int(10) unsigned DEFAULT '0' ,
61+
`content` text COMMENT '内容文字',
62+
`author_id` int(10) unsigned DEFAULT '0' ,
63+
`type` varchar(16) DEFAULT 'post' ,
64+
`status` varchar(16) DEFAULT 'publish' ,
65+
`tags` varchar(200) DEFAULT NULL ,
66+
`categories` varchar(200) DEFAULT NULL ,
67+
`hits` int(10) unsigned DEFAULT '0' ,
68+
`comments_num` int(10) unsigned DEFAULT '0' ,
69+
`allow_comment` tinyint(1) DEFAULT '1' ,
70+
`allow_ping` tinyint(1) DEFAULT '1' ,
71+
`allow_feed` tinyint(1) DEFAULT '1' ,
72+
PRIMARY KEY (`cid`),
73+
UNIQUE KEY `slug` (`slug`),
74+
KEY `created` (`created`)
75+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
76+
77+
LOCK TABLES `t_contents` WRITE;
78+
79+
INSERT INTO `t_contents` (`cid`, `title`, `slug`, `created`, `modified`, `content`, `author_id`, `type`, `status`, `tags`, `categories`, `hits`, `comments_num`, `allow_comment`, `allow_ping`, `allow_feed`)
80+
VALUES
81+
(1,'about my blog','about',1487853610,1487872488,'### Hello World\r\n\r\nabout me\r\n\r\n### ...\r\n\r\n...',1,'page','publish',NULL,NULL,0,0,1,1,1),
82+
(2,'Hello My Blog',NULL,1487861184,1487872798,'## Hello World.\r\n\r\n> ...\r\n\r\n----------\r\n\r\n\r\n<!--more-->\r\n\r\n```java\r\npublic static void main(String[] args){\r\n System.out.println(\"Hello 13 Blog.\");\r\n}\r\n```',1,'post','publish','','default',10,0,1,1,1);
83+
84+
UNLOCK TABLES;
85+
86+
DROP TABLE IF EXISTS `t_metas`;
87+
88+
CREATE TABLE `t_metas` (
89+
`mid` int(10) unsigned NOT NULL AUTO_INCREMENT,
90+
`name` varchar(200) DEFAULT NULL,
91+
`slug` varchar(200) DEFAULT NULL,
92+
`type` varchar(32) NOT NULL DEFAULT '' ,
93+
`description` varchar(200) DEFAULT NULL ,
94+
`sort` int(10) unsigned DEFAULT '0',
95+
`parent` int(10) unsigned DEFAULT '0',
96+
PRIMARY KEY (`mid`),
97+
KEY `slug` (`slug`)
98+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
99+
100+
LOCK TABLES `t_metas` WRITE;
101+
102+
INSERT INTO `t_metas` (`mid`, `name`, `slug`, `type`, `description`, `sort`, `parent`)
103+
VALUES
104+
(1,'default',NULL,'category',NULL,0,0),
105+
(6,'my github','https://github.com/wander-chu','link',NULL,0,0);
106+
107+
UNLOCK TABLES;
108+
109+
DROP TABLE IF EXISTS `t_options`;
110+
111+
CREATE TABLE `t_options` (
112+
`name` varchar(32) NOT NULL DEFAULT '',
113+
`value` varchar(1000) DEFAULT '',
114+
`description` varchar(200) DEFAULT NULL,
115+
PRIMARY KEY (`name`)
116+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
117+
118+
LOCK TABLES `t_options` WRITE;
119+
120+
INSERT INTO `t_options` (`name`, `value`, `description`)
121+
VALUES
122+
('site_title','My Blog',''),
123+
('social_weibo','',NULL),
124+
('social_zhihu','',NULL),
125+
('social_github','',NULL),
126+
('social_twitter','',NULL),
127+
('site_theme','default',NULL),
128+
('site_keywords','wander Blog',NULL),
129+
('site_description','wander Blog',NULL),
130+
('site_record','','备案号');
131+
132+
UNLOCK TABLES;
133+
134+
DROP TABLE IF EXISTS `t_relationships`;
135+
136+
CREATE TABLE `t_relationships` (
137+
`cid` int(10) unsigned NOT NULL,
138+
`mid` int(10) unsigned NOT NULL,
139+
PRIMARY KEY (`cid`,`mid`)
140+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
141+
142+
LOCK TABLES `t_relationships` WRITE;
143+
144+
INSERT INTO `t_relationships` (`cid`, `mid`)
145+
VALUES
146+
(2,1);
147+
148+
UNLOCK TABLES;
149+
150+
DROP TABLE IF EXISTS `t_users`;
151+
152+
CREATE TABLE `t_users` (
153+
`uid` int(10) unsigned NOT NULL AUTO_INCREMENT,
154+
`username` varchar(32) DEFAULT NULL,
155+
`password` varchar(64) DEFAULT NULL,
156+
`email` varchar(200) DEFAULT NULL,
157+
`home_url` varchar(200) DEFAULT NULL,
158+
`screen_name` varchar(32) DEFAULT NULL,
159+
`created` int(10) unsigned DEFAULT '0',
160+
`activated` int(10) unsigned DEFAULT '0' ,
161+
`logged` int(10) unsigned DEFAULT '0',
162+
`group_name` varchar(16) DEFAULT 'visitor' ,
163+
PRIMARY KEY (`uid`),
164+
UNIQUE KEY `name` (`username`),
165+
UNIQUE KEY `mail` (`email`)
166+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
167+
168+
INSERT INTO `t_users` (`uid`, `username`, `password`, `email`, `home_url`, `screen_name`, `created`, `activated`, `logged`, `group_name`)
169+
VALUES
170+
(1, 'admin', 'a66abb5684c45962d887564f08346e8d', '[email protected]', NULL, 'admin', 1490756162, 0, 0, 'visitor');

pom.xml

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>com.my.blog.website</groupId>
7+
<artifactId>my-blog</artifactId>
8+
<version>1.0.1-SNAPSHOT</version>
9+
<packaging>jar</packaging>
10+
11+
<name>my-blog</name>
12+
<description>my-blog</description>
13+
14+
<parent>
15+
<groupId>org.springframework.boot</groupId>
16+
<artifactId>spring-boot-starter-parent</artifactId>
17+
<version>2.1.2.RELEASE</version>
18+
<relativePath/> <!-- lookup parent from repository -->
19+
</parent>
20+
21+
<properties>
22+
<docker.image.prefix>blog</docker.image.prefix>
23+
<docker.plugin.version>0.3.258</docker.plugin.version>
24+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
25+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
26+
<java.version>1.8</java.version>
27+
</properties>
28+
29+
<dependencies>
30+
<dependency>
31+
<groupId>org.mybatis.spring.boot</groupId>
32+
<artifactId>mybatis-spring-boot-starter</artifactId>
33+
<version>2.0.0</version>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.springframework.boot</groupId>
37+
<artifactId>spring-boot-starter</artifactId>
38+
<exclusions>
39+
<exclusion>
40+
<groupId>org.springframework.boot</groupId>
41+
<artifactId>spring-boot-starter-logging</artifactId>
42+
</exclusion>
43+
</exclusions>
44+
</dependency>
45+
46+
<!-- Start: log4j2 -->
47+
<dependency>
48+
<groupId>org.apache.logging.log4j</groupId>
49+
<artifactId>log4j-slf4j-impl</artifactId>
50+
<version>2.5</version>
51+
</dependency>
52+
<dependency>
53+
<groupId>org.slf4j</groupId>
54+
<artifactId>jcl-over-slf4j</artifactId>
55+
</dependency>
56+
<dependency>
57+
<groupId>org.slf4j</groupId>
58+
<artifactId>jul-to-slf4j</artifactId>
59+
</dependency>
60+
<dependency>
61+
<groupId>org.slf4j</groupId>
62+
<artifactId>log4j-over-slf4j</artifactId>
63+
</dependency>
64+
<dependency>
65+
<groupId>org.apache.logging.log4j</groupId>
66+
<artifactId>log4j-api</artifactId>
67+
<version>2.5</version>
68+
</dependency>
69+
<dependency>
70+
<groupId>org.apache.logging.log4j</groupId>
71+
<artifactId>log4j-core</artifactId>
72+
<version>2.5</version>
73+
</dependency>
74+
<!-- End: log4j2 -->
75+
76+
<dependency>
77+
<groupId>org.springframework.boot</groupId>
78+
<artifactId>spring-boot-starter-websocket</artifactId>
79+
</dependency>
80+
<dependency>
81+
<groupId>org.springframework.boot</groupId>
82+
<artifactId>spring-boot-starter-thymeleaf</artifactId>
83+
</dependency>
84+
85+
<dependency>
86+
<groupId>mysql</groupId>
87+
<artifactId>mysql-connector-java</artifactId>
88+
<scope>runtime</scope>
89+
</dependency>
90+
<dependency>
91+
<groupId>org.springframework.boot</groupId>
92+
<artifactId>spring-boot-starter-test</artifactId>
93+
<scope>test</scope>
94+
</dependency>
95+
96+
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
97+
<dependency>
98+
<groupId>org.apache.commons</groupId>
99+
<artifactId>commons-lang3</artifactId>
100+
<version>3.5</version>
101+
</dependency>
102+
103+
<!--markdown处理-->
104+
<dependency>
105+
<groupId>com.atlassian.commonmark</groupId>
106+
<artifactId>commonmark</artifactId>
107+
<version>0.8.0</version>
108+
</dependency>
109+
110+
<dependency>
111+
<groupId>com.atlassian.commonmark</groupId>
112+
<artifactId>commonmark-ext-gfm-tables</artifactId>
113+
<version>0.8.0</version>
114+
</dependency>
115+
116+
<!--mybatis分页插件-->
117+
<dependency>
118+
<groupId>com.github.pagehelper</groupId>
119+
<artifactId>pagehelper-spring-boot-starter</artifactId>
120+
<version>1.2.5</version>
121+
</dependency>
122+
123+
<dependency>
124+
<groupId>com.alibaba</groupId>
125+
<artifactId>druid</artifactId>
126+
<version>1.1.9</version>
127+
</dependency>
128+
129+
<!--过滤emoji字符-->
130+
<dependency>
131+
<groupId>com.vdurmont</groupId>
132+
<artifactId>emoji-java</artifactId>
133+
<version>3.2.0</version>
134+
</dependency>
135+
136+
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
137+
<dependency>
138+
<groupId>com.google.code.gson</groupId>
139+
<artifactId>gson</artifactId>
140+
<version>2.8.0</version>
141+
</dependency>
142+
143+
<dependency>
144+
<groupId>org.springframework.boot</groupId>
145+
<artifactId>spring-boot-starter-aop</artifactId>
146+
</dependency>
147+
</dependencies>
148+
149+
<build>
150+
<plugins>
151+
<plugin>
152+
<groupId>org.springframework.boot</groupId>
153+
<artifactId>spring-boot-maven-plugin</artifactId>
154+
</plugin>
155+
</plugins>
156+
</build>
157+
</project>

0 commit comments

Comments
 (0)