|
@@ -24,8 +24,7 @@ public class ConvertUtils {
|
|
|
|
|
|
// parse info
|
|
|
Map<String, String> c9Map = userOriginInfo.get("alg_recsys_feature_user_share_return_stat");
|
|
|
- String c9Str = new Gson().toJson(c9Map);
|
|
|
- UserShareReturnProfile userProfile = JSON.parseObject(c9Str, UserShareReturnProfile.class);
|
|
|
+ UserShareReturnProfile userProfile = JSON.parseObject(toJson(c9Map), UserShareReturnProfile.class);
|
|
|
Map<String, Map<String, String>> historyVideoMap = list2Map(videoSeq);
|
|
|
|
|
|
List<String> cfList = Arrays.asList("share", "return");
|
|
@@ -168,4 +167,15 @@ public class ConvertUtils {
|
|
|
}
|
|
|
return jsonObject;
|
|
|
}
|
|
|
+
|
|
|
+ public static String toJson(Object obj) {
|
|
|
+ if (obj == null) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ return new Gson().toJson(obj);
|
|
|
+ } catch (Exception e) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|