Pre Merge pull request !214 from wuKong/feat(trade)-添加快递客户端专用-RestTemplate
commit
13a7d20ba7
|
|
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.trade.framework.delivery.config;
|
|||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.ExpressClient;
|
||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.ExpressClientFactory;
|
||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.impl.ExpressClientFactoryImpl;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
|
@ -18,6 +19,11 @@ import org.springframework.web.client.RestTemplate;
|
|||
@Configuration(proxyBeanMethods = false)
|
||||
public class ExpressClientConfig {
|
||||
|
||||
@Bean
|
||||
@Qualifier("expressRestTemplate")
|
||||
public RestTemplate expressRestTemplate() {
|
||||
return new RestTemplate();
|
||||
}
|
||||
@Bean
|
||||
public ExpressClientFactory expressClientFactory(TradeExpressProperties tradeExpressProperties,
|
||||
RestTemplate restTemplate) {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.trade.framework.delivery.core.client.impl.kd100.K
|
|||
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.impl.kdniao.KdNiaoExpressClient;
|
||||
import cn.iocoder.yudao.module.trade.framework.delivery.core.enums.ExpressClientEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.util.Map;
|
||||
|
|
@ -24,6 +25,7 @@ public class ExpressClientFactoryImpl implements ExpressClientFactory {
|
|||
private final Map<ExpressClientEnum, ExpressClient> clientMap = new ConcurrentHashMap<>(8);
|
||||
|
||||
private final TradeExpressProperties tradeExpressProperties;
|
||||
@Qualifier("expressRestTemplate")
|
||||
private final RestTemplate restTemplate;
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue