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
d6bea770
Commit
d6bea770
authored
Jul 22, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Plain Diff
举报主题、举报评论
parents
4a9778cb
548def1c
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
144 additions
and
140 deletions
+144
-140
KafkaDurationUptMsg.java
...com/tanpu/community/api/beans/vo/KafkaDurationUptMsg.java
+9
-2
BlackListEntity.java
...tanpu/community/dao/entity/community/BlackListEntity.java
+8
-9
CollectionEntity.java
...anpu/community/dao/entity/community/CollectionEntity.java
+5
-6
CommentEntity.java
...m/tanpu/community/dao/entity/community/CommentEntity.java
+8
-9
FollowRelEntity.java
...tanpu/community/dao/entity/community/FollowRelEntity.java
+8
-9
HomePageEntity.java
.../tanpu/community/dao/entity/community/HomePageEntity.java
+8
-9
ThemeEntity.java
...com/tanpu/community/dao/entity/community/ThemeEntity.java
+8
-9
TopicEntity.java
...com/tanpu/community/dao/entity/community/TopicEntity.java
+14
-15
VisitSummaryEntity.java
...pu/community/dao/entity/community/VisitSummaryEntity.java
+8
-9
BlackListMapper.java
...tanpu/community/dao/mapper/community/BlackListMapper.java
+1
-1
CollectionMapper.java
...anpu/community/dao/mapper/community/CollectionMapper.java
+1
-1
CommentMapper.java
...m/tanpu/community/dao/mapper/community/CommentMapper.java
+1
-1
FollowRelMapper.java
...tanpu/community/dao/mapper/community/FollowRelMapper.java
+1
-1
HomePageMapper.java
.../tanpu/community/dao/mapper/community/HomePageMapper.java
+1
-1
ThemeMapper.java
...com/tanpu/community/dao/mapper/community/ThemeMapper.java
+1
-1
TopicMapper.java
...com/tanpu/community/dao/mapper/community/TopicMapper.java
+1
-1
VisitSummaryMapper.java
...pu/community/dao/mapper/community/VisitSummaryMapper.java
+1
-1
ConJobManager.java
.../main/java/com/tanpu/community/manager/ConJobManager.java
+1
-4
HomePageManager.java
...ain/java/com/tanpu/community/manager/HomePageManager.java
+3
-3
KafkaManager.java
...c/main/java/com/tanpu/community/manager/KafkaManager.java
+0
-42
TopicManager.java
...c/main/java/com/tanpu/community/manager/TopicManager.java
+1
-1
VisitSummaryManager.java
...java/com/tanpu/community/manager/VisitSummaryManager.java
+28
-2
TopicService.java
...c/main/java/com/tanpu/community/service/TopicService.java
+3
-3
ConvertUtil.java
...e/src/main/java/com/tanpu/community/util/ConvertUtil.java
+24
-0
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/vo/KafkaDurationUptMsg.java
View file @
d6bea770
...
...
@@ -6,6 +6,13 @@ import java.time.LocalDate;
@Data
public
class
KafkaDurationUptMsg
{
private
String
ident
;
private
Long
durMillsInc
;
public
String
ident
;
public
long
durMillsInc
;
public
String
pidUuid
;
public
String
pidUserId
;
public
String
visitorId
;
public
String
faId
;
public
String
pageId
;
public
String
refId
;
public
LocalDate
localDate
;
}
community-service/src/main/java/com/tanpu/community/dao/entity/community/BlackListEntity.java
View file @
d6bea770
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
com.baomidou.mybatisplus.annotation.TableName
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
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-
07
* @since 2021-07-
22
*/
@TableName
(
"black_list"
)
@ApiModel
(
value
=
"BlackListEntity对象"
,
description
=
"黑名单"
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"BlackListEntity对象"
,
description
=
"黑名单"
)
public
class
BlackListEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"id"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
private
Long
id
;
@ApiModelProperty
(
value
=
"屏蔽发起人"
)
private
String
blocker
;
...
...
@@ -51,11 +50,11 @@ public class BlackListEntity implements Serializable {
private
Integer
deleteTag
;
public
Integer
getId
()
{
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
...
...
community-service/src/main/java/com/tanpu/community/dao/entity/community/CollectionEntity.java
View file @
d6bea770
package
com
.
tanpu
.
community
.
dao
.
entity
.
community
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
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-
07
* @since 2021-07-
22
*/
@TableName
(
"collection"
)
@ApiModel
(
value
=
"CollectionEntity对象"
,
description
=
"收藏/点赞"
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"CollectionEntity对象"
,
description
=
"收藏/点赞"
)
public
class
CollectionEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
@@ -30,7 +29,7 @@ public class CollectionEntity implements Serializable {
@ApiModelProperty
(
value
=
"id"
)
private
String
id
;
@ApiModelProperty
(
value
=
"类型 1:点赞
,2:收藏
"
)
@ApiModelProperty
(
value
=
"类型 1:点赞
主题,2:收藏主题 3、点赞评论
"
)
private
Integer
collectionType
;
@ApiModelProperty
(
value
=
"用户id"
)
...
...
community-service/src/main/java/com/tanpu/community/dao/entity/community/CommentEntity.java
View file @
d6bea770
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
com.baomidou.mybatisplus.annotation.TableName
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
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
1
* @since 2021-07-2
2
*/
@TableName
(
"comment"
)
@ApiModel
(
value
=
"CommentEntity对象"
,
description
=
"评论"
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"CommentEntity对象"
,
description
=
"评论"
)
public
class
CommentEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"id"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
private
Long
id
;
@ApiModelProperty
(
value
=
"评论主键Id"
)
private
String
commentId
;
...
...
@@ -67,11 +66,11 @@ public class CommentEntity implements Serializable {
private
Integer
deleteTag
;
public
Integer
getId
()
{
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
...
...
community-service/src/main/java/com/tanpu/community/dao/entity/community/FollowRelEntity.java
View file @
d6bea770
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
com.baomidou.mybatisplus.annotation.TableName
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
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-
1
2
* @since 2021-07-
2
2
*/
@TableName
(
"follow_rel"
)
@ApiModel
(
value
=
"FollowRelEntity对象"
,
description
=
"粉丝关系"
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"FollowRelEntity对象"
,
description
=
"粉丝关系"
)
public
class
FollowRelEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"id"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
private
Long
id
;
@ApiModelProperty
(
value
=
"被关注的人id"
)
private
String
followUserId
;
...
...
@@ -52,11 +51,11 @@ public class FollowRelEntity implements Serializable {
private
Integer
deleteTag
;
public
Integer
getId
()
{
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
...
...
community-service/src/main/java/com/tanpu/community/dao/entity/community/HomePageEntity.java
View file @
d6bea770
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
com.baomidou.mybatisplus.annotation.TableName
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
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-
07
* @since 2021-07-
22
*/
@TableName
(
"home_page"
)
@ApiModel
(
value
=
"HomePageEntity对象"
,
description
=
"个人主页"
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"HomePageEntity对象"
,
description
=
"个人主页"
)
public
class
HomePageEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"id"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
private
Long
id
;
@ApiModelProperty
(
value
=
"用户id"
)
private
String
userId
;
...
...
@@ -58,11 +57,11 @@ public class HomePageEntity implements Serializable {
private
Integer
deleteTag
;
public
Integer
getId
()
{
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
...
...
community-service/src/main/java/com/tanpu/community/dao/entity/community/ThemeEntity.java
View file @
d6bea770
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
com.baomidou.mybatisplus.annotation.TableName
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
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
1
* @since 2021-07-2
2
*/
@TableName
(
"theme"
)
@ApiModel
(
value
=
"ThemeEntity对象"
,
description
=
"主题内容"
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"ThemeEntity对象"
,
description
=
"主题内容"
)
public
class
ThemeEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"id"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
private
Long
id
;
@ApiModelProperty
(
value
=
"主题主键Id"
)
private
String
themeId
;
...
...
@@ -68,11 +67,11 @@ public class ThemeEntity implements Serializable {
private
Integer
deleteTag
;
public
Integer
getId
()
{
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
...
...
community-service/src/main/java/com/tanpu/community/dao/entity/community/TopicEntity.java
View file @
d6bea770
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
com.baomidou.mybatisplus.annotation.TableName
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
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-
07
* @since 2021-07-
22
*/
@TableName
(
"topic"
)
@ApiModel
(
value
=
"TopicEntity对象"
,
description
=
"话题"
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
(
value
=
"TopicEntity对象"
,
description
=
"话题"
)
public
class
TopicEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"id"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
private
Long
id
;
@ApiModelProperty
(
value
=
"
uui
d"
)
@ApiModelProperty
(
value
=
"
话题主键I
d"
)
private
String
topicId
;
@ApiModelProperty
(
value
=
"话题名称"
)
...
...
@@ -45,7 +44,7 @@ public class TopicEntity implements Serializable {
@ApiModelProperty
(
value
=
"是否隐藏"
)
private
Integer
isConceal
;
@ApiModelProperty
(
value
=
"浏览量调整"
)
@ApiModelProperty
(
value
=
"浏览量调整
基数
"
)
private
Long
viewCntAdjust
;
private
LocalDateTime
createTime
;
...
...
@@ -55,11 +54,11 @@ public class TopicEntity implements Serializable {
private
Integer
deleteTag
;
public
Integer
getId
()
{
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
...
...
@@ -95,12 +94,12 @@ public class TopicEntity implements Serializable {
this
.
isConceal
=
isConceal
;
}
public
Long
get
v
iewCntAdjust
()
{
public
Long
get
V
iewCntAdjust
()
{
return
viewCntAdjust
;
}
public
void
setView
AmountModify
(
Long
viewAmountModify
)
{
this
.
viewCntAdjust
=
view
AmountModify
;
public
void
setView
CntAdjust
(
Long
viewCntAdjust
)
{
this
.
viewCntAdjust
=
view
CntAdjust
;
}
public
LocalDateTime
getCreateTime
()
{
...
...
@@ -135,7 +134,7 @@ public class TopicEntity implements Serializable {
", topicTitle="
+
topicTitle
+
", isTop="
+
isTop
+
", isConceal="
+
isConceal
+
", view
AmountModify
="
+
viewCntAdjust
+
", view
CntAdjust
="
+
viewCntAdjust
+
", createTime="
+
createTime
+
", updateTime="
+
updateTime
+
", deleteTag="
+
deleteTag
+
...
...
community-service/src/main/java/com/tanpu/community/dao/entity/community/VisitSummaryEntity.java
View file @
d6bea770
package
com
.
tanpu
.
community
.
dao
.
entity
.
community
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
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-
19
* @since 2021-07-
22
*/
@TableName
(
"visit_summary"
)
@ApiModel
(
value
=
"VisitSummaryEntity对象"
,
description
=
"浏览记录"
)
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel
(
value
=
"VisitSummaryEntity对象"
,
description
=
"浏览记录"
)
public
class
VisitSummaryEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"id"
)
private
Stri
ng
id
;
private
Lo
ng
id
;
@ApiModelProperty
(
value
=
"session_id"
)
private
String
ident
;
...
...
@@ -55,11 +54,11 @@ public class VisitSummaryEntity implements Serializable {
private
Integer
deleteTag
;
public
Stri
ng
getId
()
{
public
Lo
ng
getId
()
{
return
id
;
}
public
void
setId
(
Stri
ng
id
)
{
public
void
setId
(
Lo
ng
id
)
{
this
.
id
=
id
;
}
...
...
community-service/src/main/java/com/tanpu/community/dao/mapper/community/BlackListMapper.java
View file @
d6bea770
...
...
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p>
*
* @author xudong
* @since 2021-07-
07
* @since 2021-07-
22
*/
public
interface
BlackListMapper
extends
BaseMapper
<
BlackListEntity
>
{
...
...
community-service/src/main/java/com/tanpu/community/dao/mapper/community/CollectionMapper.java
View file @
d6bea770
...
...
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p>
*
* @author xudong
* @since 2021-07-
07
* @since 2021-07-
22
*/
public
interface
CollectionMapper
extends
BaseMapper
<
CollectionEntity
>
{
...
...
community-service/src/main/java/com/tanpu/community/dao/mapper/community/CommentMapper.java
View file @
d6bea770
...
...
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p>
*
* @author xudong
* @since 2021-07-2
1
* @since 2021-07-2
2
*/
public
interface
CommentMapper
extends
BaseMapper
<
CommentEntity
>
{
...
...
community-service/src/main/java/com/tanpu/community/dao/mapper/community/FollowRelMapper.java
View file @
d6bea770
...
...
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p>
*
* @author xudong
* @since 2021-07-
07
* @since 2021-07-
22
*/
public
interface
FollowRelMapper
extends
BaseMapper
<
FollowRelEntity
>
{
...
...
community-service/src/main/java/com/tanpu/community/dao/mapper/community/HomePageMapper.java
View file @
d6bea770
...
...
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p>
*
* @author xudong
* @since 2021-07-
07
* @since 2021-07-
22
*/
public
interface
HomePageMapper
extends
BaseMapper
<
HomePageEntity
>
{
...
...
community-service/src/main/java/com/tanpu/community/dao/mapper/community/ThemeMapper.java
View file @
d6bea770
...
...
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p>
*
* @author xudong
* @since 2021-07-2
1
* @since 2021-07-2
2
*/
public
interface
ThemeMapper
extends
BaseMapper
<
ThemeEntity
>
{
...
...
community-service/src/main/java/com/tanpu/community/dao/mapper/community/TopicMapper.java
View file @
d6bea770
...
...
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p>
*
* @author xudong
* @since 2021-07-
07
* @since 2021-07-
22
*/
public
interface
TopicMapper
extends
BaseMapper
<
TopicEntity
>
{
...
...
community-service/src/main/java/com/tanpu/community/dao/mapper/community/VisitSummaryMapper.java
View file @
d6bea770
...
...
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* </p>
*
* @author xudong
* @since 2021-07-
19
* @since 2021-07-
22
*/
public
interface
VisitSummaryMapper
extends
BaseMapper
<
VisitSummaryEntity
>
{
...
...
community-service/src/main/java/com/tanpu/community/manager/ConJobManager.java
View file @
d6bea770
...
...
@@ -9,8 +9,6 @@ import org.springframework.context.annotation.Configuration;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
@Slf4j
@Service
@Configuration
...
...
@@ -36,11 +34,10 @@ public class ConJobManager {
}
/**
* 定时统计主题排行
* 定时统计主题
、话题
排行
*/
@Scheduled
(
cron
=
"0 */2 * * * ?"
)
public
void
themeRank
()
{
System
.
out
.
println
(
LocalDateTime
.
now
());
rankService
.
rankThemes
();
rankService
.
rankTopics
();
}
...
...
community-service/src/main/java/com/tanpu/community/manager/HomePageManager.java
View file @
d6bea770
...
...
@@ -72,9 +72,9 @@ public class HomePageManager {
CommonResp
<
UserInfoNew
>
queryUsersListNew
=
feignClientForFatools
.
queryUsersListNew
(
StringUtils
.
isNotBlank
(
userId
)
?
userId
:
userIdMyself
);
if
(
queryUsersListNew
.
isNotSuccess
())
new
BizException
(
"内部接口调用失败"
);
UserInfoNew
userInfoNew
=
queryUsersListNew
.
getData
();
// 关注 按钮的显示逻辑
if
(
StringUtils
.
isNotBlank
(
userId
)
&&
!
StringUtils
.
equals
(
userIdMyself
,
userId
))
{
//查询别人的个人主页
//
是否已关注
//
关注 按钮的显示逻辑
FollowRelEntity
followRelEntity
=
followRelService
.
queryRecord
(
userId
,
userIdMyself
);
if
(
ObjectUtils
.
allNotNull
(
followRelEntity
)
&&
BizStatus
.
DeleteTag
.
tag_init
==
followRelEntity
.
getDeleteTag
()){
userInfoNew
.
setShowFollowStatus
(
1
);
// 已关注
...
...
@@ -91,8 +91,8 @@ public class HomePageManager {
// 主页类型 显示逻辑
if
(
50
==
userInfoNew
.
getLevelGrade
()){
// 首席投顾
userInfoNew
.
setPersonalCenterType
(
2
);
// 首席投顾 添加专栏信息 (前端自己取)
// 成功案例客户
// 默认显示该投顾管理的客户里,总资产最高的客户
if
(
StringUtils
.
isBlank
(
userInfoNew
.
getUserInfoNewChief
().
getClientId
()))
{
...
...
community-service/src/main/java/com/tanpu/community/manager/KafkaManager.java
deleted
100644 → 0
View file @
4a9778cb
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
());
}
}
community-service/src/main/java/com/tanpu/community/manager/TopicManager.java
View file @
d6bea770
...
...
@@ -110,7 +110,7 @@ public class TopicManager {
List
<
TopicEntity
>
topicEntities
=
topicService
.
queryAll
();
for
(
TopicEntity
topic
:
topicEntities
)
{
String
topicId
=
topic
.
getTopicId
();
Long
viewCountModify
=
topic
.
get
v
iewCntAdjust
();
Long
viewCountModify
=
topic
.
get
V
iewCntAdjust
();
List
<
String
>
themeIds
=
themeService
.
queryThemeIdsByTopic
(
topicId
);
Integer
likeCountByThemeIds
=
collectionService
.
getCountByTypeAndIds
(
themeIds
,
CollectionTypeEnum
.
LIKE_THEME
);
Integer
bookCountByThemeIds
=
collectionService
.
getCountByTypeAndIds
(
themeIds
,
CollectionTypeEnum
.
COLLECT_THEME
);
...
...
community-service/src/main/java/com/tanpu/community/manager/VisitSummaryManager.java
View file @
d6bea770
package
com
.
tanpu
.
community
.
manager
;
import
com.alibaba.fastjson.JSON
;
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.dao.entity.community.VisitSummaryEntity
;
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.kafka.annotation.KafkaListener
;
import
org.springframework.kafka.core.KafkaTemplate
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
@Slf4j
@Service
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
;
@Autowired
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
)
{
String
userId
=
userHolder
.
getUserId
();
visitSummaryService
.
addPageView
(
userId
,
topicId
,
VisitTypeEnum
.
TOPIC_PAGE_VIEW
);
...
...
@@ -31,5 +58,4 @@ public class VisitSummaryManager {
String
userId
=
userHolder
.
getUserId
();
visitSummaryService
.
addPageView
(
userId
,
userId
,
VisitTypeEnum
.
FOLLOW_THEME_VIEW
);
}
}
community-service/src/main/java/com/tanpu/community/service/TopicService.java
View file @
d6bea770
...
...
@@ -95,10 +95,10 @@ public class TopicService {
public
void
modifyViewCount
(
String
topicId
,
long
Count
)
{
TopicEntity
topicEntity
=
queryById
(
topicId
);
Long
oldCount
=
topicEntity
.
get
v
iewCntAdjust
();
topicEntity
.
setViewAmountModify
(
topicEntity
.
get
v
iewCntAdjust
()
+
Count
);
Long
oldCount
=
topicEntity
.
get
V
iewCntAdjust
();
topicEntity
.
setViewAmountModify
(
topicEntity
.
get
V
iewCntAdjust
()
+
Count
);
topicMapper
.
update
(
topicEntity
,
new
LambdaUpdateWrapper
<
TopicEntity
>()
.
eq
(
TopicEntity:
:
get
v
iewCntAdjust
,
oldCount
));
.
eq
(
TopicEntity:
:
get
V
iewCntAdjust
,
oldCount
));
return
;
}
...
...
community-service/src/main/java/com/tanpu/community/util/ConvertUtil.java
View file @
d6bea770
...
...
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
import
com.tanpu.common.util.JsonUtil
;
import
com.tanpu.community.api.beans.resp.FileUploadResp
;
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.qo.*
;
import
com.tanpu.community.api.beans.req.theme.CreateThemeReq
;
...
...
@@ -14,6 +15,7 @@ import com.tanpu.community.api.enums.RelTypeEnum;
import
com.tanpu.community.api.enums.TopicStatusEnum
;
import
com.tanpu.community.dao.entity.community.*
;
import
com.tanpu.community.dao.entity.user.UserInfoEntity
;
import
org.elasticsearch.common.recycler.Recycler
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.util.StringUtils
;
...
...
@@ -27,6 +29,9 @@ import java.util.stream.Collectors;
public
class
ConvertUtil
{
/**
* THEME
*/
public
static
ThemeQo
themeEntityToQo
(
ThemeEntity
themeEntity
)
{
if
(
themeEntity
==
null
)
{
return
null
;
...
...
@@ -88,6 +93,9 @@ public class ConvertUtil {
}
/**
* TOPIC
*/
public
static
TopicDTO
topicEntityToDTO
(
TopicEntity
topicEntity
)
{
TopicDTO
topicDTO
=
new
TopicDTO
();
BeanUtils
.
copyProperties
(
topicEntity
,
topicDTO
);
...
...
@@ -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列表
*
...
...
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