com.github.rexsheng.springboot.faster.system.config.JacksonConfig Maven / Gradle / Ivy
The newest version!
package com.github.rexsheng.springboot.faster.system.config;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.rexsheng.springboot.faster.common.constant.CommonConstant;
import com.github.rexsheng.springboot.faster.jackson.converter.JsonConverterCustomizer;
import com.github.rexsheng.springboot.faster.jackson.converter.JsonConverterFactory;
import com.github.rexsheng.springboot.faster.system.modular.SpringModule;
import com.github.rexsheng.springboot.faster.util.PasswordUtils;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Configuration;
@Configuration
@SpringModule
@ConditionalOnClass(ObjectMapper.class)
public class JacksonConfig implements JsonConverterCustomizer {
@Override
public void configure(JsonConverterFactory factory) {
factory.register("RSA", value->PasswordUtils.decodeRSAPrivate(value, CommonConstant.RSA_PRIVATE_KEY));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy