Commit d6bea770 authored by 刘基明's avatar 刘基明

举报主题、举报评论

parents 4a9778cb 548def1c
...@@ -6,6 +6,13 @@ import java.time.LocalDate; ...@@ -6,6 +6,13 @@ import java.time.LocalDate;
@Data @Data
public class KafkaDurationUptMsg { public class KafkaDurationUptMsg {
private String ident; public String ident;
private Long durMillsInc; public long durMillsInc;
public String pidUuid;
public String pidUserId;
public String visitorId;
public String faId;
public String pageId;
public String refId;
public LocalDate localDate;
} }
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 com.baomidou.mybatisplus.annotation.TableName; import java.time.LocalDateTime;
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-07 * @since 2021-07-22
*/ */
@TableName("black_list") @TableName("black_list")
@ApiModel(value="BlackListEntity对象", description="黑名单")
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@ApiModel(value="BlackListEntity对象", description="黑名单")
public class BlackListEntity implements Serializable { public class BlackListEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Integer id; private Long id;
@ApiModelProperty(value = "屏蔽发起人") @ApiModelProperty(value = "屏蔽发起人")
private String blocker; private String blocker;
...@@ -51,11 +50,11 @@ public class BlackListEntity implements Serializable { ...@@ -51,11 +50,11 @@ public class BlackListEntity implements Serializable {
private Integer deleteTag; private Integer deleteTag;
public Integer getId() { public Long getId() {
return id; return id;
} }
public void setId(Integer id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
......
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.TableName;
import java.time.LocalDateTime;
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-07 * @since 2021-07-22
*/ */
@TableName("collection") @TableName("collection")
@ApiModel(value="CollectionEntity对象", description="收藏/点赞")
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@ApiModel(value="CollectionEntity对象", description="收藏/点赞")
public class CollectionEntity implements Serializable { public class CollectionEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -30,7 +29,7 @@ public class CollectionEntity implements Serializable { ...@@ -30,7 +29,7 @@ public class CollectionEntity implements Serializable {
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private String id; private String id;
@ApiModelProperty(value = "类型 1:点赞,2:收藏") @ApiModelProperty(value = "类型 1:点赞主题,2:收藏主题 3、点赞评论")
private Integer collectionType; private Integer collectionType;
@ApiModelProperty(value = "用户id") @ApiModelProperty(value = "用户id")
......
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 com.baomidou.mybatisplus.annotation.TableName; import java.time.LocalDateTime;
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-21 * @since 2021-07-22
*/ */
@TableName("comment") @TableName("comment")
@ApiModel(value="CommentEntity对象", description="评论")
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@ApiModel(value="CommentEntity对象", description="评论")
public class CommentEntity implements Serializable { public class CommentEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Integer id; private Long id;
@ApiModelProperty(value = "评论主键Id") @ApiModelProperty(value = "评论主键Id")
private String commentId; private String commentId;
...@@ -67,11 +66,11 @@ public class CommentEntity implements Serializable { ...@@ -67,11 +66,11 @@ public class CommentEntity implements Serializable {
private Integer deleteTag; private Integer deleteTag;
public Integer getId() { public Long getId() {
return id; return id;
} }
public void setId(Integer id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
......
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 com.baomidou.mybatisplus.annotation.TableName; import java.time.LocalDateTime;
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-12 * @since 2021-07-22
*/ */
@TableName("follow_rel") @TableName("follow_rel")
@ApiModel(value="FollowRelEntity对象", description="粉丝关系")
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@ApiModel(value="FollowRelEntity对象", description="粉丝关系")
public class FollowRelEntity implements Serializable { public class FollowRelEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Integer id; private Long id;
@ApiModelProperty(value = "被关注的人id") @ApiModelProperty(value = "被关注的人id")
private String followUserId; private String followUserId;
...@@ -52,11 +51,11 @@ public class FollowRelEntity implements Serializable { ...@@ -52,11 +51,11 @@ public class FollowRelEntity implements Serializable {
private Integer deleteTag; private Integer deleteTag;
public Integer getId() { public Long getId() {
return id; return id;
} }
public void setId(Integer id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
......
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 com.baomidou.mybatisplus.annotation.TableName; import java.time.LocalDateTime;
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-07 * @since 2021-07-22
*/ */
@TableName("home_page") @TableName("home_page")
@ApiModel(value="HomePageEntity对象", description="个人主页")
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@ApiModel(value="HomePageEntity对象", description="个人主页")
public class HomePageEntity implements Serializable { public class HomePageEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Integer id; private Long id;
@ApiModelProperty(value = "用户id") @ApiModelProperty(value = "用户id")
private String userId; private String userId;
...@@ -58,11 +57,11 @@ public class HomePageEntity implements Serializable { ...@@ -58,11 +57,11 @@ public class HomePageEntity implements Serializable {
private Integer deleteTag; private Integer deleteTag;
public Integer getId() { public Long getId() {
return id; return id;
} }
public void setId(Integer id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
......
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 com.baomidou.mybatisplus.annotation.TableName; import java.time.LocalDateTime;
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-21 * @since 2021-07-22
*/ */
@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;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Integer id; private Long id;
@ApiModelProperty(value = "主题主键Id") @ApiModelProperty(value = "主题主键Id")
private String themeId; private String themeId;
...@@ -68,11 +67,11 @@ public class ThemeEntity implements Serializable { ...@@ -68,11 +67,11 @@ public class ThemeEntity implements Serializable {
private Integer deleteTag; private Integer deleteTag;
public Integer getId() { public Long getId() {
return id; return id;
} }
public void setId(Integer id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
......
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 com.baomidou.mybatisplus.annotation.TableName; import java.time.LocalDateTime;
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-07 * @since 2021-07-22
*/ */
@TableName("topic") @TableName("topic")
@ApiModel(value="TopicEntity对象", description="话题")
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@ApiModel(value="TopicEntity对象", description="话题")
public class TopicEntity implements Serializable { public class TopicEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Integer id; private Long id;
@ApiModelProperty(value = "uuid") @ApiModelProperty(value = "话题主键Id")
private String topicId; private String topicId;
@ApiModelProperty(value = "话题名称") @ApiModelProperty(value = "话题名称")
...@@ -45,7 +44,7 @@ public class TopicEntity implements Serializable { ...@@ -45,7 +44,7 @@ public class TopicEntity implements Serializable {
@ApiModelProperty(value = "是否隐藏") @ApiModelProperty(value = "是否隐藏")
private Integer isConceal; private Integer isConceal;
@ApiModelProperty(value = "浏览量调整") @ApiModelProperty(value = "浏览量调整基数")
private Long viewCntAdjust; private Long viewCntAdjust;
private LocalDateTime createTime; private LocalDateTime createTime;
...@@ -55,11 +54,11 @@ public class TopicEntity implements Serializable { ...@@ -55,11 +54,11 @@ public class TopicEntity implements Serializable {
private Integer deleteTag; private Integer deleteTag;
public Integer getId() { public Long getId() {
return id; return id;
} }
public void setId(Integer id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
...@@ -95,12 +94,12 @@ public class TopicEntity implements Serializable { ...@@ -95,12 +94,12 @@ public class TopicEntity implements Serializable {
this.isConceal = isConceal; this.isConceal = isConceal;
} }
public Long getviewCntAdjust() { public Long getViewCntAdjust() {
return viewCntAdjust; return viewCntAdjust;
} }
public void setViewAmountModify(Long viewAmountModify) { public void setViewCntAdjust(Long viewCntAdjust) {
this.viewCntAdjust = viewAmountModify; this.viewCntAdjust = viewCntAdjust;
} }
public LocalDateTime getCreateTime() { public LocalDateTime getCreateTime() {
...@@ -135,7 +134,7 @@ public class TopicEntity implements Serializable { ...@@ -135,7 +134,7 @@ public class TopicEntity implements Serializable {
", topicTitle=" + topicTitle + ", topicTitle=" + topicTitle +
", isTop=" + isTop + ", isTop=" + isTop +
", isConceal=" + isConceal + ", isConceal=" + isConceal +
", viewAmountModify=" + viewCntAdjust + ", viewCntAdjust=" + viewCntAdjust +
", createTime=" + createTime + ", createTime=" + createTime +
", updateTime=" + updateTime + ", updateTime=" + updateTime +
", deleteTag=" + deleteTag + ", deleteTag=" + deleteTag +
......
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.TableName;
import java.time.LocalDateTime;
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-19 * @since 2021-07-22
*/ */
@TableName("visit_summary") @TableName("visit_summary")
@ApiModel(value="VisitSummaryEntity对象", description="浏览记录")
@Builder
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@Builder
@ApiModel(value="VisitSummaryEntity对象", description="浏览记录")
public class VisitSummaryEntity implements Serializable { public class VisitSummaryEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private String id; private Long id;
@ApiModelProperty(value = "session_id") @ApiModelProperty(value = "session_id")
private String ident; private String ident;
...@@ -55,11 +54,11 @@ public class VisitSummaryEntity implements Serializable { ...@@ -55,11 +54,11 @@ public class VisitSummaryEntity implements Serializable {
private Integer deleteTag; private Integer deleteTag;
public String getId() { public Long getId() {
return id; return id;
} }
public void setId(String id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
......
...@@ -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-07 * @since 2021-07-22
*/ */
public interface BlackListMapper extends BaseMapper<BlackListEntity> { public interface BlackListMapper extends BaseMapper<BlackListEntity> {
......
...@@ -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-07 * @since 2021-07-22
*/ */
public interface CollectionMapper extends BaseMapper<CollectionEntity> { public interface CollectionMapper extends BaseMapper<CollectionEntity> {
......
...@@ -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-21 * @since 2021-07-22
*/ */
public interface CommentMapper extends BaseMapper<CommentEntity> { public interface CommentMapper extends BaseMapper<CommentEntity> {
......
...@@ -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-07 * @since 2021-07-22
*/ */
public interface FollowRelMapper extends BaseMapper<FollowRelEntity> { public interface FollowRelMapper extends BaseMapper<FollowRelEntity> {
......
...@@ -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-07 * @since 2021-07-22
*/ */
public interface HomePageMapper extends BaseMapper<HomePageEntity> { public interface HomePageMapper extends BaseMapper<HomePageEntity> {
......
...@@ -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-21 * @since 2021-07-22
*/ */
public interface ThemeMapper extends BaseMapper<ThemeEntity> { public interface ThemeMapper extends BaseMapper<ThemeEntity> {
......
...@@ -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-07 * @since 2021-07-22
*/ */
public interface TopicMapper extends BaseMapper<TopicEntity> { public interface TopicMapper extends BaseMapper<TopicEntity> {
......
...@@ -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-19 * @since 2021-07-22
*/ */
public interface VisitSummaryMapper extends BaseMapper<VisitSummaryEntity> { public interface VisitSummaryMapper extends BaseMapper<VisitSummaryEntity> {
......
...@@ -9,8 +9,6 @@ import org.springframework.context.annotation.Configuration; ...@@ -9,8 +9,6 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
@Slf4j @Slf4j
@Service @Service
@Configuration @Configuration
...@@ -36,11 +34,10 @@ public class ConJobManager { ...@@ -36,11 +34,10 @@ public class ConJobManager {
} }
/** /**
* 定时统计主题排行 * 定时统计主题、话题排行
*/ */
@Scheduled(cron = "0 */2 * * * ?") @Scheduled(cron = "0 */2 * * * ?")
public void themeRank() { public void themeRank() {
System.out.println(LocalDateTime.now());
rankService.rankThemes(); rankService.rankThemes();
rankService.rankTopics(); rankService.rankTopics();
} }
......
...@@ -72,9 +72,9 @@ public class HomePageManager { ...@@ -72,9 +72,9 @@ public class HomePageManager {
CommonResp<UserInfoNew> queryUsersListNew = feignClientForFatools.queryUsersListNew(StringUtils.isNotBlank(userId) ? userId : userIdMyself); CommonResp<UserInfoNew> queryUsersListNew = feignClientForFatools.queryUsersListNew(StringUtils.isNotBlank(userId) ? userId : userIdMyself);
if (queryUsersListNew.isNotSuccess()) new BizException("内部接口调用失败"); if (queryUsersListNew.isNotSuccess()) new BizException("内部接口调用失败");
UserInfoNew userInfoNew = queryUsersListNew.getData(); UserInfoNew userInfoNew = queryUsersListNew.getData();
// 关注 按钮的显示逻辑
if (StringUtils.isNotBlank(userId) && !StringUtils.equals(userIdMyself, userId)) { //查询别人的个人主页 if (StringUtils.isNotBlank(userId) && !StringUtils.equals(userIdMyself, userId)) { //查询别人的个人主页
//是否已关注 // 关注 按钮的显示逻辑
FollowRelEntity followRelEntity = followRelService.queryRecord(userId, userIdMyself); FollowRelEntity followRelEntity = followRelService.queryRecord(userId, userIdMyself);
if (ObjectUtils.allNotNull(followRelEntity) && BizStatus.DeleteTag.tag_init == followRelEntity.getDeleteTag()){ if (ObjectUtils.allNotNull(followRelEntity) && BizStatus.DeleteTag.tag_init == followRelEntity.getDeleteTag()){
userInfoNew.setShowFollowStatus(1); // 已关注 userInfoNew.setShowFollowStatus(1); // 已关注
...@@ -91,8 +91,8 @@ public class HomePageManager { ...@@ -91,8 +91,8 @@ public class HomePageManager {
// 主页类型 显示逻辑 // 主页类型 显示逻辑
if (50 == userInfoNew.getLevelGrade()){ if (50 == userInfoNew.getLevelGrade()){
// 首席投顾
userInfoNew.setPersonalCenterType(2); userInfoNew.setPersonalCenterType(2);
// 首席投顾 添加专栏信息 (前端自己取)
// 成功案例客户 // 成功案例客户
// 默认显示该投顾管理的客户里,总资产最高的客户 // 默认显示该投顾管理的客户里,总资产最高的客户
if (StringUtils.isBlank(userInfoNew.getUserInfoNewChief().getClientId())) { if (StringUtils.isBlank(userInfoNew.getUserInfoNewChief().getClientId())) {
......
package com.tanpu.community.manager;
import com.alibaba.fastjson.JSON;
import com.tanpu.community.api.beans.vo.KafkaDurationUptMsg;
import com.tanpu.community.service.VisitSummaryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class KafkaManager {
@Autowired
private KafkaTemplate<String, String> kafkaTemplate;
@Autowired
private VisitSummaryService visitSummaryService;
// public void sendMessage(String message) {
// System.out.println("#### send " + message);
// this.kafkaTemplate.send("users", message);
// }
// todo topic
@KafkaListener(topics = "newCommunityVisitor")
public void consumeVisitorHis(String message) {
System.out.println("#### receive " + message);
}
// todo topic
@KafkaListener(topics = "newCommunityVisitor")
public void consumeDurationUpdate(String message) {
KafkaDurationUptMsg msg = JSON.parseObject(message, KafkaDurationUptMsg.class);
visitSummaryService.updateDurByIdent(msg.getIdent(), msg.getDurMillsInc().intValue());
}
}
...@@ -110,7 +110,7 @@ public class TopicManager { ...@@ -110,7 +110,7 @@ public class TopicManager {
List<TopicEntity> topicEntities = topicService.queryAll(); List<TopicEntity> topicEntities = topicService.queryAll();
for (TopicEntity topic : topicEntities) { for (TopicEntity topic : topicEntities) {
String topicId = topic.getTopicId(); String topicId = topic.getTopicId();
Long viewCountModify = topic.getviewCntAdjust(); Long viewCountModify = topic.getViewCntAdjust();
List<String> themeIds = themeService.queryThemeIdsByTopic(topicId); List<String> themeIds = themeService.queryThemeIdsByTopic(topicId);
Integer likeCountByThemeIds = collectionService.getCountByTypeAndIds(themeIds, CollectionTypeEnum.LIKE_THEME); Integer likeCountByThemeIds = collectionService.getCountByTypeAndIds(themeIds, CollectionTypeEnum.LIKE_THEME);
Integer bookCountByThemeIds = collectionService.getCountByTypeAndIds(themeIds, CollectionTypeEnum.COLLECT_THEME); Integer bookCountByThemeIds = collectionService.getCountByTypeAndIds(themeIds, CollectionTypeEnum.COLLECT_THEME);
......
package com.tanpu.community.manager; package com.tanpu.community.manager;
import com.alibaba.fastjson.JSON;
import com.tanpu.common.auth.UserHolder; import com.tanpu.common.auth.UserHolder;
import com.tanpu.community.api.beans.vo.KafkaDurationUptMsg;
import com.tanpu.community.api.enums.VisitTypeEnum; import com.tanpu.community.api.enums.VisitTypeEnum;
import com.tanpu.community.dao.entity.community.VisitSummaryEntity;
import com.tanpu.community.service.VisitSummaryService; import com.tanpu.community.service.VisitSummaryService;
import com.tanpu.community.util.ConvertUtil;
import lombok.extern.slf4j.Slf4j;
import org.elasticsearch.common.recycler.Recycler;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
@Slf4j
@Service @Service
public class VisitSummaryManager { public class VisitSummaryManager {
@Resource private static final String kafakTopic = "tp_new_community_queue_ubr_dur_upd";
@Autowired
private KafkaTemplate<String, String> kafkaTemplate;
@Autowired
private VisitSummaryService visitSummaryService; private VisitSummaryService visitSummaryService;
@Autowired @Autowired
private UserHolder userHolder; private UserHolder userHolder;
@KafkaListener(topics = kafakTopic)
public void updateVisitSummary(String message) {
KafkaDurationUptMsg msg = JSON.parseObject(message, KafkaDurationUptMsg.class);
// ident在每次进入新页面 & 回退 的时候都会随机生成一个,所以用ident做唯一key即可。
VisitSummaryEntity vs = ConvertUtil.convertFromKafka(msg);
}
public void addTopicPageView(String topicId) { public void addTopicPageView(String topicId) {
String userId = userHolder.getUserId(); String userId = userHolder.getUserId();
visitSummaryService.addPageView(userId, topicId, VisitTypeEnum.TOPIC_PAGE_VIEW); visitSummaryService.addPageView(userId, topicId, VisitTypeEnum.TOPIC_PAGE_VIEW);
...@@ -31,5 +58,4 @@ public class VisitSummaryManager { ...@@ -31,5 +58,4 @@ public class VisitSummaryManager {
String userId = userHolder.getUserId(); String userId = userHolder.getUserId();
visitSummaryService.addPageView(userId, userId, VisitTypeEnum.FOLLOW_THEME_VIEW); visitSummaryService.addPageView(userId, userId, VisitTypeEnum.FOLLOW_THEME_VIEW);
} }
} }
...@@ -95,10 +95,10 @@ public class TopicService { ...@@ -95,10 +95,10 @@ public class TopicService {
public void modifyViewCount(String topicId, long Count) { public void modifyViewCount(String topicId, long Count) {
TopicEntity topicEntity = queryById(topicId); TopicEntity topicEntity = queryById(topicId);
Long oldCount = topicEntity.getviewCntAdjust(); Long oldCount = topicEntity.getViewCntAdjust();
topicEntity.setViewAmountModify(topicEntity.getviewCntAdjust() + Count); topicEntity.setViewAmountModify(topicEntity.getViewCntAdjust() + Count);
topicMapper.update(topicEntity, new LambdaUpdateWrapper<TopicEntity>() topicMapper.update(topicEntity, new LambdaUpdateWrapper<TopicEntity>()
.eq(TopicEntity::getviewCntAdjust, oldCount)); .eq(TopicEntity::getViewCntAdjust, oldCount));
return; return;
} }
......
...@@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.type.TypeReference; ...@@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
import com.tanpu.common.util.JsonUtil; import com.tanpu.common.util.JsonUtil;
import com.tanpu.community.api.beans.resp.FileUploadResp; import com.tanpu.community.api.beans.resp.FileUploadResp;
import com.tanpu.community.api.beans.vo.ImagesDTO; import com.tanpu.community.api.beans.vo.ImagesDTO;
import com.tanpu.community.api.beans.vo.KafkaDurationUptMsg;
import com.tanpu.community.api.beans.vo.TopicDTO; import com.tanpu.community.api.beans.vo.TopicDTO;
import com.tanpu.community.api.beans.qo.*; import com.tanpu.community.api.beans.qo.*;
import com.tanpu.community.api.beans.req.theme.CreateThemeReq; import com.tanpu.community.api.beans.req.theme.CreateThemeReq;
...@@ -14,6 +15,7 @@ import com.tanpu.community.api.enums.RelTypeEnum; ...@@ -14,6 +15,7 @@ import com.tanpu.community.api.enums.RelTypeEnum;
import com.tanpu.community.api.enums.TopicStatusEnum; import com.tanpu.community.api.enums.TopicStatusEnum;
import com.tanpu.community.dao.entity.community.*; import com.tanpu.community.dao.entity.community.*;
import com.tanpu.community.dao.entity.user.UserInfoEntity; import com.tanpu.community.dao.entity.user.UserInfoEntity;
import org.elasticsearch.common.recycler.Recycler;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
...@@ -27,6 +29,9 @@ import java.util.stream.Collectors; ...@@ -27,6 +29,9 @@ import java.util.stream.Collectors;
public class ConvertUtil { public class ConvertUtil {
/**
* THEME
*/
public static ThemeQo themeEntityToQo(ThemeEntity themeEntity) { public static ThemeQo themeEntityToQo(ThemeEntity themeEntity) {
if (themeEntity == null) { if (themeEntity == null) {
return null; return null;
...@@ -88,6 +93,9 @@ public class ConvertUtil { ...@@ -88,6 +93,9 @@ public class ConvertUtil {
} }
/**
* TOPIC
*/
public static TopicDTO topicEntityToDTO(TopicEntity topicEntity) { public static TopicDTO topicEntityToDTO(TopicEntity topicEntity) {
TopicDTO topicDTO = new TopicDTO(); TopicDTO topicDTO = new TopicDTO();
BeanUtils.copyProperties(topicEntity, topicDTO); BeanUtils.copyProperties(topicEntity, topicDTO);
...@@ -163,6 +171,22 @@ public class ConvertUtil { ...@@ -163,6 +171,22 @@ public class ConvertUtil {
} }
} }
/**
* VISIT_SUMMARY
*/
public static VisitSummaryEntity convertFromKafka(KafkaDurationUptMsg msg) {
VisitSummaryEntity vs = new VisitSummaryEntity();
vs.setAuthorId(msg.pidUserId);
vs.setDeleteTag(DeleteTagEnum.NOT_DELETED.ordinal());
vs.setDuration(1);
vs.setIdent(msg.ident);
vs.setRefId(msg.refId);
// todo
vs.setRefType(-1);
vs.setVisitorId(msg.visitorId);
return vs;
}
/** /**
* 解析 List<ThemeContentReq>为Attachment列表 * 解析 List<ThemeContentReq>为Attachment列表
* *
......
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