SpringBoot open source blog project based on Fly community template

Posted by chiefmonkey on Mon, 25 May 2020 16:15:07 +0200

1. Official website address

2. Technology stack

  • Development tool Idea
  • Database design
  • JDK version Java8
  • Database MySQL v5.7
  • Back end development language SpringBoot2.2.6.RELEASE
  • Data access layer mybatis plus 3.3.1
  • Front end related HTML5, LayUI, jQuery, LayUI_fly community template, etc
  • Middleware Redis cache, RabbitMQ message, Nginx, etc
  • File service FastDFS distributed file storage, qinniu cloud, etc
  • Rich text editor, WangEditor Editor.md
  • Three party login QQ, wechat, Weibo, gitee, etc
  • Message sending email sending, nail message sending, SMS sending
  • Integration of three-party api post content review (Baidu review), baidu push, etc

3. Table structure design pd diagram

4. Frame building

4.1. Integrated mybatis plus operation database

  • Introduce maven dependency

  •   application.yml Configure database connection
      				driver-class-name: com.mysql.cj.jdbc.Driver
      				url: jdbc:mysql://
      				username: root
      				password: admin1009
      				type: com.zaxxer.hikari.HikariDataSource
      					maximum-pool-size: 50 # Maximum number of connections in connection pool, default is 10
      					minimum-idle: 5 #Minimum number of idle connections
      					idle-timeout: 18000 #Maximum idle connection lifetime, 600000 by default (10 minutes)
      					pool-name: sunnyHikariCP  #Connection pool name
      					connection-test-query: SELECT 1
  •   mybatis-plus Basic configuration class:MybatisPlusConfig.java
      		public class MybatisPlusConfig {
      				public PaginationInterceptor paginationInterceptor() {
      						PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
      						paginationInterceptor.setCountSqlParser(new JsqlParserCountOptimize(true));
      						return paginationInterceptor;
  • Test to operate the database through mybatis plus

  1. Create test script

     CREATE TABLE `test` (
     	`NAME` varchar(255) DEFAULT NULL,
     	`AGE` int(11) DEFAULT NULL,
     	`BIRTHDAY` datetime DEFAULT NULL
  2. Create pojo,mapper,service,controller

     @EqualsAndHashCode(callSuper = false)
     @Accessors(chain = true)
     public class TestBean implements Serializable {
     		private static final long serialVersionUID = 1L;
     		 * full name
     		private String name;
     		 * Age
     		private int age;
     		 * Age
     		private Date birthday;


public interface TestMapper extends BaseMapper<TestBean> {


public List<TestBean> queryAll() {
				return testMapper.selectList(null);


		public ResponseResult<List<TestBean>> queryAll() {
				List<TestBean> testList = testService.queryAll();
				return ResponseUtil.makeOKRsp(testList);
  1. Page access

4.2. Integrated Redis cache

5. Homepage development

6. Detail page development

7. Login registration and personal center development documents

Source code download address

Source download address

Detailed development technical documents Click here to view the technical documents ; more technical articles: https://www.sunnyblog.top ; any questions plus QQ group consultation: 534073451

Topics: Java Database MySQL Mybatis Redis