Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tanpu-community
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
探普后端
tanpu-community
Commits
2121adca
Commit
2121adca
authored
Sep 29, 2021
by
王亚雷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
粉丝/关注列表
parent
0007e300
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
8 deletions
+26
-8
CommentController.java
...ava/com/tanpu/community/controller/CommentController.java
+4
-1
HomePageController.java
...va/com/tanpu/community/controller/HomePageController.java
+10
-3
ThemeController.java
.../java/com/tanpu/community/controller/ThemeController.java
+12
-0
HomePageManager.java
...ain/java/com/tanpu/community/manager/HomePageManager.java
+0
-4
No files found.
community-service/src/main/java/com/tanpu/community/controller/CommentController.java
View file @
2121adca
...
@@ -11,6 +11,7 @@ import com.tanpu.community.api.beans.req.comment.QueryCommentReq;
...
@@ -11,6 +11,7 @@ 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.comment.ReportCommentReq
;
import
com.tanpu.community.api.beans.req.page.Page
;
import
com.tanpu.community.api.beans.req.page.Page
;
import
com.tanpu.community.manager.CommentManager
;
import
com.tanpu.community.manager.CommentManager
;
import
com.tanpu.community.util.HttpServletHelper
;
import
com.tanpu.community.util.PageUtils
;
import
com.tanpu.community.util.PageUtils
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -31,6 +32,8 @@ public class CommentController {
...
@@ -31,6 +32,8 @@ public class CommentController {
@Resource
@Resource
private
UserHolder
userHolder
;
private
UserHolder
userHolder
;
@Resource
private
HttpServletHelper
httpServletHelper
;
@ApiOperation
(
"发表评论"
)
@ApiOperation
(
"发表评论"
)
@AuthLogin
@AuthLogin
...
@@ -45,7 +48,7 @@ public class CommentController {
...
@@ -45,7 +48,7 @@ public class CommentController {
@PostMapping
(
value
=
"/queryComment"
)
@PostMapping
(
value
=
"/queryComment"
)
@ResponseBody
@ResponseBody
public
CommonResp
<
Page
<
CommentQo
>>
queryComment
(
@Validated
@RequestBody
QueryCommentReq
req
)
{
public
CommonResp
<
Page
<
CommentQo
>>
queryComment
(
@Validated
@RequestBody
QueryCommentReq
req
)
{
String
selfUserId
=
userHolder
.
ge
tUserId
();
String
selfUserId
=
httpServletHelper
.
getCurren
tUserId
();
List
<
CommentQo
>
result
=
commentManager
.
queryComments
(
req
.
getThemeId
(),
selfUserId
);
List
<
CommentQo
>
result
=
commentManager
.
queryComments
(
req
.
getThemeId
(),
selfUserId
);
return
CommonResp
.
success
(
PageUtils
.
page
(
req
.
getPage
(),
result
));
return
CommonResp
.
success
(
PageUtils
.
page
(
req
.
getPage
(),
result
));
}
}
...
...
community-service/src/main/java/com/tanpu/community/controller/HomePageController.java
View file @
2121adca
...
@@ -19,6 +19,7 @@ import com.tanpu.community.util.HttpServletHelper;
...
@@ -19,6 +19,7 @@ import com.tanpu.community.util.HttpServletHelper;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
@@ -45,13 +46,15 @@ public class HomePageController {
...
@@ -45,13 +46,15 @@ public class HomePageController {
@Resource
@Resource
private
UserHolder
userHolder
;
private
UserHolder
userHolder
;
@Resource
private
HttpServletHelper
httpServletHelper
;
// 用户信息查询 (供圈子服务调用)
// 用户信息查询 (供圈子服务调用)
@ApiOperation
(
value
=
"个人中心 查询"
)
@ApiOperation
(
value
=
"个人中心 查询"
)
@GetMapping
(
value
=
"/queryUserInfoNew"
)
@GetMapping
(
value
=
"/queryUserInfoNew"
)
public
CommonResp
<
UserInfoResp
>
queryUsersListNew
(
@RequestParam
(
value
=
"userId"
)
String
userId
)
{
public
CommonResp
<
UserInfoResp
>
queryUsersListNew
(
@RequestParam
(
value
=
"userId"
)
String
userId
)
{
String
selfUserId
=
userHolder
.
ge
tUserId
();
String
selfUserId
=
httpServletHelper
.
getCurren
tUserId
();
return
CommonResp
.
success
(
homePageManager
.
queryUsersInfo
(
selfUserId
,
userId
));
return
CommonResp
.
success
(
homePageManager
.
queryUsersInfo
(
selfUserId
,
userId
));
}
}
...
@@ -75,7 +78,11 @@ public class HomePageController {
...
@@ -75,7 +78,11 @@ public class HomePageController {
@ApiOperation
(
"查询关注/粉丝列表"
)
@ApiOperation
(
"查询关注/粉丝列表"
)
@ResponseBody
@ResponseBody
public
CommonResp
<
Page
<
FollowQo
>>
queryFollowList
(
@RequestBody
QueryFollowReq
req
)
{
public
CommonResp
<
Page
<
FollowQo
>>
queryFollowList
(
@RequestBody
QueryFollowReq
req
)
{
String
selfUserId
=
userHolder
.
getUserId
();
String
selfUserId
=
httpServletHelper
.
getCurrentUserId
();
// 为空查询当前用户自己的粉丝/关注列表
if
(
StringUtils
.
isEmpty
(
req
.
getUserId
())
&&
StringUtils
.
isNotEmpty
(
selfUserId
))
{
req
.
setUserId
(
selfUserId
);
}
return
CommonResp
.
success
(
homePageManager
.
queryFollow
(
req
,
selfUserId
));
return
CommonResp
.
success
(
homePageManager
.
queryFollow
(
req
,
selfUserId
));
}
}
...
@@ -93,7 +100,7 @@ public class HomePageController {
...
@@ -93,7 +100,7 @@ public class HomePageController {
@ApiOperation
(
"用户的帖子列表"
)
@ApiOperation
(
"用户的帖子列表"
)
@ResponseBody
@ResponseBody
public
CommonResp
<
List
<
ThemeQo
>>
likeList
(
@Validated
@RequestBody
QueryRecordThemeReq
req
)
{
public
CommonResp
<
List
<
ThemeQo
>>
likeList
(
@Validated
@RequestBody
QueryRecordThemeReq
req
)
{
String
selfUserId
=
userHolder
.
ge
tUserId
();
String
selfUserId
=
httpServletHelper
.
getCurren
tUserId
();
return
CommonResp
.
success
(
themeManager
.
queryThemesByUser
(
req
,
selfUserId
));
return
CommonResp
.
success
(
themeManager
.
queryThemesByUser
(
req
,
selfUserId
));
}
}
...
...
community-service/src/main/java/com/tanpu/community/controller/ThemeController.java
View file @
2121adca
...
@@ -9,8 +9,10 @@ import com.tanpu.community.api.beans.req.theme.*;
...
@@ -9,8 +9,10 @@ import com.tanpu.community.api.beans.req.theme.*;
import
com.tanpu.community.api.beans.resp.CreateThemeResp
;
import
com.tanpu.community.api.beans.resp.CreateThemeResp
;
import
com.tanpu.community.api.beans.resp.ThemeListResp
;
import
com.tanpu.community.api.beans.resp.ThemeListResp
;
import
com.tanpu.community.manager.ThemeManager
;
import
com.tanpu.community.manager.ThemeManager
;
import
com.tanpu.community.util.HttpServletHelper
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -26,6 +28,8 @@ public class ThemeController {
...
@@ -26,6 +28,8 @@ public class ThemeController {
private
ThemeManager
themeManager
;
private
ThemeManager
themeManager
;
@Resource
@Resource
private
UserHolder
userHolder
;
private
UserHolder
userHolder
;
@Resource
private
HttpServletHelper
httpServletHelper
;
@AuthLogin
@AuthLogin
@ApiOperation
(
"发表主题"
)
@ApiOperation
(
"发表主题"
)
...
@@ -40,6 +44,10 @@ public class ThemeController {
...
@@ -40,6 +44,10 @@ public class ThemeController {
@PostMapping
(
value
=
"/list"
)
@PostMapping
(
value
=
"/list"
)
@ResponseBody
@ResponseBody
public
CommonResp
<
ThemeListResp
>
selectInterestList
(
@Validated
@RequestBody
ThemeListReq
req
)
{
public
CommonResp
<
ThemeListResp
>
selectInterestList
(
@Validated
@RequestBody
ThemeListReq
req
)
{
String
selfUserId
=
httpServletHelper
.
getCurrentUserId
();
if
(
StringUtils
.
isEmpty
(
req
.
getUserId
()))
{
req
.
setUserId
(
selfUserId
);
}
ThemeListResp
result
=
themeManager
.
queryList
(
req
,
req
.
getUserId
());
ThemeListResp
result
=
themeManager
.
queryList
(
req
,
req
.
getUserId
());
return
CommonResp
.
success
(
result
);
return
CommonResp
.
success
(
result
);
}
}
...
@@ -49,6 +57,10 @@ public class ThemeController {
...
@@ -49,6 +57,10 @@ public class ThemeController {
@ResponseBody
@ResponseBody
public
CommonResp
<
ThemeQo
>
getDetail
(
@RequestParam
(
value
=
"themeId"
)
String
themeId
,
public
CommonResp
<
ThemeQo
>
getDetail
(
@RequestParam
(
value
=
"themeId"
)
String
themeId
,
@RequestParam
(
value
=
"userId"
,
required
=
false
)
String
userId
)
{
@RequestParam
(
value
=
"userId"
,
required
=
false
)
String
userId
)
{
String
selfUserId
=
httpServletHelper
.
getCurrentUserId
();
if
(
StringUtils
.
isEmpty
(
userId
))
{
userId
=
selfUserId
;
}
return
themeManager
.
getThemeDetail
(
themeId
,
userId
);
return
themeManager
.
getThemeDetail
(
themeId
,
userId
);
}
}
...
...
community-service/src/main/java/com/tanpu/community/manager/HomePageManager.java
View file @
2121adca
...
@@ -255,10 +255,6 @@ public class HomePageManager {
...
@@ -255,10 +255,6 @@ public class HomePageManager {
Integer
pageSize
=
req
.
page
.
pageSize
;
Integer
pageSize
=
req
.
page
.
pageSize
;
Integer
pageNumber
=
req
.
page
.
pageNumber
;
Integer
pageNumber
=
req
.
page
.
pageNumber
;
// 为空查询当前用户自己的粉丝/关注列表
if
(
StringUtils
.
isEmpty
(
req
.
getUserId
())
&&
StringUtils
.
isNotEmpty
(
userId
))
{
req
.
setUserId
(
userId
);
}
Page
<
String
>
userIdsPage
=
QueryFollowTypeEnum
.
QUERY_FANS
.
getCode
().
equals
(
req
.
getQueryType
())
?
Page
<
String
>
userIdsPage
=
QueryFollowTypeEnum
.
QUERY_FANS
.
getCode
().
equals
(
req
.
getQueryType
())
?
followRelService
.
queryFansByIdolId
(
req
.
userId
,
pageNumber
,
pageSize
)
followRelService
.
queryFansByIdolId
(
req
.
userId
,
pageNumber
,
pageSize
)
:
followRelService
.
queryIdolsByFansId
(
req
.
userId
,
pageNumber
,
pageSize
);
:
followRelService
.
queryIdolsByFansId
(
req
.
userId
,
pageNumber
,
pageSize
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment