|
@@ -0,0 +1,17 @@
|
|
|
|
+package com.usky.system.service.config.Gzip;
|
|
|
|
+
|
|
|
|
+import com.planetj.servlet.filter.compression.CompressingFilter;
|
|
|
|
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
|
|
|
+import org.springframework.context.annotation.Bean;
|
|
|
|
+import org.springframework.context.annotation.Configuration;
|
|
|
|
+
|
|
|
|
+@Configuration
|
|
|
|
+public class GzipConfig {
|
|
|
|
+ @Bean
|
|
|
|
+ public FilterRegistrationBean<CompressingFilter> gzipFilter() {
|
|
|
|
+ FilterRegistrationBean<CompressingFilter> bean = new FilterRegistrationBean<>();
|
|
|
|
+ bean.setFilter(new CompressingFilter());
|
|
|
|
+ bean.addUrlPatterns("/*");
|
|
|
|
+ return bean;
|
|
|
|
+ }
|
|
|
|
+}
|