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
4351eb3f
Commit
4351eb3f
authored
Jul 23, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
theme添加字段discussContent
parent
7b0188cb
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
13 deletions
+29
-13
ThemeEntity.java
...com/tanpu/community/dao/entity/community/ThemeEntity.java
+18
-5
ThemeMapper.java
...com/tanpu/community/dao/mapper/community/ThemeMapper.java
+1
-1
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+9
-7
ThemeEntityMapper.xml
...src/main/resources/mapper/community/ThemeEntityMapper.xml
+1
-0
No files found.
community-service/src/main/java/com/tanpu/community/dao/entity/community/ThemeEntity.java
View file @
4351eb3f
package
com
.
tanpu
.
community
.
dao
.
entity
.
community
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
* <p>
* 主题内容
* </p>
*
* @author xudong
* @since 2021-07-2
2
* @since 2021-07-2
3
*/
@TableName
(
"theme"
)
@ApiModel
(
value
=
"ThemeEntity对象"
,
description
=
"主题内容"
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"ThemeEntity对象"
,
description
=
"主题内容"
)
public
class
ThemeEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -44,6 +45,9 @@ public class ThemeEntity implements Serializable {
@ApiModelProperty
(
value
=
"文本内容(json),type:附件类型(8:文本,88:产品 3:直播 6:短视频 300:课程,9:图片 10:多图),productType:基金类型(0 公募,1 私募,2 白名单,3 私有)"
)
private
String
content
;
@ApiModelProperty
(
value
=
"讨论中的文本"
)
private
String
discussContent
;
@ApiModelProperty
(
value
=
"作者id"
)
private
String
authorId
;
...
...
@@ -107,6 +111,14 @@ public class ThemeEntity implements Serializable {
this
.
content
=
content
;
}
public
String
getDiscussContent
()
{
return
discussContent
;
}
public
void
setDiscussContent
(
String
discussContent
)
{
this
.
discussContent
=
discussContent
;
}
public
String
getAuthorId
()
{
return
authorId
;
}
...
...
@@ -179,6 +191,7 @@ public class ThemeEntity implements Serializable {
", title="
+
title
+
", themeType="
+
themeType
+
", content="
+
content
+
", discussContent="
+
discussContent
+
", authorId="
+
authorId
+
", formerThemeId="
+
formerThemeId
+
", topicId="
+
topicId
+
...
...
community-service/src/main/java/com/tanpu/community/dao/mapper/community/ThemeMapper.java
View file @
4351eb3f
...
...
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p>
*
* @author xudong
* @since 2021-07-2
2
* @since 2021-07-2
3
*/
public
interface
ThemeMapper
extends
BaseMapper
<
ThemeEntity
>
{
...
...
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
4351eb3f
...
...
@@ -118,6 +118,9 @@ public class ThemeManager {
BeanUtils
.
copyProperties
(
req
,
themeEntity
);
themeEntity
.
setAuthorId
(
userId
);
themeEntity
.
setContent
(
JsonUtil
.
toJson
(
req
.
getContent
()));
//讨论类型,将讨论中的文本放入到discussContent中
if
(
ThemeTypeEnum
.
DISCUSSION
.
getCode
().
equals
(
themeEntity
.
getThemeType
()))
themeEntity
.
setDiscussContent
(
req
.
getContent
().
get
(
0
).
getValue
());
//腾讯云敏感词校验
checkContent
(
themeEntity
.
getContent
());
...
...
@@ -249,7 +252,7 @@ public class ThemeManager {
ThemeQo
themeQo
=
redisCache
.
getObject
(
StringUtils
.
joinWith
(
"_"
,
CACHE_THEME_ID
,
themeId
),
60
,
()
->
this
.
getDetailForCommon
(
themeId
),
ThemeQo
.
class
);
buildThemeExtraInfoByUser
(
userId
,
themeQo
);
buildThemeExtraInfoByUser
(
userId
,
themeQo
);
return
themeQo
;
}
...
...
@@ -264,13 +267,12 @@ public class ThemeManager {
batchFeignCallService
.
getAttachDetail
(
themeQo
);
//转发、收藏、点赞
buildThemeQoExtraInfo
(
themeQo
);
buildThemeQoExtraInfo
(
themeQo
);
return
themeQo
;
}
// 点赞/取消点赞
public
void
like
(
LikeThemeReq
req
,
String
userId
)
{
if
(
OperationTypeEnum
.
CONFIRM
.
getCode
().
equals
(
req
.
getType
()))
{
...
...
@@ -338,8 +340,8 @@ public class ThemeManager {
batchFeignCallService
.
getAttachDetailByBatch
(
themeQos
);
//其他信息
for
(
ThemeQo
themeQO
:
themeQos
)
{
buildThemeQoExtraInfo
(
themeQO
);
buildThemeExtraInfoByUser
(
userId
,
themeQO
);
buildThemeQoExtraInfo
(
themeQO
);
buildThemeExtraInfoByUser
(
userId
,
themeQO
);
}
return
themeQos
;
...
...
@@ -347,7 +349,7 @@ public class ThemeManager {
//转发对象、点赞、收藏、转发数
private
void
buildThemeQoExtraInfo
(
ThemeQo
themeQo
)
{
private
void
buildThemeQoExtraInfo
(
ThemeQo
themeQo
)
{
String
themeId
=
themeQo
.
getThemeId
();
//封装转发对象
FormerThemeQo
former
=
redisCache
.
getObject
(
StringUtils
.
joinWith
(
"_"
,
CACHE_FORMER_THEME_ID
,
themeId
),
60
,
...
...
@@ -363,7 +365,7 @@ public class ThemeManager {
}
//组装和当前用户相关信息
private
void
buildThemeExtraInfoByUser
(
String
userId
,
ThemeQo
themeQo
){
private
void
buildThemeExtraInfoByUser
(
String
userId
,
ThemeQo
themeQo
)
{
String
themeId
=
themeQo
.
getThemeId
();
//是否关注作者
String
authorId
=
themeQo
.
getAuthorId
();
...
...
community-service/src/main/resources/mapper/community/ThemeEntityMapper.xml
View file @
4351eb3f
...
...
@@ -9,6 +9,7 @@
<result
column=
"title"
property=
"title"
/>
<result
column=
"theme_type"
property=
"themeType"
/>
<result
column=
"content"
property=
"content"
/>
<result
column=
"discuss_content"
property=
"discussContent"
/>
<result
column=
"author_id"
property=
"authorId"
/>
<result
column=
"former_theme_id"
property=
"formerThemeId"
/>
<result
column=
"topic_id"
property=
"topicId"
/>
...
...
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