Browse Source

测试 环境不使用news.usoftchina

wangdy 8 years ago
parent
commit
ccf77ae967

+ 11 - 1
src/main/java/com/uas/platform/b2c/core/config/MicroServicesConf.java

@@ -28,6 +28,12 @@ public class MicroServicesConf {
 	@Value("#{sys.floorMicroServiceIp ?: '10.10.0.30'}")
 	@Value("#{sys.floorMicroServiceIp ?: '10.10.0.30'}")
 	private String floorMicroServiceIp;
 	private String floorMicroServiceIp;
 
 
+	/**
+	 * profile
+	 */
+	@Value("#{sys.profile}")
+	private String profile;
+
 	/**
 	/**
 	 * 轮播
 	 * 轮播
 	 */
 	 */
@@ -71,7 +77,11 @@ public class MicroServicesConf {
 	}
 	}
 
 
 	public String getRequestUrlForNews(String requestUrl) {
 	public String getRequestUrlForNews(String requestUrl) {
-		return String.format("http://%s%s", this.newsMicroServiceIp, requestUrl);
+		if ("prod".equals(profile)){
+			return String.format("http://%s%s", this.newsMicroServiceIp, requestUrl);
+		}else {
+			return String.format("http://%s:%d%s", this.microServiceIp, 20210, requestUrl);
+		}
 	}
 	}
 
 
 	public String getRequestUrlForFloor(int port, String requestUrl) {
 	public String getRequestUrlForFloor(int port, String requestUrl) {