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

用户信息源修改

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