|
@@ -13,6 +13,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.commons.lang3.tuple.Pair;
|
|
import org.apache.commons.lang3.tuple.Pair;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
@@ -21,6 +22,9 @@ import java.util.*;
|
|
|
@Component
|
|
@Component
|
|
|
public class FeatureService {
|
|
public class FeatureService {
|
|
|
|
|
|
|
|
|
|
+ @Value("${feature.service.optimize.switch}")
|
|
|
|
|
+ private Boolean featureServiceOptimizeSwtich;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private FeatureV2RemoteService remoteService;
|
|
private FeatureV2RemoteService remoteService;
|
|
|
|
|
|
|
@@ -430,10 +434,14 @@ public class FeatureService {
|
|
|
for (Map.Entry<String, String> entry : metaFeatureMap.entrySet()) {
|
|
for (Map.Entry<String, String> entry : metaFeatureMap.entrySet()) {
|
|
|
String key = entry.getKey();
|
|
String key = entry.getKey();
|
|
|
try {
|
|
try {
|
|
|
- Map<String, String> valueMap = JSONUtils.fromJson(entry.getValue(), new TypeToken<Map<String, String>>() {
|
|
|
|
|
- }, Collections.emptyMap());
|
|
|
|
|
- String value = valueMap.getOrDefault("feature", "{}");
|
|
|
|
|
- newFeatureMap.put(key, value);
|
|
|
|
|
|
|
+ if (Boolean.TRUE.equals(featureServiceOptimizeSwtich)) {
|
|
|
|
|
+ newFeatureMap.put(key, entry.getValue());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ Map<String, String> valueMap = JSONUtils.fromJson(entry.getValue(), new TypeToken<Map<String, String>>() {
|
|
|
|
|
+ }, Collections.emptyMap());
|
|
|
|
|
+ String value = valueMap.getOrDefault("feature", "{}");
|
|
|
|
|
+ newFeatureMap.put(key, value);
|
|
|
|
|
+ }
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("featureStrCover error: ", e);
|
|
log.error("featureStrCover error: ", e);
|
|
|
}
|
|
}
|