Authored by hugufei

fix PersonalGenderFeatureSearch

@@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory; @@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory;
9 import org.springframework.beans.factory.annotation.Autowired; 9 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.stereotype.Service; 10 import org.springframework.stereotype.Service;
11 11
  12 +import java.util.HashMap;
12 import java.util.Map; 13 import java.util.Map;
13 14
14 @Service 15 @Service
@@ -22,9 +23,11 @@ public class PersonalGenderFeatureSearch { @@ -22,9 +23,11 @@ public class PersonalGenderFeatureSearch {
22 @SearchCacheAble(cacheInMinute = 30, cacheName = "USER_GENDER_FEATURE", returnClass = JSONObject.class, cacheType = CacheType.SEARCH_REDIS, includeParams = {"uid"}) 23 @SearchCacheAble(cacheInMinute = 30, cacheName = "USER_GENDER_FEATURE", returnClass = JSONObject.class, cacheType = CacheType.SEARCH_REDIS, includeParams = {"uid"})
23 public JSONObject queryUserGenderFeature(Map<String, String> paramMap) { 24 public JSONObject queryUserGenderFeature(Map<String, String> paramMap) {
24 try { 25 try {
25 - Map<String, Float> userGenderFloat = bigDataRedisService.getUserGenderFeature(paramMap.getOrDefault("uid", "0"));  
26 JSONObject jsonObject = new JSONObject(); 26 JSONObject jsonObject = new JSONObject();
27 - jsonObject.putAll(userGenderFloat); 27 + Map<String, Float> userGenderFloat = bigDataRedisService.getUserGenderFeature(paramMap.getOrDefault("uid", "0"));
  28 + if(userGenderFloat!=null){
  29 + jsonObject.putAll(userGenderFloat);
  30 + }
28 return jsonObject; 31 return jsonObject;
29 } catch (Exception e) { 32 } catch (Exception e) {
30 logger.error(e.getMessage(), e); 33 logger.error(e.getMessage(), e);