Coder Social home page Coder Social logo

tarems / request-spring-boot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from battcn/extend-spring-boot

0.0 1.0 0.0 29 KB

request-spring-boot-starter 对是一个 request/response,jdk8日期,跨域请求,国际化的增强包

Java 97.54% HTML 2.46%

request-spring-boot's Introduction

简介

request-spring-boot-starter 对是一个 request/response 的增强包

特点

  • 使 spring.jackson.date-format 属性支持 JDK8 日期格式化
  • 解决 request.getInputStream() 一次读取后失效痛点
  • 国际化支持
  • 全局跨域支持

使用方法

<dependency>
    <groupId>com.battcn</groupId>
    <artifactId>request-spring-boot-starter</artifactId>
    <version>1.0.3-RELEASE</version>
</dependency>

在主函数(Application.java) 中添加相应注解即可

import com.battcn.boot.request.annotation.EnableLocalDateTimeFormat;
import com.battcn.boot.request.annotation.EnableRequestWrapperFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * @author Levin
 */
@EnableI18n
@EnableCorsFilter
@EnableLocalDateTimeFormat
@EnableRequestWrapperFilter
@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

注解介绍

@EnableI18n

I18N 国际化支持

@EnableCorsFilter

全局跨域支持

EnableRequestWrapperFilter

继承 HttpServletRequestWrapper 实现BodyCacheHttpServletRequestWrapper,解决 request.getInputStream() 一次读取后失效痛点

EnableLocalDateTimeFormat

使 spring.jackson.date-format 属性支持 JDK8 日期格式化

request-spring-boot's People

Contributors

levin950825 avatar

Watchers

James Cloos 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.