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
3b52355a
Commit
3b52355a
authored
Jul 27, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
空值修复
parent
81810d02
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
CommentService.java
...main/java/com/tanpu/community/service/CommentService.java
+4
-0
create.sql
docs/create.sql
+10
-7
No files found.
community-service/src/main/java/com/tanpu/community/service/CommentService.java
View file @
3b52355a
...
...
@@ -18,6 +18,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
...
...
@@ -71,6 +72,9 @@ public class CommentService {
//统计主题集合的评论量
public
Map
<
String
,
Integer
>
getCountMapByThemeIds
(
List
<
String
>
themeIds
)
{
if
(
CollectionUtils
.
isEmpty
(
themeIds
)){
return
new
HashMap
<>();
}
LambdaQueryWrapper
<
CommentEntity
>
wrapper
=
(
new
LambdaQueryWrapper
<
CommentEntity
>()
.
in
(
CommentEntity:
:
getThemeId
,
themeIds
))
.
eq
(
CommentEntity:
:
getDeleteTag
,
DeleteTagEnum
.
NOT_DELETED
)
...
...
docs/create.sql
View file @
3b52355a
CREATE
TABLE
`home_page`
(
`id`
int
(
32
)
auto_increment
PRIMARY
KEY
COMMENT
'id'
,
`user_id`
varchar
(
64
)
NOT
NULL
COMMENT
'用户id'
,
...
...
@@ -29,15 +30,17 @@ CREATE TABLE `follow_rel` (
CREATE
TABLE
`theme`
(
`id`
int
(
32
)
auto_increment
PRIMARY
KEY
COMMENT
'id'
,
`theme_id`
varchar
(
64
)
NOT
NULL
COMMENT
'
UUID
'
,
`theme_id`
varchar
(
64
)
NOT
NULL
COMMENT
'
主题主键Id
'
,
`title`
varchar
(
64
)
COMMENT
'标题'
,
`theme_type`
int
(
4
)
NOT
NULL
COMMENT
'类型'
,
`content`
text
COMMENT
'文本内容'
,
`theme_type`
int
(
4
)
NOT
NULL
COMMENT
'类型
1:讨论无标题 2:长文有标题 3:转发
'
,
`content`
text
COMMENT
'文本内容
(json),type:附件类型(8:文本,88:产品 3:直播 6:短视频 300:课程,9:图片 10:多图),productType:基金类型(0 公募,1 私募,2 白名单,3 私有)
'
,
`attach_type`
int
(
4
)
NOT
NULL
COMMENT
'附件类型'
,
`
attachment`
text
NOT
NULL
COMMENT
'附件内容
'
,
`
discuss_content`
text
NOT
NULL
COMMENT
'讨论中的文本
'
,
`author_id`
varchar
(
64
)
NOT
NULL
COMMENT
'作者id'
,
`former_theme_id`
varchar
(
64
)
COMMENT
'被转发的主题'
,
`topic_id`
varchar
(
64
)
NOT
NULL
COMMENT
'所属的话题'
,
`is_pass`
int
(
4
)
default
0
NOT
NULL
COMMENT
'是否通过 0:初始值 1:已通过(管理后台使用)'
,
`report_status`
int
(
4
)
default
0
NOT
NULL
COMMENT
'举报状态 0:未被举报 1:被举报 2:已处理'
,
`create_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
`update_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
`delete_tag`
int
(
3
)
NOT
NULL
DEFAULT
'0'
,
...
...
@@ -62,18 +65,18 @@ CREATE TABLE `theme_attachment` (
CREATE
TABLE
`comment`
(
`id`
int
(
32
)
auto_increment
PRIMARY
KEY
NOT
NULL
COMMENT
'id'
,
`comment_id`
varchar
(
64
)
NOT
NULL
COMMENT
'
uui
d'
,
`comment_id`
varchar
(
64
)
NOT
NULL
COMMENT
'
评论主键I
d'
,
`comment_type`
int
(
4
)
NOT
NULL
COMMENT
'类型'
,
`content`
varchar
(
1024
)
DEFAULT
NULL
COMMENT
'文本内容'
,
`author_id`
varchar
(
64
)
NOT
NULL
COMMENT
'作者id'
,
`theme_id`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'主题id'
,
`parent_id`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'一级评论id'
,
`reply_id`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'回复评论id'
,
`is_block`
int
(
4
)
NOT
NULL
DEFAULT
'0'
COMMENT
'是否屏蔽'
,
`is_pass`
int
(
4
)
default
0
NOT
NULL
COMMENT
'是否通过 0:初始值 1:已通过(管理后台使用)'
,
`report_status`
int
(
4
)
default
0
NOT
NULL
COMMENT
'举报状态 0:未被举报 1:被举报 2:已处理'
,
`create_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
`update_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
,
`delete_tag`
int
(
3
)
NOT
NULL
DEFAULT
'0'
,
PRIMARY
KEY
(
`id`
),
KEY
`idx_author`
(
`author_id`
)
USING
BTREE
,
KEY
`idx_target`
(
`reply_id`
)
USING
BTREE
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COMMENT
=
'评论'
;
...
...
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