Giter VIP home page Giter VIP logo

spring-boot-ssm's Introduction

简介

spring-boot-ssm 是一个基于Spring Boot & Spring & Spring MVC & MyBatis的简单通用的项目,用于快速构建中小型API的后端服务系统. 可以做为一个种子项目,进行改造升级.

另外,还有个对应的Vue+ElementUI的前端项目vue-admin,同样可以作为一个web前端的种子项目。

这2个项目是集成测试过的,可以直接拿来开发项目。

特征

  • Spring Boot 2
  • Spring MVC
  • Mybatis
  • Spring Boot Test
  • 集成通用Mapper插件、PageHelper分页插件,实现单表业务的基本操作.
  • 统一的Response封装,统一的异常处理,基础方法的抽象封装.
  • 代码自动生成工具
  • Druid 集成阿里Druid数据库连接池以及API和数据库等监控
  • 日志管理(集成Logback)
  • 缓存框架(集成Redis)
  • 用户权限管理(集成Apache Shiro,Redis共享session)
  • 操作日志记录
  • 任务调度(集成Quartz)

环境准备

  1. MySql
  2. Redis

快速启动

  1. 克隆项目
    git clone https://github.com/caoxile/spring-boot-ssm.git
  1. 初始化表

    执行bin/init_db.sql脚本,初始化表和数据

  2. 对开发环境配置文件application-dev.properties进行配置(Mysql+Redis).

  • Mysql配置
    spring.datasource.url=jdbc:mysql://localhost:3306/project?characterEncoding=utf-8&useSSL=false
    spring.datasource.username=tom
    spring.datasource.password=hellotom
  • Redis 配置
# Redis服务器地址
spring.redis.host=localhost
# Redis服务器连接端口
spring.redis.port=6379
# Redis服务器连接密码(默认为空)
spring.redis.password=
  1. 启动
    //在IDE中启动,或者直接执行下面命令
    mvn spring-boot:run

代码自动生成工具

  1. 修改对test包内的代码生成器CodeGenerator的数据库链接等配置
    //JDBC配置
    private static final String JDBC_URL = "jdbc:mysql://localhost:3306/project";//数据库链接
    private static final String JDBC_USERNAME = "tom";//数据库用户名
    private static final String JDBC_PASSWORD = "hellotom";//数据库密码
    private static final String JDBC_DIVER_CLASS_NAME = "com.mysql.jdbc.Driver";//数据库驱动类型

  1. CodeGenerator.main方法中,输入表名,然后运行.(即可在src下生成基础代码)
    public static void main(String[] args) {
        //genCode("auth","auth_user"); // 参数1:模块名 参数2:表名
        genCodeByCustomModelName("auth","auth_user","User"); // 参数1:模块名 参数2:表名 参数3:自定义Model名
    }

技术文档

License

MIT

spring-boot-ssm's People

Contributors

caoxile avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

ansheng619

spring-boot-ssm's Issues

一个疑问

为什么BaseService类定义为抽象类,因为我看此类的方法已经全部实现。还是说只是为了作为父类被继承么或者拓展一些实现?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.