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

theme添加字段discussContent

parent 7b0188cb
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-22
* @since 2021-07-23
*/
@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 +
......
......@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p>
*
* @author xudong
* @since 2021-07-22
* @since 2021-07-23
*/
public interface ThemeMapper extends BaseMapper<ThemeEntity> {
......
......@@ -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();
......
......@@ -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" />
......
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