package com.ruoyi.yunxin.config;

import com.dtflys.forest.converter.json.ForestJacksonConverter;
import com.dtflys.forest.converter.json.ForestJsonConverter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class ForestConfig {

    @Bean
    public ForestJsonConverter forestJacksonConverter() {
        ForestJacksonConverter converter = new ForestJacksonConverter();
        ObjectMapper mapper = converter.getMapper();
        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
//        converter.setDateFormat("yyyy-MM-dd HH:mm:ss");
        return converter;
    }
}
