zoujiajian vor 3 Jahren
Ursprung
Commit
8ed8bf8bc7

+ 11 - 2
netflix-service/src/main/java/com/cyksj/common/EnvCommonService.java

@@ -22,6 +22,8 @@ public class EnvCommonService {
 
 	public static final String active_prd = "prd";
 
+	public static final String active_pre = "pre";
+
 	public static String DISTRIBUTE_DEFAULT_URL_PREFIX;
 
 	@Value(value = "${spring.profiles.active}")
@@ -31,21 +33,28 @@ public class EnvCommonService {
 	private String domain;
 
 	public String getHost() {
+		if (isPreEnv()) {
+			return domain.replaceAll("8081", "8082");
+		}
 		return domain;
 	}
 
 	public String getDomain() {
-		return this.getHost().substring(0, this.getHost().indexOf("8081"));
+		return this.getHost().substring(0, this.getHost().indexOf("80"));
 	}
 
 	public String getDomain2() {
-		return this.getHost().substring(0, this.getHost().indexOf("/8081"));
+		return this.getHost().substring(0, this.getHost().indexOf("/80"));
 	}
 
 	public Boolean isPrdEnv() {
 		return EnvCommonService.active_prd.equals(getEnv());
 	}
 
+	public Boolean isPreEnv() {
+		return EnvCommonService.active_pre.equals(getEnv());
+	}
+
 	@PostConstruct
 	public void getDistributeUrl() {
 		DISTRIBUTE_DEFAULT_URL_PREFIX = getDomain();

+ 6 - 3
netflix-web/src/main/java/com/cyksj/web/controller/goods/GoodsDonController.java

@@ -32,7 +32,10 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
-import java.util.*;
+import java.util.Date;
+import java.util.List;
+import java.util.Optional;
+import java.util.Set;
 
 /**
  * @author chan
@@ -182,7 +185,7 @@ public class GoodsDonController {
         Object value = redisService.get(pcCacheKey);
         if (value != null) {
             try {
-                List<GoodsFrontListView> list = Jsons.parseObject(value, List.class);
+                List<GoodsFrontListView> list = Jsons.parseList(value, GoodsFrontListView.class);
                 if (CollUtil.isNotEmpty(list)) {
                     //设置特定价格
                     setSpecificPrice(list, fUid);
@@ -241,7 +244,7 @@ public class GoodsDonController {
         Object value = redisService.get(h5CacheKey);
         if (value != null) {
             try {
-                List<GoodsFrontListView> list = Jsons.parseObject(value, List.class);
+                List<GoodsFrontListView> list = Jsons.parseList(value, GoodsFrontListView.class);
                 if (CollUtil.isNotEmpty(list)) {
                     //设置特定价格
                     setSpecificPrice(list, fUid);