|
@@ -94,7 +94,7 @@ public class articleTweetAction extends BaseController implements ModelDriven<Ar
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//推文发布参数
|
|
//推文发布参数
|
|
|
- System.out.println("推文发布参数:"+ JSON.toJSON(articleTweetDto));
|
|
|
|
|
|
|
+ System.out.println("推文发布参数:" + JSON.toJSON(articleTweetDto));
|
|
|
|
|
|
|
|
//查询当前用户
|
|
//查询当前用户
|
|
|
Users user = userService.queryByUserId(String.valueOf(articleTweetDto.getCreateId()));
|
|
Users user = userService.queryByUserId(String.valueOf(articleTweetDto.getCreateId()));
|
|
@@ -180,7 +180,7 @@ public class articleTweetAction extends BaseController implements ModelDriven<Ar
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
- System.out.println("推文发布异常:"+e.getMessage());
|
|
|
|
|
|
|
+ System.out.println("推文发布异常:" + e.getMessage());
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), new JSONObject() {{
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), new JSONObject() {{
|
|
|
put("message", "推文发布异常");
|
|
put("message", "推文发布异常");
|
|
|
put("code", 500);
|
|
put("code", 500);
|
|
@@ -381,9 +381,10 @@ public class articleTweetAction extends BaseController implements ModelDriven<Ar
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 点赞集合列表
|
|
* 点赞集合列表
|
|
|
|
|
+ *
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- public String queryLikes(){
|
|
|
|
|
|
|
+ public String queryLikes() {
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
|
|
@@ -745,6 +746,36 @@ public class articleTweetAction extends BaseController implements ModelDriven<Ar
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * 点赞数最高的推文
|
|
|
|
|
+ */
|
|
|
|
|
+ public String queryMaxArticleLike() {
|
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
|
+ ArticleLikeMaxVo result = articleTweetService.queryMaxArticleLike();
|
|
|
|
|
+ if (result != null) {
|
|
|
|
|
+ List<FileInfo> fileInfos = articleTweetService.queryList("and link_id = " + result.getId() + "");
|
|
|
|
|
+ if (fileInfos != null) {
|
|
|
|
|
+ if (fileInfos.size() > 1) {
|
|
|
|
|
+ result.setImage(fileInfos.get(0).getUrl());
|
|
|
|
|
+ } else if (fileInfos.size() == 1) {
|
|
|
|
|
+ String url = fileInfos.get(0).getUrl();
|
|
|
|
|
+ if (!url.endsWith("jpg") && !url.endsWith("png")) {
|
|
|
|
|
+ result.setVideo(fileInfos.get(0).getUrl());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ result.setImage(url);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ jsonObject.put("code", ResultStatusCode.OK.getStatus());
|
|
|
|
|
+ jsonObject.put("message", "请求成功");
|
|
|
|
|
+ jsonObject.put("data", result);
|
|
|
|
|
+ ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
* 相关推文
|
|
* 相关推文
|
|
|
*/
|
|
*/
|
|
|
public String relatedTweets() {
|
|
public String relatedTweets() {
|
|
@@ -1103,4 +1134,6 @@ public class articleTweetAction extends BaseController implements ModelDriven<Ar
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}
|
|
}
|