@@ -9,6 +9,7 @@ import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
|||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.Primary;
|
import org.springframework.context.annotation.Primary;
|
||||||
|
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -20,7 +21,13 @@ public class JacksonConfig {
|
|||||||
@Bean
|
@Bean
|
||||||
@Primary
|
@Primary
|
||||||
public ObjectMapper objectMapper() {
|
public ObjectMapper objectMapper() {
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = Jackson2ObjectMapperBuilder.json()
|
||||||
|
.defaultViewInclusion(true)
|
||||||
|
.autoDetectFields(true)
|
||||||
|
.failOnUnknownProperties(false)
|
||||||
|
.featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
|
||||||
|
.featuresToEnable(SerializationFeature.INDENT_OUTPUT)
|
||||||
|
.build();
|
||||||
|
|
||||||
JavaTimeModule javaTimeModule = new JavaTimeModule();
|
JavaTimeModule javaTimeModule = new JavaTimeModule();
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package ru.soune.nocopy.configuration;
|
||||||
|
|
||||||
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.core.Ordered;
|
||||||
|
import org.springframework.web.filter.CharacterEncodingFilter;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class WebConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public FilterRegistrationBean<CharacterEncodingFilter> characterEncodingFilter() {
|
||||||
|
FilterRegistrationBean<CharacterEncodingFilter> filterRegBean = new FilterRegistrationBean<>();
|
||||||
|
CharacterEncodingFilter filter = new CharacterEncodingFilter();
|
||||||
|
filter.setEncoding("UTF-8");
|
||||||
|
filter.setForceEncoding(true);
|
||||||
|
filterRegBean.setFilter(filter);
|
||||||
|
filterRegBean.addUrlPatterns("/*");
|
||||||
|
filterRegBean.setOrder(Ordered.HIGHEST_PRECEDENCE);
|
||||||
|
|
||||||
|
return filterRegBean;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -72,6 +72,15 @@ security:
|
|||||||
server:
|
server:
|
||||||
port: ${SERVER_PORT:8080}
|
port: ${SERVER_PORT:8080}
|
||||||
baseurl: "http://92.242.61.23"
|
baseurl: "http://92.242.61.23"
|
||||||
|
tomcat:
|
||||||
|
uri-encoding: UTF-8
|
||||||
|
servlet:
|
||||||
|
encoding:
|
||||||
|
charset: UTF-8
|
||||||
|
enabled: true
|
||||||
|
force: true
|
||||||
|
force-request: true
|
||||||
|
force-response: true
|
||||||
|
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
@@ -129,3 +138,4 @@ tarif:
|
|||||||
enterprice-max-files-count: 50
|
enterprice-max-files-count: 50
|
||||||
enterprice-disk-size: 500
|
enterprice-disk-size: 500
|
||||||
enterprice-user-count: 80
|
enterprice-user-count: 80
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user