All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.babyfish.jimmer.spring.cfg.MicroServiceExchangeConfig Maven / Gradle / Ivy

There is a newer version: 0.9.19
Show newest version
package org.babyfish.jimmer.spring.cfg;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.babyfish.jimmer.spring.cloud.SpringCloudExchange;
import org.babyfish.jimmer.sql.runtime.MicroServiceExchange;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.web.client.RestTemplate;

@Conditional(MicroServiceCondition.class)
@ConditionalOnMissingBean(MicroServiceExchange.class)
public class MicroServiceExchangeConfig {

    @Bean
    public MicroServiceExchange microServiceExchange(
            RestTemplate restTemplate,
            ObjectMapper mapper
    ) {
        return new SpringCloudExchange(restTemplate, mapper);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy