From 71bc98161c605c585fb9fd62ae84a735a3650e8b Mon Sep 17 00:00:00 2001
From: 吴学文 <wuxuewen@wuxuewendeMacBook-Pro.local>
Date: 星期三, 17 七月 2019 21:41:10 +0800
Subject: [PATCH] 服务绑定开发选择服务环节
---
OrderService/src/main/java/com/java110/order/OrderServiceApplicationStart.java | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/OrderService/src/main/java/com/java110/order/OrderServiceApplicationStart.java b/OrderService/src/main/java/com/java110/order/OrderServiceApplicationStart.java
index fcf1715..65a3e5c 100644
--- a/OrderService/src/main/java/com/java110/order/OrderServiceApplicationStart.java
+++ b/OrderService/src/main/java/com/java110/order/OrderServiceApplicationStart.java
@@ -1,10 +1,10 @@
package com.java110.order;
-import com.java110.order.smo.ICenterServiceCacheSMO;
import com.java110.common.factory.ApplicationContextFactory;
import com.java110.core.annotation.Java110ListenerDiscovery;
import com.java110.core.client.RestTemplate;
import com.java110.event.center.DataFlowEventPublishing;
+import com.java110.order.smo.ICenterServiceCacheSMO;
import com.java110.service.init.ServiceStartInit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -13,10 +13,10 @@
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
+import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.http.converter.StringHttpMessageConverter;
-
import java.nio.charset.Charset;
@@ -30,17 +30,20 @@
* @date 2016骞�8鏈�6鏃�
* @tag
*/
-@SpringBootApplication(scanBasePackages={"com.java110.service","com.java110.order","com.java110.core","com.java110.event.order","com.java110.cache"})
+@SpringBootApplication(scanBasePackages = {"com.java110.service", "com.java110.order",
+ "com.java110.core", "com.java110.event.order", "com.java110.cache", "com.java110.db"})
@EnableDiscoveryClient
//@EnableConfigurationProperties(EventProperties.class)
@Java110ListenerDiscovery(listenerPublishClass = DataFlowEventPublishing.class,
basePackages = {"com.java110.order.listener"})
+@EnableFeignClients(basePackages = {"com.java110.core.smo"})
public class OrderServiceApplicationStart {
- private final static Logger logger = LoggerFactory.getLogger(OrderServiceApplicationStart.class);
+ private static Logger logger = LoggerFactory.getLogger(OrderServiceApplicationStart.class);
/**
* 瀹炰緥鍖朢estTemplate锛岄�氳繃@LoadBalanced娉ㄨВ寮�鍚潎琛¤礋杞借兘鍔�.
+ *
* @return restTemplate
*/
@Bean
@@ -53,6 +56,7 @@
/**
* 瀹炰緥鍖朢estTemplate
+ *
* @return restTemplate
*/
@Bean
@@ -62,7 +66,7 @@
return restTemplate;
}
- public static void main(String[] args) throws Exception{
+ public static void main(String[] args) throws Exception {
ApplicationContext context = SpringApplication.run(OrderServiceApplicationStart.class, args);
//鏈嶅姟鍚姩鍔犺浇
@@ -78,17 +82,18 @@
/**
* 鍒锋柊涓昏鐨勭紦瀛�
+ *
* @param args
*/
- private static void flushMainCache(String []args) {
+ private static void flushMainCache(String[] args) {
- logger.debug("鍒ゆ柇鏄惁闇�瑕佸埛鏂版棩蹇楋紝鍙傛暟 args 涓� {}",args);
+ logger.debug("鍒ゆ柇鏄惁闇�瑕佸埛鏂版棩蹇楋紝鍙傛暟 args 涓� {}", args);
if (args == null || args.length == 0) {
return;
}
for (int i = 0; i < args.length; i++) {
if (args[i].equalsIgnoreCase("-Dcache")) {
- logger.debug("寮�濮嬪埛鏂版棩蹇楋紝鍏ュ弬涓猴細{}",args[i]);
+ logger.debug("寮�濮嬪埛鏂版棩蹇楋紝鍏ュ弬涓猴細{}", args[i]);
ICenterServiceCacheSMO centerServiceCacheSMO = (ICenterServiceCacheSMO) ApplicationContextFactory.getBean("centerServiceCacheSMOImpl");
centerServiceCacheSMO.startFlush();
}
--
Gitblit v1.8.0