This commit is contained in:
2022-06-08 23:08:05 +08:00
committed by GitHub
parent 71099cb2ab
commit e55cd8110d
@@ -14,15 +14,14 @@ import java.util.Map;
/** /**
* @author yaoyuan2.chu * @author yaoyuan2.chu
* @Title: * @Title: 工具类
* @Package com.yaoyuan.jiscuss.common * @Package com.yaoyuan.jiscuss.common
* @Description: * @Description: 通用工具类
* @date 2020/9/10 15:47 * @date 2020/9/10 15:47
*/ */
public class PostCommonUtil { public class PostCommonUtil {
public static List<PostCustom> getNewPostsObjMap(List<Map<String, Object>> posts) { public static List<PostCustom> getNewPostsObjMap(List<Map<String, Object>> posts) {
List<PostCustom> postCustomList = new ArrayList<>(); List<PostCustom> postCustomList = new ArrayList<>();
for (Map<String, Object> mapObj : posts) { for (Map<String, Object> mapObj : posts) {
PostCustom postCustom = new PostCustom(); PostCustom postCustom = new PostCustom();
@@ -71,6 +70,11 @@ public class PostCommonUtil {
return postCustomList; return postCustomList;
} }
/**
* 获取post
* @param postCustomList
* @return List<PostCustom>
*/
public static List<PostCustom> getNewPostsObjCustom(List<PostCustom> postCustomList) { public static List<PostCustom> getNewPostsObjCustom(List<PostCustom> postCustomList) {
List<PostCustom> mainList = new ArrayList<>(); List<PostCustom> mainList = new ArrayList<>();
Map<String, Object> postMap = new LinkedHashMap<>(); Map<String, Object> postMap = new LinkedHashMap<>();
@@ -100,7 +104,6 @@ public class PostCommonUtil {
mainListResult.add(mapObj); mainListResult.add(mapObj);
} }
} }
return mainListResult; return mainListResult;
} }