package com.zm.order.tool.server.config;

import com.github.dozermapper.core.DozerBeanMapper;
import com.github.dozermapper.core.DozerBeanMapperBuilder;
import com.github.dozermapper.core.Mapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description dozer配置
 * @Author support 9
 * @Date 2018/12/5
 */
@Configuration
public class MapperConfig {

    private static final Logger logger = LoggerFactory.getLogger(MapperConfig.class);

    @Bean
    public Mapper mapper() {
        DozerBeanMapper mapper = (DozerBeanMapper) DozerBeanMapperBuilder.buildDefault();
        logger.info("init dozer mapper success");
        return mapper;
    }
}
