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
073385d6
Commit
073385d6
authored
Aug 04, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加话题不存在异常
parent
2abb920c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
TopicController.java
.../java/com/tanpu/community/controller/TopicController.java
+3
-3
TopicManager.java
...c/main/java/com/tanpu/community/manager/TopicManager.java
+8
-11
TopicService.java
...c/main/java/com/tanpu/community/service/TopicService.java
+4
-1
No files found.
community-service/src/main/java/com/tanpu/community/controller/TopicController.java
View file @
073385d6
...
...
@@ -31,7 +31,7 @@ public class TopicController {
@PostMapping
(
value
=
"/list"
)
@ApiOperation
(
"APP全部话题页面,可搜索"
)
@ResponseBody
public
CommonResp
<
Page
<
TopicRankQo
>>
getTopic
BriefInfo
List
(
@RequestBody
TopicSearchReq
req
){
public
CommonResp
<
Page
<
TopicRankQo
>>
getTopicList
(
@RequestBody
TopicSearchReq
req
){
return
CommonResp
.
success
(
topicManager
.
getAllTopicBriefInfo
(
req
));
}
...
...
@@ -39,7 +39,7 @@ public class TopicController {
@GetMapping
(
value
=
"/detailPage"
)
@ApiOperation
(
"话题详情页顶部"
)
@ResponseBody
public
CommonResp
<
TopicRankQo
>
get
hotThemes
(
@RequestParam
String
topicId
){
public
CommonResp
<
TopicRankQo
>
get
Detail
(
@RequestParam
String
topicId
){
return
CommonResp
.
success
(
topicManager
.
getDetail
(
topicId
));
}
...
...
@@ -47,7 +47,7 @@ public class TopicController {
@GetMapping
(
value
=
"/titleList"
)
@ApiOperation
(
"首页顶部话题标题列"
)
@ResponseBody
public
CommonResp
<
List
<
TopicRankQo
>>
getT
itleList
(){
public
CommonResp
<
List
<
TopicRankQo
>>
getT
op4Topic
(){
return
CommonResp
.
success
(
topicManager
.
getTop4TopicTitles
());
}
...
...
community-service/src/main/java/com/tanpu/community/manager/TopicManager.java
View file @
073385d6
package
com
.
tanpu
.
community
.
manager
;
import
com.tanpu.common.auth.UserHolder
;
import
com.tanpu.common.constant.ErrorCodeConstant
;
import
com.tanpu.common.exception.BizException
;
import
com.tanpu.community.api.beans.qo.TopicRankQo
;
import
com.tanpu.community.api.beans.req.page.Page
;
import
com.tanpu.community.api.beans.req.topic.TopicSearchReq
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
com.tanpu.community.service.RankService
;
import
com.tanpu.community.service.TopicService
;
import
com.tanpu.community.service.VisitLogService
;
import
com.tanpu.community.util.PageUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
static
com
.
tanpu
.
biz
.
common
.
enums
.
clue
.
PageEnum
.
COMM_VISIT_TOPIC_DETAIL
;
@Service
public
class
TopicManager
{
@Autowired
private
VisitLogService
visitLog
Service
;
private
TopicService
topic
Service
;
@Autowired
private
RankService
rankService
;
@Resource
private
UserHolder
userHolder
;
// 首页-话题标签
...
...
@@ -43,10 +39,11 @@ public class TopicManager {
}
// 话题详情页
public
TopicRankQo
getDetail
(
String
topicId
)
{
//TODO 临时埋点,接入新埋点后删除
visitLogService
.
addPageView
(
userHolder
.
getUserId
(),
topicId
,
COMM_VISIT_TOPIC_DETAIL
);
TopicEntity
topicEntity
=
topicService
.
queryById
(
topicId
);
if
(
topicEntity
==
null
){
throw
new
BizException
(
ErrorCodeConstant
.
TOPIC_NOT_FOUND
);
}
return
rankService
.
getTopicDetail
(
topicId
);
}
...
...
community-service/src/main/java/com/tanpu/community/service/TopicService.java
View file @
073385d6
...
...
@@ -75,7 +75,10 @@ public class TopicService {
}
public
TopicEntity
queryById
(
String
topicId
)
{
return
topicMapper
.
selectOne
(
new
LambdaQueryWrapper
<
TopicEntity
>().
eq
(
TopicEntity:
:
getTopicId
,
topicId
));
return
topicMapper
.
selectOne
(
new
LambdaQueryWrapper
<
TopicEntity
>()
.
eq
(
TopicEntity:
:
getTopicId
,
topicId
)
.
eq
(
TopicEntity:
:
getIsConceal
,
StatusEnum
.
FALSE
)
.
eq
(
TopicEntity:
:
getDeleteTag
,
StatusEnum
.
FALSE
));
}
public
List
<
TopicEntity
>
queryByIds
(
List
<
String
>
topicIds
)
{
...
...
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