Commit f732e407 authored by 刘基明's avatar 刘基明

用户信息源修改

parent 0a67e598
......@@ -52,6 +52,7 @@ public class CommentController {
@ApiOperation("点赞评论")
@PostMapping(value = "/likeComment")
@AuthLogin
@ResponseBody
public CommonResp<Void> likeComment(@RequestBody LikeCommentReq req) {
String userId = userHolder.getUserId();
......@@ -61,6 +62,7 @@ public class CommentController {
@ApiOperation("举报评论")
@GetMapping(value = "/reportComment")
@AuthLogin
@ResponseBody
public CommonResp<Void> reportComment(@RequestParam String commentId) {
//todo
......
......@@ -2,6 +2,7 @@ package com.tanpu.community.controller;
import com.tanpu.common.api.CommonResp;
import com.tanpu.common.auth.AuthLogin;
import com.tanpu.common.auth.UserHolder;
import com.tanpu.common.exception.BizException;
import com.tanpu.community.api.beans.qo.ThemeQo;
......@@ -27,6 +28,7 @@ public class ThemeController {
@Resource
private UserHolder userHolder;
@AuthLogin
@ApiOperation("发表主题")
@PostMapping(value = "/publish")
@ResponseBody
......@@ -39,7 +41,7 @@ public class ThemeController {
return CommonResp.success();
}
@AuthLogin
@ApiOperation("圈子首页-推荐/关注/热门/最新")
@PostMapping(value = "/list")
@ResponseBody
......@@ -52,7 +54,7 @@ public class ThemeController {
return CommonResp.success(result);
}
@AuthLogin
@ApiOperation("主题正文")
@GetMapping(value = "/detail")
@ResponseBody
......@@ -62,6 +64,7 @@ public class ThemeController {
return CommonResp.success(themeQo);
}
@AuthLogin
@ApiOperation("转发主题")
@PostMapping(value = "/forward")
@ResponseBody
......@@ -71,6 +74,7 @@ public class ThemeController {
return CommonResp.success();
}
@AuthLogin
@ApiOperation("点赞/取消点赞主题")
@PostMapping(value = "/like")
@ResponseBody
......@@ -80,6 +84,7 @@ public class ThemeController {
return CommonResp.success();
}
@AuthLogin
@ApiOperation("用户删除自有主题")
@GetMapping(value = "/delete")
@ResponseBody
......@@ -89,6 +94,7 @@ public class ThemeController {
return CommonResp.success();
}
@AuthLogin
@ApiOperation("收藏/取消收藏主题")
@PostMapping(value = "/collect")
@ResponseBody
......@@ -98,6 +104,7 @@ public class ThemeController {
return CommonResp.success();
}
@AuthLogin
@ApiOperation("举报主题")
@PostMapping(value = "/report")
@ResponseBody
......@@ -106,6 +113,7 @@ public class ThemeController {
return CommonResp.failed("功能暂未开放");
}
@AuthLogin
@ApiOperation("分享主题")
@GetMapping(value = "/share")
@ResponseBody
......@@ -113,6 +121,7 @@ public class ThemeController {
return CommonResp.failed("功能暂未开放");
}
@AuthLogin
@ApiOperation("屏蔽")
@GetMapping(value = "/block")
@ResponseBody
......
......@@ -215,15 +215,12 @@ public class ThemeManager {
//附件列表
String themeId = themeQo.getThemeId();
//迄今时间
themeQo.setUpToNowTime(calUpToNowTime(themeQo.getCreateTime()));
//是否关注作者
String authorId = themeQo.getAuthorId();
Set<String> fansSet = new HashSet<>(followRelService.queryFansByFollowerId(userId));
if (fansSet!=null){
themeQo.setFollow(fansSet.contains(authorId));
}
themeQo.setFollow(fansSet.contains(authorId));
//是否点赞
CollectionEntity likeEntity = collectionService.getNotDeleteTargetCollection(themeId, userId, CollectionTypeEnum.LIKE_THEME);
themeQo.setHasLiked(likeEntity!=null);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment