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
57c3b245
Commit
57c3b245
authored
Jul 28, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
表修改
parent
a695f815
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
240 additions
and
82 deletions
+240
-82
CodeAutoGenerator.java
.../main/java/com/tanpu/community/dao/CodeAutoGenerator.java
+5
-5
CommentEntity.java
...m/tanpu/community/dao/entity/community/CommentEntity.java
+8
-11
FollowRelEntity.java
...tanpu/community/dao/entity/community/FollowRelEntity.java
+17
-16
ThemeEntity.java
...com/tanpu/community/dao/entity/community/ThemeEntity.java
+9
-21
VisitLogEntity.java
.../tanpu/community/dao/entity/community/VisitLogEntity.java
+146
-0
VisitLogMapper.java
.../tanpu/community/dao/mapper/community/VisitLogMapper.java
+16
-0
HomePageManager.java
...ain/java/com/tanpu/community/manager/HomePageManager.java
+5
-5
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+1
-9
FollowRelService.java
...in/java/com/tanpu/community/service/FollowRelService.java
+10
-10
CommentEntityMapper.xml
...c/main/resources/mapper/community/CommentEntityMapper.xml
+1
-1
FollowRelEntityMapper.xml
...main/resources/mapper/community/FollowRelEntityMapper.xml
+2
-2
ThemeEntityMapper.xml
...src/main/resources/mapper/community/ThemeEntityMapper.xml
+1
-2
VisitLogEntityMapper.xml
.../main/resources/mapper/community/VisitLogEntityMapper.xml
+19
-0
No files found.
community-service/src/main/java/com/tanpu/community/dao/CodeAutoGenerator.java
View file @
57c3b245
...
@@ -19,11 +19,11 @@ public class CodeAutoGenerator {
...
@@ -19,11 +19,11 @@ public class CodeAutoGenerator {
String
currentPath
=
System
.
getProperty
(
"user.dir"
);
String
currentPath
=
System
.
getProperty
(
"user.dir"
);
String
codeBaseHome
=
"/community-service/src/main/java"
;
String
codeBaseHome
=
"/community-service/src/main/java"
;
String
author
=
"xudong"
;
String
author
=
"xudong"
;
String
mysqlUserName
=
"
dev
"
;
String
mysqlUserName
=
"
tamp_admin
"
;
String
mysqlPassword
=
"
q
imeng123"
;
String
mysqlPassword
=
"
@
imeng123"
;
String
jdbcUrl
=
"jdbc:mysql://
47.101.189.151:31931
/tamp_community"
;
String
jdbcUrl
=
"jdbc:mysql://
rm-uf6r22t3d798q4kmkao.mysql.rds.aliyuncs.com:3306
/tamp_community"
;
String
[]
tables
=
new
String
[]{
"comment
"
};
// String[] tables = new String[]{"theme
"};
// String[] tables = new String[]{"follow_rel", "black_list","collection","comment","follow_rel","file_record","home_page","theme","topic","theme_attachment
"};
String
[]
tables
=
new
String
[]{
"comment"
,
"follow_rel"
,
"theme"
,
"visit_log
"
};
String
basePackage
=
"com.tanpu.community"
;
String
basePackage
=
"com.tanpu.community"
;
String
mapperPackage
=
"dao.mapper.community"
;
String
mapperPackage
=
"dao.mapper.community"
;
String
entityPackage
=
"dao.entity.community"
;
String
entityPackage
=
"dao.entity.community"
;
...
...
community-service/src/main/java/com/tanpu/community/dao/entity/community/CommentEntity.java
View file @
57c3b245
...
@@ -3,7 +3,6 @@ package com.tanpu.community.dao.entity.community;
...
@@ -3,7 +3,6 @@ package com.tanpu.community.dao.entity.community;
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
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
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
;
...
@@ -19,7 +18,7 @@ import java.time.LocalDateTime;
...
@@ -19,7 +18,7 @@ import java.time.LocalDateTime;
* </p>
* </p>
*
*
* @author xudong
* @author xudong
* @since 2021-07-2
2
* @since 2021-07-2
8
*/
*/
@TableName
(
"comment"
)
@TableName
(
"comment"
)
@ApiModel
(
value
=
"CommentEntity对象"
,
description
=
"评论"
)
@ApiModel
(
value
=
"CommentEntity对象"
,
description
=
"评论"
)
...
@@ -55,16 +54,14 @@ public class CommentEntity implements Serializable {
...
@@ -55,16 +54,14 @@ public class CommentEntity implements Serializable {
@ApiModelProperty
(
value
=
"回复评论id"
)
@ApiModelProperty
(
value
=
"回复评论id"
)
private
String
replyId
;
private
String
replyId
;
@ApiModelProperty
(
value
=
"
是否通过
0:初始值 1:已通过(管理后台使用)"
)
@ApiModelProperty
(
value
=
"
审核状态
0:初始值 1:已通过(管理后台使用)"
)
private
Integer
isPas
s
;
private
Integer
reviewStatu
s
;
@ApiModelProperty
(
value
=
"举报状态 0:未被举报 1:被举报 2:已处理"
)
@ApiModelProperty
(
value
=
"举报状态 0:未被举报 1:被举报 2:已处理"
)
private
Integer
reportStatus
;
private
Integer
reportStatus
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
LocalDateTime
createTime
;
private
LocalDateTime
createTime
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
LocalDateTime
updateTime
;
private
LocalDateTime
updateTime
;
private
Integer
deleteTag
;
private
Integer
deleteTag
;
...
@@ -134,12 +131,12 @@ public class CommentEntity implements Serializable {
...
@@ -134,12 +131,12 @@ public class CommentEntity implements Serializable {
this
.
replyId
=
replyId
;
this
.
replyId
=
replyId
;
}
}
public
Integer
get
IsPas
s
()
{
public
Integer
get
ReviewStatu
s
()
{
return
isPas
s
;
return
reviewStatu
s
;
}
}
public
void
set
IsPass
(
Integer
isPas
s
)
{
public
void
set
ReviewStatus
(
Integer
reviewStatu
s
)
{
this
.
isPass
=
isPas
s
;
this
.
reviewStatus
=
reviewStatu
s
;
}
}
public
Integer
getReportStatus
()
{
public
Integer
getReportStatus
()
{
...
@@ -185,7 +182,7 @@ public class CommentEntity implements Serializable {
...
@@ -185,7 +182,7 @@ public class CommentEntity implements Serializable {
", themeId="
+
themeId
+
", themeId="
+
themeId
+
", parentId="
+
parentId
+
", parentId="
+
parentId
+
", replyId="
+
replyId
+
", replyId="
+
replyId
+
",
isPass="
+
isPas
s
+
",
reviewStatus="
+
reviewStatu
s
+
", reportStatus="
+
reportStatus
+
", reportStatus="
+
reportStatus
+
", createTime="
+
createTime
+
", createTime="
+
createTime
+
", updateTime="
+
updateTime
+
", updateTime="
+
updateTime
+
...
...
community-service/src/main/java/com/tanpu/community/dao/entity/community/FollowRelEntity.java
View file @
57c3b245
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-2
2
* @since 2021-07-2
8
*/
*/
@TableName
(
"follow_rel"
)
@TableName
(
"follow_rel"
)
@ApiModel
(
value
=
"FollowRelEntity对象"
,
description
=
"粉丝关系"
)
@ApiModel
(
value
=
"FollowRelEntity对象"
,
description
=
"粉丝关系"
)
...
@@ -33,10 +34,10 @@ public class FollowRelEntity implements Serializable {
...
@@ -33,10 +34,10 @@ public class FollowRelEntity implements Serializable {
private
Long
id
;
private
Long
id
;
@ApiModelProperty
(
value
=
"被关注的人id"
)
@ApiModelProperty
(
value
=
"被关注的人id"
)
private
String
followUser
Id
;
private
String
idol
Id
;
@ApiModelProperty
(
value
=
"粉丝id"
)
@ApiModelProperty
(
value
=
"粉丝id"
)
private
String
f
ollower
Id
;
private
String
f
ans
Id
;
@ApiModelProperty
(
value
=
"关注时间"
)
@ApiModelProperty
(
value
=
"关注时间"
)
private
LocalDateTime
followTime
;
private
LocalDateTime
followTime
;
...
@@ -59,20 +60,20 @@ public class FollowRelEntity implements Serializable {
...
@@ -59,20 +60,20 @@ public class FollowRelEntity implements Serializable {
this
.
id
=
id
;
this
.
id
=
id
;
}
}
public
String
get
FollowUser
Id
()
{
public
String
get
Idol
Id
()
{
return
followUser
Id
;
return
idol
Id
;
}
}
public
void
set
FollowUserId
(
String
followUser
Id
)
{
public
void
set
IdolId
(
String
idol
Id
)
{
this
.
followUserId
=
followUser
Id
;
this
.
idolId
=
idol
Id
;
}
}
public
String
getF
ollower
Id
()
{
public
String
getF
ans
Id
()
{
return
f
ollower
Id
;
return
f
ans
Id
;
}
}
public
void
setF
ollowerId
(
String
follower
Id
)
{
public
void
setF
ansId
(
String
fans
Id
)
{
this
.
f
ollowerId
=
follower
Id
;
this
.
f
ansId
=
fans
Id
;
}
}
public
LocalDateTime
getFollowTime
()
{
public
LocalDateTime
getFollowTime
()
{
...
@@ -119,8 +120,8 @@ public class FollowRelEntity implements Serializable {
...
@@ -119,8 +120,8 @@ public class FollowRelEntity implements Serializable {
public
String
toString
()
{
public
String
toString
()
{
return
"FollowRelEntity{"
+
return
"FollowRelEntity{"
+
"id="
+
id
+
"id="
+
id
+
",
followUserId="
+
followUser
Id
+
",
idolId="
+
idol
Id
+
", f
ollowerId="
+
follower
Id
+
", f
ansId="
+
fans
Id
+
", followTime="
+
followTime
+
", followTime="
+
followTime
+
", unfollowTime="
+
unfollowTime
+
", unfollowTime="
+
unfollowTime
+
", createTime="
+
createTime
+
", createTime="
+
createTime
+
...
...
community-service/src/main/java/com/tanpu/community/dao/entity/community/ThemeEntity.java
View file @
57c3b245
...
@@ -18,7 +18,7 @@ import java.time.LocalDateTime;
...
@@ -18,7 +18,7 @@ import java.time.LocalDateTime;
* </p>
* </p>
*
*
* @author xudong
* @author xudong
* @since 2021-07-2
3
* @since 2021-07-2
8
*/
*/
@TableName
(
"theme"
)
@TableName
(
"theme"
)
@Builder
@Builder
...
@@ -42,12 +42,9 @@ public class ThemeEntity implements Serializable {
...
@@ -42,12 +42,9 @@ public class ThemeEntity implements Serializable {
@ApiModelProperty
(
value
=
"类型 1:讨论无标题 2:长文有标题 3:转发"
)
@ApiModelProperty
(
value
=
"类型 1:讨论无标题 2:长文有标题 3:转发"
)
private
Integer
themeType
;
private
Integer
themeType
;
@ApiModelProperty
(
value
=
"文本内容(json),type:附件类型(
8:文本,88:产品 3:直播 6:短视频 300:课程,9:图片 10:多图
),productType:基金类型(0 公募,1 私募,2 白名单,3 私有)"
)
@ApiModelProperty
(
value
=
"文本内容(json),type:附件类型(
108:文本,88:产品 3:直播 6:短视频 303:新版课程-视频,304: 新版课程-音频,109:单图(长文) 110:多图(讨论)
),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
;
...
@@ -57,8 +54,8 @@ public class ThemeEntity implements Serializable {
...
@@ -57,8 +54,8 @@ public class ThemeEntity implements Serializable {
@ApiModelProperty
(
value
=
"所属的话题"
)
@ApiModelProperty
(
value
=
"所属的话题"
)
private
String
topicId
;
private
String
topicId
;
@ApiModelProperty
(
value
=
"
是否通过 0:初始值 1:已
通过(管理后台使用)"
)
@ApiModelProperty
(
value
=
"
审核状态 0:未审核 1:审核
通过(管理后台使用)"
)
private
Integer
isPas
s
;
private
Integer
reviewStatu
s
;
@ApiModelProperty
(
value
=
"举报状态 0:未被举报 1:被举报 2:已处理"
)
@ApiModelProperty
(
value
=
"举报状态 0:未被举报 1:被举报 2:已处理"
)
private
Integer
reportStatus
;
private
Integer
reportStatus
;
...
@@ -111,14 +108,6 @@ public class ThemeEntity implements Serializable {
...
@@ -111,14 +108,6 @@ 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
;
}
}
...
@@ -143,12 +132,12 @@ public class ThemeEntity implements Serializable {
...
@@ -143,12 +132,12 @@ public class ThemeEntity implements Serializable {
this
.
topicId
=
topicId
;
this
.
topicId
=
topicId
;
}
}
public
Integer
get
IsPas
s
()
{
public
Integer
get
ReviewStatu
s
()
{
return
isPas
s
;
return
reviewStatu
s
;
}
}
public
void
set
IsPass
(
Integer
isPas
s
)
{
public
void
set
ReviewStatus
(
Integer
reviewStatu
s
)
{
this
.
isPass
=
isPas
s
;
this
.
reviewStatus
=
reviewStatu
s
;
}
}
public
Integer
getReportStatus
()
{
public
Integer
getReportStatus
()
{
...
@@ -191,11 +180,10 @@ public class ThemeEntity implements Serializable {
...
@@ -191,11 +180,10 @@ 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
+
",
isPass="
+
isPas
s
+
",
reviewStatus="
+
reviewStatu
s
+
", reportStatus="
+
reportStatus
+
", reportStatus="
+
reportStatus
+
", createTime="
+
createTime
+
", createTime="
+
createTime
+
", updateTime="
+
updateTime
+
", updateTime="
+
updateTime
+
...
...
community-service/src/main/java/com/tanpu/community/dao/entity/community/VisitLogEntity.java
0 → 100644
View file @
57c3b245
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
;
/**
* <p>
* 浏览记录
* </p>
*
* @author xudong
* @since 2021-07-28
*/
@TableName
(
"visit_log"
)
@ApiModel
(
value
=
"VisitLogEntity对象"
,
description
=
"浏览记录"
)
public
class
VisitLogEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"id"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"session_id"
)
private
String
ident
;
@ApiModelProperty
(
value
=
"浏览者id"
)
private
String
visitorId
;
@ApiModelProperty
(
value
=
"作者id"
)
private
String
authorId
;
@ApiModelProperty
(
value
=
"关联目标ID"
)
private
String
refId
;
@ApiModelProperty
(
value
=
"关联目标类型 1:进入话题页 2:进入主题正文 3、用户查看首页-关注"
)
private
Integer
refType
;
@ApiModelProperty
(
value
=
"浏览时间 单位秒"
)
private
Integer
duration
;
private
LocalDateTime
createTime
;
private
LocalDateTime
updateTime
;
private
Integer
deleteTag
;
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getIdent
()
{
return
ident
;
}
public
void
setIdent
(
String
ident
)
{
this
.
ident
=
ident
;
}
public
String
getVisitorId
()
{
return
visitorId
;
}
public
void
setVisitorId
(
String
visitorId
)
{
this
.
visitorId
=
visitorId
;
}
public
String
getAuthorId
()
{
return
authorId
;
}
public
void
setAuthorId
(
String
authorId
)
{
this
.
authorId
=
authorId
;
}
public
String
getRefId
()
{
return
refId
;
}
public
void
setRefId
(
String
refId
)
{
this
.
refId
=
refId
;
}
public
Integer
getRefType
()
{
return
refType
;
}
public
void
setRefType
(
Integer
refType
)
{
this
.
refType
=
refType
;
}
public
Integer
getDuration
()
{
return
duration
;
}
public
void
setDuration
(
Integer
duration
)
{
this
.
duration
=
duration
;
}
public
LocalDateTime
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
LocalDateTime
createTime
)
{
this
.
createTime
=
createTime
;
}
public
LocalDateTime
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
LocalDateTime
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
public
Integer
getDeleteTag
()
{
return
deleteTag
;
}
public
void
setDeleteTag
(
Integer
deleteTag
)
{
this
.
deleteTag
=
deleteTag
;
}
@Override
public
String
toString
()
{
return
"VisitLogEntity{"
+
"id="
+
id
+
", ident="
+
ident
+
", visitorId="
+
visitorId
+
", authorId="
+
authorId
+
", refId="
+
refId
+
", refType="
+
refType
+
", duration="
+
duration
+
", createTime="
+
createTime
+
", updateTime="
+
updateTime
+
", deleteTag="
+
deleteTag
+
"}"
;
}
}
community-service/src/main/java/com/tanpu/community/dao/mapper/community/VisitLogMapper.java
0 → 100644
View file @
57c3b245
package
com
.
tanpu
.
community
.
dao
.
mapper
.
community
;
import
com.tanpu.community.dao.entity.community.VisitLogEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* 浏览记录 Mapper 接口
* </p>
*
* @author xudong
* @since 2021-07-28
*/
public
interface
VisitLogMapper
extends
BaseMapper
<
VisitLogEntity
>
{
}
community-service/src/main/java/com/tanpu/community/manager/HomePageManager.java
View file @
57c3b245
...
@@ -135,10 +135,10 @@ public class HomePageManager {
...
@@ -135,10 +135,10 @@ public class HomePageManager {
// 设置关注列表
// 设置关注列表
List
<
String
>
collect
=
userInfoOrgs
.
stream
().
map
(
UserInfoOrg:
:
getUserId
).
collect
(
Collectors
.
toList
());
List
<
String
>
collect
=
userInfoOrgs
.
stream
().
map
(
UserInfoOrg:
:
getUserId
).
collect
(
Collectors
.
toList
());
List
<
FollowRelEntity
>
followRelEntities
=
followRelMapper
.
selectList
(
new
LambdaQueryWrapper
<
FollowRelEntity
>()
List
<
FollowRelEntity
>
followRelEntities
=
followRelMapper
.
selectList
(
new
LambdaQueryWrapper
<
FollowRelEntity
>()
.
eq
(
FollowRelEntity:
:
get
Follower
Id
,
userId
)
.
eq
(
FollowRelEntity:
:
get
Idol
Id
,
userId
)
.
in
(
FollowRelEntity:
:
getF
ollowUser
Id
,
collect
)
.
in
(
FollowRelEntity:
:
getF
ans
Id
,
collect
)
.
eq
(
FollowRelEntity:
:
getDeleteTag
,
BizStatus
.
DeleteTag
.
tag_init
));
.
eq
(
FollowRelEntity:
:
getDeleteTag
,
BizStatus
.
DeleteTag
.
tag_init
));
Map
<
String
,
FollowRelEntity
>
collect1
=
followRelEntities
.
stream
().
collect
(
Collectors
.
toMap
(
FollowRelEntity:
:
get
FollowUser
Id
,
Function
.
identity
()));
Map
<
String
,
FollowRelEntity
>
collect1
=
followRelEntities
.
stream
().
collect
(
Collectors
.
toMap
(
FollowRelEntity:
:
get
Idol
Id
,
Function
.
identity
()));
userInfoOrgs
.
forEach
(
userInfoOrg
->
{
userInfoOrgs
.
forEach
(
userInfoOrg
->
{
if
(
collect1
.
containsKey
(
userInfoOrg
.
getUserId
()))
if
(
collect1
.
containsKey
(
userInfoOrg
.
getUserId
()))
userInfoOrg
.
setIsFollower
(
ShowFollowStatusEnum
.
FOLLOWED
.
getCode
());
//1已关注
userInfoOrg
.
setIsFollower
(
ShowFollowStatusEnum
.
FOLLOWED
.
getCode
());
//1已关注
...
@@ -163,9 +163,9 @@ public class HomePageManager {
...
@@ -163,9 +163,9 @@ public class HomePageManager {
}
}
private
void
getFansNUmAndFollowNum
(
UserInfoNew
userInfoNew
)
{
private
void
getFansNUmAndFollowNum
(
UserInfoNew
userInfoNew
)
{
Integer
fansNumber
=
followRelMapper
.
selectCount
(
new
LambdaQueryWrapper
<
FollowRelEntity
>().
eq
(
FollowRelEntity:
:
get
FollowUser
Id
,
userInfoNew
.
getUserId
())
Integer
fansNumber
=
followRelMapper
.
selectCount
(
new
LambdaQueryWrapper
<
FollowRelEntity
>().
eq
(
FollowRelEntity:
:
get
Idol
Id
,
userInfoNew
.
getUserId
())
.
eq
(
FollowRelEntity:
:
getDeleteTag
,
BizStatus
.
DeleteTag
.
tag_init
));
.
eq
(
FollowRelEntity:
:
getDeleteTag
,
BizStatus
.
DeleteTag
.
tag_init
));
Integer
followNumber
=
followRelMapper
.
selectCount
(
new
LambdaQueryWrapper
<
FollowRelEntity
>().
eq
(
FollowRelEntity:
:
getF
ollower
Id
,
userInfoNew
.
getUserId
())
Integer
followNumber
=
followRelMapper
.
selectCount
(
new
LambdaQueryWrapper
<
FollowRelEntity
>().
eq
(
FollowRelEntity:
:
getF
ans
Id
,
userInfoNew
.
getUserId
())
.
eq
(
FollowRelEntity:
:
getDeleteTag
,
BizStatus
.
DeleteTag
.
tag_init
));
.
eq
(
FollowRelEntity:
:
getDeleteTag
,
BizStatus
.
DeleteTag
.
tag_init
));
userInfoNew
.
setFollowNumber
(
followNumber
);
userInfoNew
.
setFollowNumber
(
followNumber
);
userInfoNew
.
setFansNumber
(
fansNumber
);
userInfoNew
.
setFansNumber
(
fansNumber
);
...
...
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
57c3b245
...
@@ -132,15 +132,7 @@ public class ThemeManager {
...
@@ -132,15 +132,7 @@ 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
()))
{
String
content
=
req
.
getContent
().
get
(
0
).
getValue
();
// discuss_content字段上限为256个字符
if
(
content
.
length
()
>
256
)
{
content
=
content
.
substring
(
0
,
255
);
}
themeEntity
.
setDiscussContent
(
content
);
}
// 腾讯云敏感词校验
// 腾讯云敏感词校验
checkContent
(
themeEntity
.
getContent
());
checkContent
(
themeEntity
.
getContent
());
...
...
community-service/src/main/java/com/tanpu/community/service/FollowRelService.java
View file @
57c3b245
...
@@ -23,19 +23,19 @@ public class FollowRelService {
...
@@ -23,19 +23,19 @@ public class FollowRelService {
public
List
<
String
>
queryFansByFollowerId
(
String
followerId
)
{
public
List
<
String
>
queryFansByFollowerId
(
String
followerId
)
{
return
followRelMapper
.
selectList
(
new
LambdaQueryWrapper
<
FollowRelEntity
>()
return
followRelMapper
.
selectList
(
new
LambdaQueryWrapper
<
FollowRelEntity
>()
.
eq
(
FollowRelEntity:
:
getF
ollower
Id
,
followerId
)
.
eq
(
FollowRelEntity:
:
getF
ans
Id
,
followerId
)
.
eq
(
FollowRelEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
()))
.
eq
(
FollowRelEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
()))
.
stream
().
map
(
FollowRelEntity:
:
get
FollowUser
Id
)
.
stream
().
map
(
FollowRelEntity:
:
get
Idol
Id
)
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
}
// @Cacheable(value = "tempCache", keyGenerator = "communityKeyGenerator")
// @Cacheable(value = "tempCache", keyGenerator = "communityKeyGenerator")
public
List
<
String
>
queryFansByIdolId
(
String
idolId
)
{
public
List
<
String
>
queryFansByIdolId
(
String
idolId
)
{
LambdaQueryWrapper
<
FollowRelEntity
>
queryWrapper
=
new
LambdaQueryWrapper
<
FollowRelEntity
>()
LambdaQueryWrapper
<
FollowRelEntity
>
queryWrapper
=
new
LambdaQueryWrapper
<
FollowRelEntity
>()
.
eq
(
FollowRelEntity:
:
get
FollowUser
Id
,
idolId
)
.
eq
(
FollowRelEntity:
:
get
Idol
Id
,
idolId
)
.
eq
(
FollowRelEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
());
.
eq
(
FollowRelEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
());
return
followRelMapper
.
selectList
(
queryWrapper
)
return
followRelMapper
.
selectList
(
queryWrapper
)
.
stream
().
map
(
FollowRelEntity:
:
getF
ollower
Id
).
collect
(
Collectors
.
toList
());
.
stream
().
map
(
FollowRelEntity:
:
getF
ans
Id
).
collect
(
Collectors
.
toList
());
}
}
@Transactional
@Transactional
...
@@ -43,8 +43,8 @@ public class FollowRelService {
...
@@ -43,8 +43,8 @@ public class FollowRelService {
FollowRelEntity
searchResult
=
queryRecord
(
idolId
,
followerId
);
FollowRelEntity
searchResult
=
queryRecord
(
idolId
,
followerId
);
if
(
searchResult
==
null
){
if
(
searchResult
==
null
){
FollowRelEntity
entity
=
FollowRelEntity
.
builder
()
FollowRelEntity
entity
=
FollowRelEntity
.
builder
()
.
followUser
Id
(
idolId
)
.
idol
Id
(
idolId
)
.
f
ollower
Id
(
followerId
)
.
f
ans
Id
(
followerId
)
.
followTime
(
LocalDateTime
.
now
())
.
followTime
(
LocalDateTime
.
now
())
.
build
();
.
build
();
...
@@ -75,14 +75,14 @@ public class FollowRelService {
...
@@ -75,14 +75,14 @@ public class FollowRelService {
public
FollowRelEntity
queryRecord
(
String
idolId
,
String
followerId
){
public
FollowRelEntity
queryRecord
(
String
idolId
,
String
followerId
){
return
followRelMapper
.
selectOne
(
new
LambdaQueryWrapper
<
FollowRelEntity
>()
return
followRelMapper
.
selectOne
(
new
LambdaQueryWrapper
<
FollowRelEntity
>()
.
eq
(
FollowRelEntity:
:
get
FollowUser
Id
,
idolId
)
.
eq
(
FollowRelEntity:
:
get
Idol
Id
,
idolId
)
.
eq
(
FollowRelEntity:
:
getF
ollower
Id
,
followerId
));
.
eq
(
FollowRelEntity:
:
getF
ans
Id
,
followerId
));
}
}
public
boolean
checkFollow
(
String
idolId
,
String
followerId
){
public
boolean
checkFollow
(
String
idolId
,
String
followerId
){
return
followRelMapper
.
selectCount
(
new
LambdaQueryWrapper
<
FollowRelEntity
>()
return
followRelMapper
.
selectCount
(
new
LambdaQueryWrapper
<
FollowRelEntity
>()
.
eq
(
FollowRelEntity:
:
get
FollowUser
Id
,
idolId
)
.
eq
(
FollowRelEntity:
:
get
Idol
Id
,
idolId
)
.
eq
(
FollowRelEntity:
:
getF
ollower
Id
,
followerId
)
.
eq
(
FollowRelEntity:
:
getF
ans
Id
,
followerId
)
.
eq
(
FollowRelEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
()))
.
eq
(
FollowRelEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
.
getCode
()))
>
0
;
>
0
;
}
}
...
...
community-service/src/main/resources/mapper/community/CommentEntityMapper.xml
View file @
57c3b245
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
<result
column=
"theme_id"
property=
"themeId"
/>
<result
column=
"theme_id"
property=
"themeId"
/>
<result
column=
"parent_id"
property=
"parentId"
/>
<result
column=
"parent_id"
property=
"parentId"
/>
<result
column=
"reply_id"
property=
"replyId"
/>
<result
column=
"reply_id"
property=
"replyId"
/>
<result
column=
"
is_pass"
property=
"isPas
s"
/>
<result
column=
"
review_status"
property=
"reviewStatu
s"
/>
<result
column=
"report_status"
property=
"reportStatus"
/>
<result
column=
"report_status"
property=
"reportStatus"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
...
...
community-service/src/main/resources/mapper/community/FollowRelEntityMapper.xml
View file @
57c3b245
...
@@ -5,8 +5,8 @@
...
@@ -5,8 +5,8 @@
<!-- 通用查询映射结果 -->
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"com.tanpu.community.dao.entity.community.FollowRelEntity"
>
<resultMap
id=
"BaseResultMap"
type=
"com.tanpu.community.dao.entity.community.FollowRelEntity"
>
<id
column=
"id"
property=
"id"
/>
<id
column=
"id"
property=
"id"
/>
<result
column=
"
follow_user_id"
property=
"followUser
Id"
/>
<result
column=
"
idol_id"
property=
"idol
Id"
/>
<result
column=
"f
ollower_id"
property=
"follower
Id"
/>
<result
column=
"f
ans_id"
property=
"fans
Id"
/>
<result
column=
"follow_time"
property=
"followTime"
/>
<result
column=
"follow_time"
property=
"followTime"
/>
<result
column=
"unfollow_time"
property=
"unfollowTime"
/>
<result
column=
"unfollow_time"
property=
"unfollowTime"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"create_time"
property=
"createTime"
/>
...
...
community-service/src/main/resources/mapper/community/ThemeEntityMapper.xml
View file @
57c3b245
...
@@ -9,11 +9,10 @@
...
@@ -9,11 +9,10 @@
<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"
/>
<result
column=
"
is_pass"
property=
"isPas
s"
/>
<result
column=
"
review_status"
property=
"reviewStatu
s"
/>
<result
column=
"report_status"
property=
"reportStatus"
/>
<result
column=
"report_status"
property=
"reportStatus"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
...
...
community-service/src/main/resources/mapper/community/VisitLogEntityMapper.xml
0 → 100644
View file @
57c3b245
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.tanpu.community.dao.mapper.community.VisitLogMapper"
>
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"com.tanpu.community.dao.entity.community.VisitLogEntity"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"ident"
property=
"ident"
/>
<result
column=
"visitor_id"
property=
"visitorId"
/>
<result
column=
"author_id"
property=
"authorId"
/>
<result
column=
"ref_id"
property=
"refId"
/>
<result
column=
"ref_type"
property=
"refType"
/>
<result
column=
"duration"
property=
"duration"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
<result
column=
"delete_tag"
property=
"deleteTag"
/>
</resultMap>
</mapper>
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