WANG 6 yıl önce
ebeveyn
işleme
0a01a7537b

+ 4 - 2
examcloud-exchange-outer-service/src/main/java/cn/com/qmth/examcloud/exchange/outer/service/impl/CourseGroupServiceImpl.java

@@ -6,6 +6,7 @@ import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import com.google.common.reflect.TypeToken;
 import com.thoughtworks.xstream.XStream;
 
 import cn.com.qmth.examcloud.commons.base.exception.StatusException;
@@ -38,8 +39,9 @@ public class CourseGroupServiceImpl implements CourseGroupService {
 
 		String json = redisClient.get(key, String.class);
 		if (null != json) {
-			@SuppressWarnings("unchecked")
-			List<Course> obj = JsonUtil.fromJson(json, List.class);
+			@SuppressWarnings("serial")
+			List<Course> obj = JsonUtil.fromJson(json, new TypeToken<List<Course>>() {
+			}.getType());
 			list = obj;
 			return list;
 		}