|
@@ -515,7 +515,7 @@ public class articleTweetAction extends BaseController implements ModelDriven<Ar
|
|
|
|
|
|
|
|
if (childs != null && childs.size() > 0) {
|
|
if (childs != null && childs.size() > 0) {
|
|
|
for (ArticleCommentVo data : result.getPageList()) {
|
|
for (ArticleCommentVo data : result.getPageList()) {
|
|
|
- List<ArticleCommentVo> comments = QueryTreeDatas(data.getId(), childs);
|
|
|
|
|
|
|
+ List<ArticleCommentVo> comments = QueryTreeDatas(data.getId(), data.getUserName(), childs);
|
|
|
data.setChildrens(comments);
|
|
data.setChildrens(comments);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -537,14 +537,14 @@ public class articleTweetAction extends BaseController implements ModelDriven<Ar
|
|
|
* @param lists 数据集合
|
|
* @param lists 数据集合
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- private List<ArticleCommentVo> QueryTreeDatas(Integer parentID, List<ArticleCommentVo> lists) {
|
|
|
|
|
|
|
+ private List<ArticleCommentVo> QueryTreeDatas(Integer parentID, String parentName, List<ArticleCommentVo> lists) {
|
|
|
List<ArticleCommentVo> newTrees = new ArrayList<>();
|
|
List<ArticleCommentVo> newTrees = new ArrayList<>();
|
|
|
|
|
|
|
|
List<ArticleCommentVo> datas = lists.stream().filter(e -> e.getParentId().equals(parentID)).collect(Collectors.toList());
|
|
List<ArticleCommentVo> datas = lists.stream().filter(e -> e.getParentId().equals(parentID)).collect(Collectors.toList());
|
|
|
|
|
|
|
|
for (ArticleCommentVo data : datas) {
|
|
for (ArticleCommentVo data : datas) {
|
|
|
-
|
|
|
|
|
- List<ArticleCommentVo> news = QueryTreeDatas(data.getId(), lists);
|
|
|
|
|
|
|
+ data.setParentName(parentName);
|
|
|
|
|
+ List<ArticleCommentVo> news = QueryTreeDatas(data.getId(), data.getUserName(), lists);
|
|
|
if (news == null || news.size() == 0) {
|
|
if (news == null || news.size() == 0) {
|
|
|
newTrees.add(data);
|
|
newTrees.add(data);
|
|
|
continue;
|
|
continue;
|
|
@@ -575,7 +575,17 @@ public class articleTweetAction extends BaseController implements ModelDriven<Ar
|
|
|
|
|
|
|
|
articleUserVo result = articleTweetService.queryUserInfo(articleTweetDto.getUserId());
|
|
articleUserVo result = articleTweetService.queryUserInfo(articleTweetDto.getUserId());
|
|
|
|
|
|
|
|
- if(result != null){
|
|
|
|
|
|
|
+ //region 关注
|
|
|
|
|
+ if (articleTweetDto.getUserId().equals(result.getId())) {
|
|
|
|
|
+ result.setIsFollow(3);//自己的推文
|
|
|
|
|
+ } else {
|
|
|
|
|
+ //是否关注
|
|
|
|
|
+ UserCollect uc = articleTweetService.queryUserCollect(result.getId(), articleTweetDto.getUserId());
|
|
|
|
|
+ result.setIsFollow(uc == null ? 0 : 1);//已关注给0;未关注给1
|
|
|
|
|
+ }
|
|
|
|
|
+ //endregion
|
|
|
|
|
+
|
|
|
|
|
+ if (result != null) {
|
|
|
String descript = "点击这里,填写简介";
|
|
String descript = "点击这里,填写简介";
|
|
|
result.setDescript(result.getDescript() == null ? descript : result.getDescript());
|
|
result.setDescript(result.getDescript() == null ? descript : result.getDescript());
|
|
|
}
|
|
}
|
|
@@ -623,7 +633,7 @@ public class articleTweetAction extends BaseController implements ModelDriven<Ar
|
|
|
String url = fileInfoList.get(0).getUrl();
|
|
String url = fileInfoList.get(0).getUrl();
|
|
|
if (!url.endsWith("jpg") && !url.endsWith("png")) {
|
|
if (!url.endsWith("jpg") && !url.endsWith("png")) {
|
|
|
data.setVideo(fileInfoList.get(0).getUrl());
|
|
data.setVideo(fileInfoList.get(0).getUrl());
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
List<String> images = new ArrayList<>();
|
|
List<String> images = new ArrayList<>();
|
|
|
images.add(url);
|
|
images.add(url);
|
|
|
data.setImages(images);
|
|
data.setImages(images);
|
|
@@ -678,7 +688,7 @@ public class articleTweetAction extends BaseController implements ModelDriven<Ar
|
|
|
String url = fileInfoList.get(0).getUrl();
|
|
String url = fileInfoList.get(0).getUrl();
|
|
|
if (!url.endsWith("jpg") && !url.endsWith("png")) {
|
|
if (!url.endsWith("jpg") && !url.endsWith("png")) {
|
|
|
data.setVideo(fileInfoList.get(0).getUrl());
|
|
data.setVideo(fileInfoList.get(0).getUrl());
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
data.setImage(url);
|
|
data.setImage(url);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -723,7 +733,7 @@ public class articleTweetAction extends BaseController implements ModelDriven<Ar
|
|
|
String url = fileInfoList.get(0).getUrl();
|
|
String url = fileInfoList.get(0).getUrl();
|
|
|
if (!url.endsWith("jpg") && !url.endsWith("png")) {
|
|
if (!url.endsWith("jpg") && !url.endsWith("png")) {
|
|
|
data.setVideo(fileInfoList.get(0).getUrl());
|
|
data.setVideo(fileInfoList.get(0).getUrl());
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
data.setImage(url);
|
|
data.setImage(url);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1025,4 +1035,33 @@ public class articleTweetAction extends BaseController implements ModelDriven<Ar
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 修改用户简介
|
|
|
|
|
+ */
|
|
|
|
|
+ public String updateDescript() {
|
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
|
+
|
|
|
|
|
+ if (articleTweetDto.getAuthorId() == null || articleTweetDto.getUserId() == null || Func.checkNull(articleTweetDto.getDescript())) {
|
|
|
|
|
+ jsonObject.put("code", 500);
|
|
|
|
|
+ jsonObject.put("message", "操作用户ID或主页用户ID或简介不能为空");
|
|
|
|
|
+ jsonObject.put("data", null);
|
|
|
|
|
+ ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (!articleTweetDto.getAuthorId().equals(articleTweetDto.getUserId())) {
|
|
|
|
|
+ jsonObject.put("code", 500);
|
|
|
|
|
+ jsonObject.put("message", "当前用户无法修改其他人的简介信息");
|
|
|
|
|
+ jsonObject.put("data", null);
|
|
|
|
|
+ ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ int num = articleTweetService.updateDescript(articleTweetDto.getAuthorId(), articleTweetDto.getDescript());
|
|
|
|
|
+
|
|
|
|
|
+ jsonObject.put("message", "修改成功");
|
|
|
|
|
+ jsonObject.put("code", 200);
|
|
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|