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
5af7e2b0
Commit
5af7e2b0
authored
Aug 05, 2021
by
张辰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
主题查询,添加主题不可见
parent
31e44573
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
20 deletions
+10
-20
ThemeController.java
.../java/com/tanpu/community/controller/ThemeController.java
+1
-1
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+9
-19
No files found.
community-service/src/main/java/com/tanpu/community/controller/ThemeController.java
View file @
5af7e2b0
...
...
@@ -52,7 +52,7 @@ public class ThemeController {
@ResponseBody
public
CommonResp
<
ThemeQo
>
getDetail
(
@RequestParam
(
value
=
"themeId"
)
String
themeId
)
{
String
userId
=
userHolder
.
getUserId
();
return
CommonResp
.
success
(
themeManager
.
getThemeDetail
(
themeId
,
userId
)
);
return
themeManager
.
getThemeDetail
(
themeId
,
userId
);
}
@AuthLogin
...
...
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
5af7e2b0
...
...
@@ -25,11 +25,7 @@ import com.tanpu.community.api.beans.resp.CreateThemeResp;
import
com.tanpu.community.api.beans.resp.ThemeFullSearchResp
;
import
com.tanpu.community.api.beans.resp.ThemeListResp
;
import
com.tanpu.community.api.beans.vo.feign.fatools.UserInfoResp
;
import
com.tanpu.community.api.enums.BlockTypeEnum
;
import
com.tanpu.community.api.enums.OperationTypeEnum
;
import
com.tanpu.community.api.enums.ThemeListTypeEnum
;
import
com.tanpu.community.api.enums.ThemeRecordTypeEnum
;
import
com.tanpu.community.api.enums.ThemeTypeEnum
;
import
com.tanpu.community.api.enums.*
;
import
com.tanpu.community.cache.RedisCache
;
import
com.tanpu.community.dao.entity.community.BlackListEntity
;
import
com.tanpu.community.dao.entity.community.CollectionEntity
;
...
...
@@ -450,21 +446,15 @@ public class ThemeManager {
// 查询正文
public
ThemeQo
getThemeDetail
(
String
themeId
,
String
userId
)
{
// 查询详情
ThemeQo
themeQo
=
redisCache
.
getObject
(
StringUtils
.
joinWith
(
"_"
,
CACHE_THEME_ID
,
themeId
),
60
,
()
->
this
.
getDetailCommon
(
themeId
),
ThemeQo
.
class
);
// 添加用户相关信息
buildThemeExtraInfoByUser
(
userId
,
themeQo
);
return
themeQo
;
}
// 正文通用信息,与用户无关,可使用缓存
private
ThemeQo
getDetailCommon
(
String
themeId
)
{
public
CommonResp
<
ThemeQo
>
getThemeDetail
(
String
themeId
,
String
userId
)
{
ThemeEntity
themeEntity
=
themeService
.
queryByThemeId
(
themeId
);
if
(
themeEntity
==
null
)
{
throw
new
BizException
(
"找不到帖子id:"
+
themeId
);
}
if
(
themeEntity
.
getDeleteTag
().
equals
(
DeleteTagEnum
.
DELETED
.
getCode
()))
{
return
CommonResp
.
error
(
ErrorCodeConstant
.
UNREACHABLE
,
null
);
}
ThemeQo
themeQo
=
ConvertUtil
.
themeEntityToQo
(
themeEntity
);
//附件
batchFeignCallService
.
getAttachDetail
(
themeQo
);
...
...
@@ -474,11 +464,11 @@ public class ThemeManager {
//时间重制
themeQo
.
setUpToNowTime
(
TimeUtils
.
format
(
themeEntity
.
getCreateTime
()));
return
themeQo
;
// 添加用户相关信息
buildThemeExtraInfoByUser
(
userId
,
themeQo
);
return
CommonResp
.
success
();
}
// 点赞/取消点赞
public
void
like
(
LikeThemeReq
req
,
String
userId
)
{
if
(
OperationTypeEnum
.
CONFIRM
.
getCode
().
equals
(
req
.
getType
()))
{
...
...
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