Commit 4351eb3f authored by 刘基明's avatar 刘基明

theme添加字段discussContent

parent 7b0188cb
package com.tanpu.community.dao.entity.community; package com.tanpu.community.dao.entity.community;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDateTime;
/** /**
* <p> * <p>
* 主题内容 * 主题内容
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-07-22 * @since 2021-07-23
*/ */
@TableName("theme") @TableName("theme")
@ApiModel(value="ThemeEntity对象", description="主题内容")
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@ApiModel(value="ThemeEntity对象", description="主题内容")
public class ThemeEntity implements Serializable { public class ThemeEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -44,6 +45,9 @@ public class ThemeEntity implements Serializable { ...@@ -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 私有)") @ApiModelProperty(value = "文本内容(json),type:附件类型(8:文本,88:产品 3:直播 6:短视频 300:课程,9:图片 10:多图),productType:基金类型(0 公募,1 私募,2 白名单,3 私有)")
private String content; private String content;
@ApiModelProperty(value = "讨论中的文本")
private String discussContent;
@ApiModelProperty(value = "作者id") @ApiModelProperty(value = "作者id")
private String authorId; private String authorId;
...@@ -107,6 +111,14 @@ public class ThemeEntity implements Serializable { ...@@ -107,6 +111,14 @@ public class ThemeEntity implements Serializable {
this.content = content; this.content = content;
} }
public String getDiscussContent() {
return discussContent;
}
public void setDiscussContent(String discussContent) {
this.discussContent = discussContent;
}
public String getAuthorId() { public String getAuthorId() {
return authorId; return authorId;
} }
...@@ -179,6 +191,7 @@ public class ThemeEntity implements Serializable { ...@@ -179,6 +191,7 @@ public class ThemeEntity implements Serializable {
", title=" + title + ", title=" + title +
", themeType=" + themeType + ", themeType=" + themeType +
", content=" + content + ", content=" + content +
", discussContent=" + discussContent +
", authorId=" + authorId + ", authorId=" + authorId +
", formerThemeId=" + formerThemeId + ", formerThemeId=" + formerThemeId +
", topicId=" + topicId + ", topicId=" + topicId +
......
...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p> * </p>
* *
* @author xudong * @author xudong
* @since 2021-07-22 * @since 2021-07-23
*/ */
public interface ThemeMapper extends BaseMapper<ThemeEntity> { public interface ThemeMapper extends BaseMapper<ThemeEntity> {
......
...@@ -118,6 +118,9 @@ public class ThemeManager { ...@@ -118,6 +118,9 @@ public class ThemeManager {
BeanUtils.copyProperties(req, themeEntity); BeanUtils.copyProperties(req, themeEntity);
themeEntity.setAuthorId(userId); themeEntity.setAuthorId(userId);
themeEntity.setContent(JsonUtil.toJson(req.getContent())); themeEntity.setContent(JsonUtil.toJson(req.getContent()));
//讨论类型,将讨论中的文本放入到discussContent中
if (ThemeTypeEnum.DISCUSSION.getCode().equals(themeEntity.getThemeType()))
themeEntity.setDiscussContent(req.getContent().get(0).getValue());
//腾讯云敏感词校验 //腾讯云敏感词校验
checkContent(themeEntity.getContent()); checkContent(themeEntity.getContent());
...@@ -249,7 +252,7 @@ public class ThemeManager { ...@@ -249,7 +252,7 @@ public class ThemeManager {
ThemeQo themeQo = redisCache.getObject(StringUtils.joinWith("_", CACHE_THEME_ID, themeId), 60, ThemeQo themeQo = redisCache.getObject(StringUtils.joinWith("_", CACHE_THEME_ID, themeId), 60,
() -> this.getDetailForCommon(themeId), ThemeQo.class); () -> this.getDetailForCommon(themeId), ThemeQo.class);
buildThemeExtraInfoByUser(userId,themeQo); buildThemeExtraInfoByUser(userId, themeQo);
return themeQo; return themeQo;
} }
...@@ -264,13 +267,12 @@ public class ThemeManager { ...@@ -264,13 +267,12 @@ public class ThemeManager {
batchFeignCallService.getAttachDetail(themeQo); batchFeignCallService.getAttachDetail(themeQo);
//转发、收藏、点赞 //转发、收藏、点赞
buildThemeQoExtraInfo( themeQo); buildThemeQoExtraInfo(themeQo);
return themeQo; return themeQo;
} }
// 点赞/取消点赞 // 点赞/取消点赞
public void like(LikeThemeReq req, String userId) { public void like(LikeThemeReq req, String userId) {
if (OperationTypeEnum.CONFIRM.getCode().equals(req.getType())) { if (OperationTypeEnum.CONFIRM.getCode().equals(req.getType())) {
...@@ -338,8 +340,8 @@ public class ThemeManager { ...@@ -338,8 +340,8 @@ public class ThemeManager {
batchFeignCallService.getAttachDetailByBatch(themeQos); batchFeignCallService.getAttachDetailByBatch(themeQos);
//其他信息 //其他信息
for (ThemeQo themeQO : themeQos) { for (ThemeQo themeQO : themeQos) {
buildThemeQoExtraInfo( themeQO); buildThemeQoExtraInfo(themeQO);
buildThemeExtraInfoByUser(userId,themeQO); buildThemeExtraInfoByUser(userId, themeQO);
} }
return themeQos; return themeQos;
...@@ -347,7 +349,7 @@ public class ThemeManager { ...@@ -347,7 +349,7 @@ public class ThemeManager {
//转发对象、点赞、收藏、转发数 //转发对象、点赞、收藏、转发数
private void buildThemeQoExtraInfo( ThemeQo themeQo) { private void buildThemeQoExtraInfo(ThemeQo themeQo) {
String themeId = themeQo.getThemeId(); String themeId = themeQo.getThemeId();
//封装转发对象 //封装转发对象
FormerThemeQo former = redisCache.getObject(StringUtils.joinWith("_", CACHE_FORMER_THEME_ID, themeId), 60, FormerThemeQo former = redisCache.getObject(StringUtils.joinWith("_", CACHE_FORMER_THEME_ID, themeId), 60,
...@@ -363,7 +365,7 @@ public class ThemeManager { ...@@ -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 themeId = themeQo.getThemeId();
//是否关注作者 //是否关注作者
String authorId = themeQo.getAuthorId(); String authorId = themeQo.getAuthorId();
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<result column="title" property="title" /> <result column="title" property="title" />
<result column="theme_type" property="themeType" /> <result column="theme_type" property="themeType" />
<result column="content" property="content" /> <result column="content" property="content" />
<result column="discuss_content" property="discussContent" />
<result column="author_id" property="authorId" /> <result column="author_id" property="authorId" />
<result column="former_theme_id" property="formerThemeId" /> <result column="former_theme_id" property="formerThemeId" />
<result column="topic_id" property="topicId" /> <result column="topic_id" property="topicId" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment