diff --git a/community-service/src/main/java/com/tanpu/community/controller/CommentController.java b/community-service/src/main/java/com/tanpu/community/controller/CommentController.java index 418daced88bc78134ee02aa0a717d25573e492f9..e5c3910a1d79e5dca5fd91e161e0e9735917d6fa 100644 --- a/community-service/src/main/java/com/tanpu/community/controller/CommentController.java +++ b/community-service/src/main/java/com/tanpu/community/controller/CommentController.java @@ -11,7 +11,6 @@ import com.tanpu.community.api.beans.req.comment.QueryCommentReq; import com.tanpu.community.api.beans.req.comment.ReportCommentReq; import com.tanpu.community.api.beans.req.page.Page; import com.tanpu.community.manager.CommentManager; -import com.tanpu.community.util.HttpServletHelper; import com.tanpu.community.util.PageUtils; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -33,9 +32,6 @@ public class CommentController { @Resource private UserHolder userHolder; - @Resource - HttpServletHelper httpServletHelper; - @ApiOperation("å‘表评论") @AuthLogin @PostMapping(value = "/publishComment") @@ -49,7 +45,7 @@ public class CommentController { @PostMapping(value = "/queryComment") @ResponseBody public CommonResp<Page<CommentQo>> queryComment(@Validated @RequestBody QueryCommentReq req) { - String selfUserId = httpServletHelper.getCurrentUserId(); + String selfUserId = userHolder.getUserId(); List<CommentQo> result = commentManager.queryComments(req.getThemeId(), selfUserId); return CommonResp.success(PageUtils.page(req.getPage(), result)); } diff --git a/community-service/src/main/java/com/tanpu/community/controller/HomePageController.java b/community-service/src/main/java/com/tanpu/community/controller/HomePageController.java index 3cd7d55ea631b61cde6437f12399448ab2da7cd1..cb0d2c04c7d628ff2c20bfb466a90e0da67581e6 100644 --- a/community-service/src/main/java/com/tanpu/community/controller/HomePageController.java +++ b/community-service/src/main/java/com/tanpu/community/controller/HomePageController.java @@ -46,14 +46,12 @@ public class HomePageController { @Resource private UserHolder userHolder; - @Resource - HttpServletHelper httpServletHelper; // ç”¨æˆ·ä¿¡æ¯æŸ¥è¯¢ (ä¾›åœˆåæœåŠ¡è°ƒç”¨) @ApiOperation(value = "个人ä¸å¿ƒ 查询") @GetMapping(value = "/queryUserInfoNew") public CommonResp<UserInfoResp> queryUsersListNew(@RequestParam(value = "userId") String userId) { - String selfUserId = httpServletHelper.getCurrentUserId(); + String selfUserId = userHolder.getUserId(); return CommonResp.success(homePageManager.queryUsersInfo(selfUserId, userId)); } @@ -77,7 +75,7 @@ public class HomePageController { @ApiOperation("查询关注/粉ä¸åˆ—表") @ResponseBody public CommonResp<Page<FollowQo>> queryFollowList(@RequestBody QueryFollowReq req) { - String selfUserId = httpServletHelper.getCurrentUserId(); + String selfUserId = userHolder.getUserId(); return CommonResp.success(homePageManager.queryFollow(req, selfUserId)); } @@ -95,7 +93,7 @@ public class HomePageController { @ApiOperation("用户的帖å列表") @ResponseBody public CommonResp<List<ThemeQo>> likeList(@Validated @RequestBody QueryRecordThemeReq req) { - String selfUserId = httpServletHelper.getCurrentUserId(); + String selfUserId = userHolder.getUserId(); return CommonResp.success(themeManager.queryThemesByUser(req, selfUserId)); }