| | |
| | | package com.xiaopeng.pushMessage.config; |
| | | |
| | | import com.fasterxml.jackson.databind.DeserializationFeature; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; |
| | | import org.springframework.boot.autoconfigure.context.MessageSourceProperties; |
| | | import org.springframework.boot.autoconfigure.web.WebProperties; |
| | | import org.springframework.context.MessageSource; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.context.support.ResourceBundleMessageSource; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.servlet.LocaleResolver; |
| | | |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.time.Duration; |
| | |
| | | // return new MyLocaleResolver(); |
| | | // } |
| | | |
| | | @Bean |
| | | ObjectMapper om() { |
| | | // 允许对象忽略json中不存在的属性 |
| | | ObjectMapper om = new ObjectMapper(); |
| | | om.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); |
| | | om.registerModule(new JavaTimeModule()); |
| | | return om; |
| | | } |
| | | |
| | | } |