Git Product home page Git Product logo

springboot's Introduction

实战SpringBoot

1.Lombok

  • 代码版本: 1.0.0-Release

  • 功能:使用Lombok简化代码

  • 包含模块:

    • LombokRequest:演示使用Lombok简化代码
    • LombokController:演示效果
  • 启动项目并验证

      {
        "intLombok":3,
        "strLombok":"zhanghan",
        "boleanLombok":true,
        "personLombok":{
          "name":"zhangsan",
          "age":15
        }
      }
  • 博客地址:使用Lombok简化你的代码

2.SpringMvc解析XML

  • 代码版本: 1.0.0-Release

  • 功能:SpringMvc解析xml参数请求

  • 包含模块:

    • XmlRequest:演示使用SpringMvc接收xml参数
    • XmlController:演示效果
  • 启动项目并验证

      <school>
           <id>1111</id>
           <name>沙河市第一高级中学</name>
           <shortname>沙河一中</shortname>
      </school>
  • 博客地址:SpringMvc接收xml请求

3.SpringBoot Mybatis 添加多数据源

  • 代码版本: 1.0.0-Release

  • 功能:SpringBoot一个项目添加多个数据源,数据库连接池用的是高性能的HikariCP(springboot2.0以后的默认数据库连接池)

  • 包含模块:

    • OrderRequest:演示使用SpringMvc接收mobile参数
    • OrderController:演示效果的Controller
    • OrderServiceImpl:演示效果的Service
    • UserInfoMapper和OrderInfoMapper:演示效果的Mapper
    • UserDataSourceProperties和OrderDataSourceProperties:读取配置文件中配置的数据源属性值
    • UserDataSourceConfig和OrderDataSourceConfig:数据库操作
  • 启动项目并验证

     {
         "mobile":"17633201809"
     }
  • 博客地址:SpringBoot整合Mybatis配置多数据源

4.SpringBoot整合Redis

  • 代码版本: 1.0.0-Release

  • 功能:SpringBoot中集成Redis操作

  • 包含模块:

    • RedisProperties:读取配置文件中配置Redis的属性值
    • RedisConfig:建立操作Redis的Template
    • OrderServiceImpl:演示效果的Service
    • RedisController:演示操作Redis效果
  • 启动项目并验证

  • 博客地址:SpringBoot整合Redis

5.SpringBoot增加健康检查

  • 代码版本: 1.0.0-Release

  • 功能:SpringBoot中增加健康检查

  • 包含模块:

    • Pom:增加spring-boot-starter-actuator依赖
    • application.properties:根据Spring Boot的版本(2.0前还是2.0后)增加相关的配置
  • 启动项目并验证

  • 博客地址:SpringBoot配置健康检查与监控

6.Redis Pipeline 轻松实现百倍性能提升

7.优雅替代if判断;提高系统的扩展性

8.SpringBoot集成Swagger

  • 代码版本: 1.1.0-Release

  • 功能:SpringBoot集成Swagger

  • 包含模块:

    • Pom:增加Swagger的依赖
    • SwaggerConfig:配置生效Swagger
    • 相应的Controller以及Request实体:增加Swagger的注释
    • application:增加是否启用swagger开关(一般生产环境关闭swagger防止被其他人扫描,测试和开发环境打开便于联调)
  • 启动项目并验证

  • 博客地址:SpringBoot集成Swagger

9.标准化json返回值

  • 代码版本: 1.2.0-Release

  • 功能:SpringBoot 规范返回值

  • 包含模块:

    • WrapMapper:统一返回值格式操作工具类
    • Wrapper:统一返回值格式类
    • 相应的Controller:修改返回值类型
  • 启动项目并验证

  • 博客地址:标准化json返回值

10.统一异常处理

11.图片上传

  • 代码版本: 1.4.0-Release

  • 功能:SpringBoot 添加图片上传

  • 包含模块:

    • MultipartConfig:文件统一配置类
    • UpLoadController:图片上传controller
  • 启动项目并验证

  • 博客地址:图片上传

12.金额校验

13.统一拦截器

  • 代码版本: 1.4.0-Release

  • 功能:统一日志拦截器

  • 包含模块:

    • InterceptController:拦截的控制器
    • InterceptRequest:拦截的请求体
    • InterceptLog:日志拦截器
    • WebMvcConfig:容器中加载日志拦截器
    • BodyReaderWrapper:请求体封装类
    • BodyReaderFilter:过滤器
  • 启动项目并验证

  • 博客地址:Required request body is missing

14.增加Spring Boot Admin监控 & 规范日志输出格式

15.集成安全和告警模块

16.集成日志收集系统

springboot's People

Contributors

dangnianchuntian avatar

Watchers

 avatar

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.