|
|
@@ -1272,5 +1272,34 @@ public class articleTweetAction extends BaseController implements ModelDriven<Ar
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 点赞数前三的推文
|
|
|
+ */
|
|
|
+ public String queryTop3ArticleLike() {
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ List<ArticleLikeMaxVo> result = articleTweetService.queryTop3ArticleLike();
|
|
|
+ if (result != null) {
|
|
|
+ for (int i = 0; i < result.size(); i++) {
|
|
|
+ List<FileInfo> fileInfos = articleTweetService.queryList("and link_id = " + result.get(i).getId() + "");
|
|
|
+ if (fileInfos != null) {
|
|
|
+ if (fileInfos.size() > 1) {
|
|
|
+ result.get(i).setImage(fileInfos.get(0).getUrl());
|
|
|
+ } else if (fileInfos.size() == 1) {
|
|
|
+ String url = fileInfos.get(0).getUrl();
|
|
|
+ if (!url.endsWith("jpg") && !url.endsWith("png")) {
|
|
|
+ result.get(i).setVideo(fileInfos.get(0).getUrl());
|
|
|
+ } else {
|
|
|
+ result.get(i).setImage(url);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ jsonObject.put("code", ResultStatusCode.OK.getStatus());
|
|
|
+ jsonObject.put("message", "请求成功");
|
|
|
+ jsonObject.put("data", result);
|
|
|
+ ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
+ return null;
|
|
|
+ }
|
|
|
|
|
|
}
|