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
fd84c963
Commit
fd84c963
authored
Jun 16, 2021
by
张辰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/liujiming' into 'master'
merge See merge request
!1
parents
3893149c
83a22ac5
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
1101 additions
and
10 deletions
+1101
-10
ThemeDTO.java
...src/main/java/com/tanpu/community/api/beans/ThemeDTO.java
+180
-0
TopicDTO.java
...src/main/java/com/tanpu/community/api/beans/TopicDTO.java
+67
-0
BlockTypeEnum.java
...java/com/tanpu/community/api/constants/BlockTypeEnum.java
+29
-0
CollectionTypeEnum.java
...com/tanpu/community/api/constants/CollectionTypeEnum.java
+30
-0
CommentTypeEnum.java
...va/com/tanpu/community/api/constants/CommentTypeEnum.java
+32
-0
pom.xml
community-service/pom.xml
+7
-0
HomePageController.java
...va/com/tanpu/community/controller/HomePageController.java
+8
-1
MetricsController.java
...ava/com/tanpu/community/controller/MetricsController.java
+22
-0
ThemeController.java
.../java/com/tanpu/community/controller/ThemeController.java
+110
-0
TopicController.java
.../java/com/tanpu/community/controller/TopicController.java
+109
-0
ThemeConvert.java
.../com/tanpu/community/controller/convert/ThemeConvert.java
+49
-0
TopicConverter.java
...om/tanpu/community/controller/convert/TopicConverter.java
+29
-0
TopicEntity.java
...com/tanpu/community/dao/entity/community/TopicEntity.java
+3
-3
BlackListMapper.java
...tanpu/community/dao/mapper/community/BlackListMapper.java
+16
-0
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+111
-0
TopicManager.java
...c/main/java/com/tanpu/community/manager/TopicManager.java
+70
-0
BizException.java
...a/com/tanpu/community/manager/exception/BizException.java
+19
-0
BlackListService.java
...in/java/com/tanpu/community/service/BlackListService.java
+24
-0
CollectionService.java
...n/java/com/tanpu/community/service/CollectionService.java
+33
-0
CommentService.java
...main/java/com/tanpu/community/service/CommentService.java
+27
-0
RedisService.java
...c/main/java/com/tanpu/community/service/RedisService.java
+23
-1
ThemeService.java
...c/main/java/com/tanpu/community/service/ThemeService.java
+36
-0
TopicService.java
...c/main/java/com/tanpu/community/service/TopicService.java
+62
-0
create.sql
docs/create.sql
+4
-4
pom.xml
pom.xml
+1
-1
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/ThemeDTO.java
0 → 100644
View file @
fd84c963
package
com
.
tanpu
.
community
.
api
.
beans
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.time.LocalDateTime
;
public
class
ThemeDTO
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"id"
)
private
String
id
;
@ApiModelProperty
(
value
=
"标题"
)
private
String
title
;
@ApiModelProperty
(
value
=
"类型"
)
private
Integer
themeType
;
@ApiModelProperty
(
value
=
"文本内容"
)
private
String
content
;
@ApiModelProperty
(
value
=
"附件类型"
)
private
Integer
attachType
;
@ApiModelProperty
(
value
=
"附件内容"
)
private
String
attachment
;
@ApiModelProperty
(
value
=
"作者id"
)
private
String
authorId
;
@ApiModelProperty
(
value
=
"被转发的主题"
)
private
String
formerThemeId
;
@ApiModelProperty
(
value
=
"所属的话题"
)
private
String
topicId
;
private
String
createBy
;
private
LocalDateTime
createTime
;
private
String
updateBy
;
private
LocalDateTime
updateTime
;
private
Integer
deleteTag
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
Integer
getThemeType
()
{
return
themeType
;
}
public
void
setThemeType
(
Integer
themeType
)
{
this
.
themeType
=
themeType
;
}
public
String
getContent
()
{
return
content
;
}
public
void
setContent
(
String
content
)
{
this
.
content
=
content
;
}
public
Integer
getAttachType
()
{
return
attachType
;
}
public
void
setAttachType
(
Integer
attachType
)
{
this
.
attachType
=
attachType
;
}
public
String
getAttachment
()
{
return
attachment
;
}
public
void
setAttachment
(
String
attachment
)
{
this
.
attachment
=
attachment
;
}
public
String
getAuthorId
()
{
return
authorId
;
}
public
void
setAuthorId
(
String
authorId
)
{
this
.
authorId
=
authorId
;
}
public
String
getFormerThemeId
()
{
return
formerThemeId
;
}
public
void
setFormerThemeId
(
String
formerThemeId
)
{
this
.
formerThemeId
=
formerThemeId
;
}
public
String
getTopicId
()
{
return
topicId
;
}
public
void
setTopicId
(
String
topicId
)
{
this
.
topicId
=
topicId
;
}
public
String
getCreateBy
()
{
return
createBy
;
}
public
void
setCreateBy
(
String
createBy
)
{
this
.
createBy
=
createBy
;
}
public
LocalDateTime
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
LocalDateTime
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getUpdateBy
()
{
return
updateBy
;
}
public
void
setUpdateBy
(
String
updateBy
)
{
this
.
updateBy
=
updateBy
;
}
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
"ThemeEntity{"
+
"id="
+
id
+
", title="
+
title
+
", themeType="
+
themeType
+
", content="
+
content
+
", attachType="
+
attachType
+
", attachment="
+
attachment
+
", authorId="
+
authorId
+
", formerThemeId="
+
formerThemeId
+
", topicId="
+
topicId
+
", createBy="
+
createBy
+
", createTime="
+
createTime
+
", updateBy="
+
updateBy
+
", updateTime="
+
updateTime
+
", deleteTag="
+
deleteTag
+
"}"
;
}
}
community-api/src/main/java/com/tanpu/community/api/beans/TopicDTO.java
0 → 100644
View file @
fd84c963
package
com
.
tanpu
.
community
.
api
.
beans
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
@Data
@ApiModel
(
value
=
"TopicDTO对象"
,
description
=
"话题"
)
public
class
TopicDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"id"
)
private
String
id
;
@ApiModelProperty
(
value
=
"话题名称"
)
private
String
topicTitle
;
@ApiModelProperty
(
value
=
"是否置顶"
)
private
Integer
isTop
;
@ApiModelProperty
(
value
=
"是否隐藏"
)
private
Integer
isConceal
;
private
String
createBy
;
private
LocalDateTime
createTime
;
private
String
updateBy
;
private
LocalDateTime
updateTime
;
private
Integer
deleteTag
;
@ApiModelProperty
(
value
=
"帖子量"
)
private
Long
themeAmount
;
@ApiModelProperty
(
value
=
"浏览量"
)
private
Long
viewAmount
;
@ApiModelProperty
(
value
=
"点赞量"
)
private
Long
likeAmount
;
@ApiModelProperty
(
value
=
"总用户数"
)
private
Long
UserAmount
;
@ApiModelProperty
@Override
public
String
toString
()
{
return
"TopicEntity{"
+
"id="
+
id
+
", topicTitle="
+
topicTitle
+
", isTop="
+
isTop
+
", isConceal="
+
isConceal
+
", createBy="
+
createBy
+
", createTime="
+
createTime
+
", updateBy="
+
updateBy
+
", updateTime="
+
updateTime
+
", deleteTag="
+
deleteTag
+
"}"
;
}
}
community-api/src/main/java/com/tanpu/community/api/constants/BlockTypeEnum.java
0 → 100644
View file @
fd84c963
package
com
.
tanpu
.
community
.
api
.
constants
;
public
enum
BlockTypeEnum
{
USER
(
1
,
"屏蔽用户"
),
CONTENT
(
2
,
"屏蔽内容"
);
private
Integer
code
;
private
String
type
;
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
BlockTypeEnum
(
Integer
code
,
String
type
)
{
this
.
code
=
code
;
this
.
type
=
type
;
}
}
community-api/src/main/java/com/tanpu/community/api/constants/CollectionTypeEnum.java
0 → 100644
View file @
fd84c963
package
com
.
tanpu
.
community
.
api
.
constants
;
public
enum
CollectionTypeEnum
{
LIKE
(
1
,
"点赞"
),
BOOK
(
2
,
"收藏"
);
private
Integer
code
;
private
String
type
;
CollectionTypeEnum
(
Integer
code
,
String
type
)
{
this
.
code
=
code
;
this
.
type
=
type
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
}
community-api/src/main/java/com/tanpu/community/api/constants/CommentTypeEnum.java
0 → 100644
View file @
fd84c963
package
com
.
tanpu
.
community
.
api
.
constants
;
public
enum
CommentTypeEnum
{
TEXT
(
1
,
"纯文字"
);
private
Integer
code
;
private
String
type
;
CommentTypeEnum
(
Integer
code
,
String
type
)
{
this
.
code
=
code
;
this
.
type
=
type
;
}
public
Integer
getCode
()
{
return
code
;
}
public
void
setCode
(
Integer
code
)
{
this
.
code
=
code
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
}
community-service/pom.xml
View file @
fd84c963
...
@@ -43,6 +43,13 @@
...
@@ -43,6 +43,13 @@
<artifactId>
spring-cloud-starter-zipkin
</artifactId>
<artifactId>
spring-cloud-starter-zipkin
</artifactId>
</dependency>
</dependency>
<!-- mybatis-plus自动生成所需包-->
<dependency>
<groupId>
org.apache.velocity
</groupId>
<artifactId>
velocity-engine-core
</artifactId>
<version>
2.3
</version>
</dependency>
<!-- <dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.cloud</groupId>-->
<!-- <groupId>org.springframework.cloud</groupId>-->
<!-- <artifactId>spring-cloud-starter-consul-discovery</artifactId>-->
<!-- <artifactId>spring-cloud-starter-consul-discovery</artifactId>-->
...
...
community-service/src/main/java/com/tanpu/community/controller/HomePageController.java
View file @
fd84c963
package
com
.
tanpu
.
community
.
controller
;
package
com
.
tanpu
.
community
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.tanpu.community.dao.entity.community.FansRelEntity
;
import
com.tanpu.community.dao.entity.community.FansRelEntity
;
import
com.tanpu.community.manager.HomePageManager
;
import
com.tanpu.community.manager.HomePageManager
;
import
com.tanpu.community.model.req.homepage.AddIdolReq
;
import
com.tanpu.community.model.req.homepage.AddIdolReq
;
...
@@ -38,4 +37,12 @@ public class HomePageController {
...
@@ -38,4 +37,12 @@ public class HomePageController {
return
"11"
;
return
"11"
;
}
}
@PostMapping
(
value
=
"/query/likeTheme"
)
@ApiOperation
(
"我的点赞"
)
@ResponseBody
public
String
likeList
(){
String
userId
=
"123"
;
return
"success"
;
}
}
}
community-service/src/main/java/com/tanpu/community/controller/MetricsController.java
0 → 100644
View file @
fd84c963
package
com
.
tanpu
.
community
.
controller
;
import
com.tanpu.community.service.RedisService
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
@RequestMapping
(
value
=
"/metric"
)
public
class
MetricsController
{
@Autowired
private
RedisService
redisService
;
@ApiOperation
(
"浏览量埋点"
)
@RequestMapping
(
"/pv"
)
public
void
pageView
(
@RequestParam
String
themeId
){
redisService
.
incr
(
"pv"
+
themeId
,
1L
);
}
}
community-service/src/main/java/com/tanpu/community/controller/ThemeController.java
0 → 100644
View file @
fd84c963
package
com
.
tanpu
.
community
.
controller
;
import
com.tanpu.community.api.beans.ThemeDTO
;
import
com.tanpu.community.controller.convert.ThemeConvert
;
import
com.tanpu.community.dao.entity.community.ThemeEntity
;
import
com.tanpu.community.manager.ThemeManager
;
import
com.tanpu.community.service.FansRelService
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
@RestController
@Slf4j
@RequestMapping
(
value
=
"/api/theme"
)
public
class
ThemeController
{
@Autowired
private
ThemeManager
themeManager
;
@Autowired
private
FansRelService
fansRelService
;
@ApiOperation
(
"新增主题"
)
@RequestMapping
(
value
=
"/add"
)
@ResponseBody
public
String
insertTheme
(
@RequestBody
ThemeDTO
themeDTO
){
String
userId
=
"liujm"
;
themeDTO
.
setAuthorId
(
userId
);
themeManager
.
insert
(
ThemeConvert
.
convertToEntity
(
themeDTO
));
return
"success"
;
}
@ApiOperation
(
"系统推荐主题列表"
)
@RequestMapping
(
value
=
"/add"
)
@ResponseBody
public
List
<
ThemeEntity
>
selectHotList
(){
return
null
;
}
@ApiOperation
(
"用户关注主题列表"
)
@RequestMapping
(
value
=
"/add"
)
@ResponseBody
public
List
<
ThemeEntity
>
selectInterestList
(){
String
userId
=
"liujm012"
;
return
null
;
}
@ApiOperation
(
"评论"
)
@RequestMapping
(
value
=
"/comment"
)
@ResponseBody
public
String
commetOnTheme
(
String
themeId
,
String
commet
){
String
user
=
"liujm"
;
themeManager
.
comment
(
themeId
,
user
,
commet
);
return
"success"
;
}
@ApiOperation
(
"转发主题"
)
@RequestMapping
(
value
=
"/forward"
)
@ResponseBody
public
String
forwardTheme
(
String
themeId
){
return
"success"
;
}
@ApiOperation
(
"点赞主题"
)
@RequestMapping
(
value
=
"/like"
)
@ResponseBody
public
String
likeOnTheme
(
String
themeId
){
String
user
=
"liujm"
;
themeManager
.
like
(
themeId
,
user
);
return
"success"
;
}
@ApiOperation
(
"分享主题"
)
@RequestMapping
(
value
=
"/share"
)
@ResponseBody
public
String
shareTheme
(
String
themeId
){
return
"success"
;
}
@ApiOperation
(
"收藏主题"
)
@RequestMapping
(
value
=
"/book"
)
@ResponseBody
public
String
bookTheme
(
String
themeId
){
String
user
=
"liujm"
;
themeManager
.
book
(
themeId
,
user
);
return
"success"
;
}
@ApiOperation
(
"举报主题"
)
@RequestMapping
(
value
=
"/complaint"
)
@ResponseBody
public
String
complaintTheme
(
String
themeId
){
return
"success"
;
}
@ApiOperation
(
"屏蔽"
)
@RequestMapping
(
value
=
"/conceal"
)
@ResponseBody
public
String
concealTheme
(
String
themeId
){
return
"success"
;
}
}
community-service/src/main/java/com/tanpu/community/controller/TopicController.java
0 → 100644
View file @
fd84c963
package
com
.
tanpu
.
community
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.gson.JsonObject
;
import
com.tanpu.community.api.beans.TopicDTO
;
import
com.tanpu.community.controller.convert.TopicConverter
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
com.tanpu.community.manager.TopicManager
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Value
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.MissingServletRequestParameterException
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@RestController
@Slf4j
@RequestMapping
(
value
=
"/api/topic"
)
public
class
TopicController
{
@Autowired
private
TopicManager
topicManager
;
@PostMapping
(
value
=
"/queryTopicList"
)
@ApiOperation
(
"查询所有的主题详情"
)
@ResponseBody
public
List
<
TopicDTO
>
getAllTopicList
(
@RequestBody
String
content
){
JSONObject
params
=
JSONObject
.
parseObject
(
content
);
List
<
TopicEntity
>
allTopic
=
topicManager
.
getAllTopic
();
List
<
TopicDTO
>
topicDTOS
=
TopicConverter
.
convertToDTOs
(
allTopic
);
//获取浏览数据:浏览、发帖、回帖
return
topicDTOS
;
}
@PostMapping
(
value
=
"/queryTopicList"
)
@ApiOperation
(
"查询所有的主题名称列表"
)
@ResponseBody
public
List
<
String
>
getTopicNameList
(
@RequestBody
String
content
){
JSONObject
params
=
JSONObject
.
parseObject
(
content
);
List
<
TopicEntity
>
allTopic
=
topicManager
.
getAllTopic
();
List
<
String
>
topictitiles
=
allTopic
.
stream
().
map
(
TopicEntity:
:
getTopicTitle
).
collect
(
Collectors
.
toList
());
//获取浏览数据:浏览、发帖、回帖
return
topictitiles
;
}
@PostMapping
(
value
=
"/insertTopic"
)
@ApiOperation
(
"新增主题主题"
)
@ResponseBody
public
String
addTopic
(
@RequestParam
String
topicTitle
){
//TODO:获取登录用户信息
String
userId
=
"liujm"
;
topicManager
.
insertTopic
(
topicTitle
,
userId
);
return
"success"
;
}
@ApiOperation
(
"单个话题数据总览"
)
@PostMapping
(
"/selectOne"
)
@ResponseBody
public
String
selectOne
(
@RequestParam
String
topicId
)
throws
MissingServletRequestParameterException
{
if
(
StringUtils
.
isEmpty
(
topicId
)){
throw
new
MissingServletRequestParameterException
(
"topicId"
,
"String"
);
}
TopicDTO
topicDTO
=
topicManager
.
getDetail
(
topicId
);
return
"success"
;
}
@PostMapping
(
value
=
"/setTop"
)
@ApiOperation
(
"顶置/取消顶置主题"
)
@ResponseBody
public
String
setTopTopic
(
@RequestParam
String
topicId
,
@RequestParam
boolean
setTop
)
throws
MissingServletRequestParameterException
{
if
(
StringUtils
.
isEmpty
(
topicId
)){
throw
new
MissingServletRequestParameterException
(
"topicId"
,
"String"
);
}
topicManager
.
setTopTopic
(
topicId
,
setTop
);
return
"success"
;
}
@PostMapping
(
value
=
"/setConceal"
)
@ApiOperation
(
"隐藏/显示主题"
)
@ResponseBody
public
String
setConceal
(
@RequestParam
String
topicId
,
@RequestParam
boolean
setConceal
)
throws
MissingServletRequestParameterException
{
if
(
StringUtils
.
isEmpty
(
topicId
)){
throw
new
MissingServletRequestParameterException
(
"topicId"
,
"String"
);
}
topicManager
.
setTopicConceal
(
topicId
,
setConceal
);
return
"success"
;
}
@PostMapping
(
value
=
"/modifyViewNum"
)
@ApiOperation
(
"主题浏览数调整"
)
@ResponseBody
public
String
modifyViewNum
(
@RequestParam
String
topicId
,
@RequestParam
Long
modifyMount
)
throws
MissingServletRequestParameterException
{
if
(
StringUtils
.
isEmpty
(
topicId
)){
throw
new
MissingServletRequestParameterException
(
"topicId"
,
"String"
);
}
//修改浏览量
return
"success"
;
}
}
community-service/src/main/java/com/tanpu/community/controller/convert/ThemeConvert.java
0 → 100644
View file @
fd84c963
package
com
.
tanpu
.
community
.
controller
.
convert
;
import
com.tanpu.community.api.beans.ThemeDTO
;
import
com.tanpu.community.dao.entity.community.ThemeEntity
;
import
java.util.List
;
import
java.util.stream.Collectors
;
public
class
ThemeConvert
{
public
static
ThemeDTO
convertToDTO
(
ThemeEntity
themeEntity
){
ThemeDTO
themeDTO
=
new
ThemeDTO
();
themeDTO
.
setId
(
themeEntity
.
getId
());
themeDTO
.
setContent
(
themeEntity
.
getContent
());
themeDTO
.
setThemeType
(
themeEntity
.
getThemeType
());
themeDTO
.
setAttachment
(
themeEntity
.
getAttachment
());
themeDTO
.
setAttachType
(
themeEntity
.
getAttachType
());
themeDTO
.
setFormerThemeId
(
themeEntity
.
getFormerThemeId
());
themeDTO
.
setAuthorId
(
themeEntity
.
getAuthorId
());
themeDTO
.
setCreateBy
(
themeEntity
.
getCreateBy
());
themeDTO
.
setUpdateBy
(
themeEntity
.
getUpdateBy
());
themeDTO
.
setCreateTime
(
themeEntity
.
getCreateTime
());
themeDTO
.
setUpdateBy
(
themeEntity
.
getUpdateBy
());
return
themeDTO
;
}
public
static
ThemeEntity
convertToEntity
(
ThemeDTO
themeDTO
){
ThemeEntity
themeEntity
=
new
ThemeEntity
();
themeEntity
.
setContent
(
themeDTO
.
getContent
());
themeEntity
.
setThemeType
(
themeDTO
.
getThemeType
());
themeEntity
.
setAttachment
(
themeDTO
.
getAttachment
());
themeEntity
.
setAttachType
(
themeDTO
.
getAttachType
());
themeEntity
.
setFormerThemeId
(
themeDTO
.
getFormerThemeId
());
themeEntity
.
setAuthorId
(
themeDTO
.
getAuthorId
());
themeEntity
.
setCreateBy
(
themeDTO
.
getCreateBy
());
themeEntity
.
setUpdateBy
(
themeDTO
.
getUpdateBy
());
themeEntity
.
setCreateTime
(
themeDTO
.
getCreateTime
());
themeEntity
.
setUpdateBy
(
themeDTO
.
getUpdateBy
());
return
themeEntity
;
}
public
static
List
<
ThemeDTO
>
convertToEntitys
(
List
<
ThemeEntity
>
topicEntities
){
return
topicEntities
.
stream
().
map
(
ThemeConvert:
:
convertToDTO
).
collect
(
Collectors
.
toList
());
}
public
static
List
<
ThemeDTO
>
convertToDTOs
(
List
<
ThemeEntity
>
topicEntities
){
return
topicEntities
.
stream
().
map
(
ThemeConvert:
:
convertToDTO
).
collect
(
Collectors
.
toList
());
}
}
community-service/src/main/java/com/tanpu/community/controller/convert/TopicConverter.java
0 → 100644
View file @
fd84c963
package
com
.
tanpu
.
community
.
controller
.
convert
;
import
com.tanpu.community.api.beans.TopicDTO
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
java.util.List
;
import
java.util.stream.Collectors
;
public
class
TopicConverter
{
public
static
TopicDTO
convertToDTO
(
TopicEntity
topicEntity
){
TopicDTO
topicDTO
=
new
TopicDTO
();
topicDTO
.
setTopicTitle
(
topicEntity
.
getTopicTitle
());
topicDTO
.
setId
(
topicEntity
.
getId
());
topicDTO
.
setIsTop
(
topicEntity
.
getIsTop
());
topicDTO
.
setIsConceal
(
topicEntity
.
getIsConceal
());
topicDTO
.
setCreateBy
(
topicEntity
.
getCreateBy
());
topicDTO
.
setCreateTime
(
topicEntity
.
getCreateTime
());
topicDTO
.
setUpdateTime
(
topicEntity
.
getUpdateTime
());
topicDTO
.
setUpdateBy
(
topicEntity
.
getUpdateBy
());
topicDTO
.
setDeleteTag
(
topicEntity
.
getDeleteTag
());
return
topicDTO
;
}
public
static
List
<
TopicDTO
>
convertToDTOs
(
List
<
TopicEntity
>
topicEntities
){
return
topicEntities
.
stream
().
map
(
TopicConverter:
:
convertToDTO
).
collect
(
Collectors
.
toList
());
}
}
community-service/src/main/java/com/tanpu/community/dao/entity/community/TopicEntity.java
View file @
fd84c963
...
@@ -24,7 +24,7 @@ public class TopicEntity implements Serializable {
...
@@ -24,7 +24,7 @@ public class TopicEntity implements Serializable {
private
String
id
;
private
String
id
;
@ApiModelProperty
(
value
=
"话题名称"
)
@ApiModelProperty
(
value
=
"话题名称"
)
private
Integer
topicTitle
;
private
String
topicTitle
;
@ApiModelProperty
(
value
=
"是否置顶"
)
@ApiModelProperty
(
value
=
"是否置顶"
)
private
Integer
isTop
;
private
Integer
isTop
;
...
@@ -51,11 +51,11 @@ public class TopicEntity implements Serializable {
...
@@ -51,11 +51,11 @@ public class TopicEntity implements Serializable {
this
.
id
=
id
;
this
.
id
=
id
;
}
}
public
Integer
getTopicTitle
()
{
public
String
getTopicTitle
()
{
return
topicTitle
;
return
topicTitle
;
}
}
public
void
setTopicTitle
(
Integer
topicTitle
)
{
public
void
setTopicTitle
(
String
topicTitle
)
{
this
.
topicTitle
=
topicTitle
;
this
.
topicTitle
=
topicTitle
;
}
}
...
...
community-service/src/main/java/com/tanpu/community/dao/mapper/community/BlackListMapper.java
View file @
fd84c963
package
com
.
tanpu
.
community
.
dao
.
mapper
.
community
;
import
com.tanpu.community.dao.entity.community.BlackListEntity
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* <p>
* 黑名单 Mapper 接口
* </p>
*
* @author xudong
* @since 2021-06-16
*/
public
interface
BlackListMapper
extends
BaseMapper
<
BlackListEntity
>
{
}
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
0 → 100644
View file @
fd84c963
package
com
.
tanpu
.
community
.
manager
;
import
com.tanpu.community.api.constants.BlockTypeEnum
;
import
com.tanpu.community.api.constants.CollectionTypeEnum
;
import
com.tanpu.community.api.constants.CommentTypeEnum
;
import
com.tanpu.community.dao.entity.community.*
;
import
com.tanpu.community.service.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Service
public
class
ThemeManager
{
@Resource
private
ThemeService
themeService
;
@Autowired
private
CollectionService
collectionService
;
@Autowired
private
CommentService
commentService
;
@Autowired
private
FansRelService
fansRelService
;
@Autowired
private
BlackListService
blackListService
;
//返回推荐主题文章
public
List
<
ThemeEntity
>
selectHotThemes
(){
//TOTO:根据算法计算推荐主题
return
null
;
}
//返回关注主题
public
List
<
ThemeEntity
>
selectInterestThemes
(
String
userId
){
List
<
String
>
fansRelEntities
=
fansRelService
.
queryFansByFollowerId
(
userId
).
stream
().
map
(
FansRelEntity:
:
getIdolId
).
collect
(
Collectors
.
toList
());
return
null
;
}
//点赞
public
void
like
(
String
themeId
,
String
userId
)
{
CollectionEntity
collectionEntity
=
new
CollectionEntity
();
collectionEntity
.
setCollectionType
(
CollectionTypeEnum
.
LIKE
.
getCode
());
collectionEntity
.
setAuthorId
(
userId
);
collectionEntity
.
setTargetId
(
themeId
);
collectionEntity
.
setCreateBy
(
userId
);
collectionEntity
.
setCreateTime
(
LocalDateTime
.
now
());
collectionService
.
insertCollection
(
collectionEntity
);
}
//评论
public
void
comment
(
String
themeId
,
String
userId
,
String
comment
)
{
CommentEntity
commentEntity
=
new
CommentEntity
();
commentEntity
.
setTargetId
(
themeId
);
commentEntity
.
setAuthorId
(
userId
);
commentEntity
.
setCommentType
(
CommentTypeEnum
.
TEXT
.
getCode
());
commentEntity
.
setContent
(
comment
);
commentService
.
insertComment
(
commentEntity
);
}
//转发
public
void
forward
(
String
themeId
,
String
user
)
{
}
//分享
public
void
share
(
String
themeId
,
String
user
)
{
}
//收藏
public
void
book
(
String
themeId
,
String
userId
)
{
CollectionEntity
collectionEntity
=
new
CollectionEntity
();
collectionEntity
.
setCollectionType
(
CollectionTypeEnum
.
BOOK
.
getCode
());
collectionEntity
.
setAuthorId
(
userId
);
collectionEntity
.
setTargetId
(
themeId
);
collectionEntity
.
setCreateBy
(
userId
);
collectionEntity
.
setCreateTime
(
LocalDateTime
.
now
());
collectionService
.
insertCollection
(
collectionEntity
);
}
//投诉(主题)
public
void
complaint
(
String
themeId
,
String
user
)
{
}
//屏蔽(用户)
public
void
blockUser
(
String
themeId
,
String
userId
)
{
BlackListEntity
blackListEntity
=
new
BlackListEntity
();
blackListEntity
.
setBlockedId
(
themeService
.
selectTheme
(
themeId
).
getAuthorId
());
blackListEntity
.
setBlocker
(
userId
);
blackListEntity
.
setBlockedType
(
BlockTypeEnum
.
USER
.
getCode
());
blackListService
.
insertBlackList
(
blackListEntity
);
}
//屏蔽(内容)
public
void
blockContent
(
String
themeId
,
String
userId
)
{
BlackListEntity
blackListEntity
=
new
BlackListEntity
();
blackListEntity
.
setBlockedId
(
themeId
);
blackListEntity
.
setBlocker
(
userId
);
blackListEntity
.
setBlockedType
(
BlockTypeEnum
.
CONTENT
.
getCode
());
blackListService
.
insertBlackList
(
blackListEntity
);
}
public
void
insert
(
ThemeEntity
themeEntity
)
{
themeService
.
insertTheme
(
themeEntity
);
}
}
community-service/src/main/java/com/tanpu/community/manager/TopicManager.java
0 → 100644
View file @
fd84c963
package
com
.
tanpu
.
community
.
manager
;
import
com.tanpu.common.exception.BizException
;
import
com.tanpu.community.api.beans.TopicDTO
;
import
com.tanpu.community.controller.convert.TopicConverter
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
com.tanpu.community.service.TopicService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.util.List
;
@Service
public
class
TopicManager
{
@Autowired
private
TopicService
topicService
;
public
void
insertTopic
(
String
topicTitle
,
String
userId
){
TopicEntity
topicEntity
=
new
TopicEntity
();
topicEntity
.
setCreateBy
(
userId
);
topicEntity
.
setUpdateBy
(
userId
);
topicEntity
.
setTopicTitle
(
topicTitle
);
topicEntity
.
setCreateTime
(
LocalDateTime
.
now
());
topicEntity
.
setUpdateTime
(
LocalDateTime
.
now
());
topicEntity
.
setIsTop
(
0
);
topicEntity
.
setIsConceal
(
0
);
topicService
.
addTopic
(
topicEntity
);
}
public
List
<
TopicEntity
>
getAllTopic
()
{
return
topicService
.
queryTopicList
();
}
public
void
setTopTopic
(
String
topicId
,
boolean
setTop
)
{
TopicEntity
topicEntity
=
topicService
.
queryById
(
topicId
);
if
(
topicEntity
==
null
){
throw
new
BizException
(
"话题id不正确:"
+
topicId
);
}
if
(
setTop
){
topicService
.
updateTopicToTop
(
topicId
);
}
else
{
topicService
.
updateTopicNotTop
(
topicId
);
}
}
public
void
setTopicConceal
(
String
topicId
,
boolean
setConceal
)
{
TopicEntity
topicEntity
=
topicService
.
queryById
(
topicId
);
if
(
topicEntity
==
null
){
throw
new
BizException
(
"话题id不正确:"
+
topicId
);
}
if
(
setConceal
){
topicService
.
updateTopicToConceal
(
topicId
);
}
else
{
topicService
.
updateTopicNotConceal
(
topicId
);
}
}
public
TopicDTO
getDetail
(
String
topicId
)
{
TopicEntity
topicEntity
=
topicService
.
queryById
(
topicId
);
TopicDTO
topicDTO
=
TopicConverter
.
convertToDTO
(
topicEntity
);
//TODO:添加实时数据
return
topicDTO
;
}
}
community-service/src/main/java/com/tanpu/community/manager/exception/BizException.java
0 → 100644
View file @
fd84c963
package
com
.
tanpu
.
community
.
manager
.
exception
;
public
class
BizException
extends
Exception
{
public
BizException
(){
super
();
}
public
BizException
(
String
message
){
super
(
message
);
}
public
BizException
(
String
message
,
Throwable
cause
){
super
(
message
,
cause
);
}
public
BizException
(
Throwable
cause
){
super
(
cause
);
}
}
community-service/src/main/java/com/tanpu/community/service/BlackListService.java
0 → 100644
View file @
fd84c963
package
com
.
tanpu
.
community
.
service
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.tanpu.community.dao.entity.community.BlackListEntity
;
import
com.tanpu.community.dao.mapper.community.BlackListMapper
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
@Service
public
class
BlackListService
{
@Resource
private
BlackListMapper
blackListMapper
;
public
void
insertBlackList
(
BlackListEntity
blackListEntity
){
blackListMapper
.
insert
(
blackListEntity
);
}
public
void
deleteBlackList
(
String
blocker
,
String
blockId
,
String
blockType
){
blackListMapper
.
delete
(
new
LambdaQueryWrapper
<
BlackListEntity
>().
eq
(
BlackListEntity:
:
getBlocker
,
blocker
).
eq
(
BlackListEntity:
:
getBlockedId
,
blockId
).
eq
(
BlackListEntity:
:
getBlockedType
,
blockType
));
return
;
}
}
community-service/src/main/java/com/tanpu/community/service/CollectionService.java
0 → 100644
View file @
fd84c963
package
com
.
tanpu
.
community
.
service
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.tanpu.community.dao.entity.community.CollectionEntity
;
import
com.tanpu.community.dao.mapper.community.CollectionMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
@Service
public
class
CollectionService
{
@Resource
private
CollectionMapper
collectionMapper
;
public
void
insertCollection
(
CollectionEntity
collectionEntity
){
collectionMapper
.
insert
(
collectionEntity
);
}
//根据用户id获取点赞列表
public
List
<
CollectionEntity
>
getLikeListByUser
(
String
userId
){
return
collectionMapper
.
selectList
(
new
LambdaQueryWrapper
<
CollectionEntity
>().
eq
(
CollectionEntity:
:
getCollectionType
,
1
));
}
//根据用户id获取收藏列表
public
List
<
CollectionEntity
>
getBookListByUser
(
String
userId
){
return
collectionMapper
.
selectList
(
new
LambdaQueryWrapper
<
CollectionEntity
>().
eq
(
CollectionEntity:
:
getCollectionType
,
2
));
}
}
community-service/src/main/java/com/tanpu/community/service/CommentService.java
0 → 100644
View file @
fd84c963
package
com
.
tanpu
.
community
.
service
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.tanpu.community.dao.entity.community.CommentEntity
;
import
com.tanpu.community.dao.mapper.community.CommentMapper
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
@Service
public
class
CommentService
{
@Resource
private
CommentMapper
commentMapper
;
public
void
insertComment
(
CommentEntity
commentEntity
){
commentMapper
.
insert
(
commentEntity
);
}
public
List
<
CommentEntity
>
selectByUserId
(
String
userId
){
return
commentMapper
.
selectList
(
new
LambdaQueryWrapper
<
CommentEntity
>().
eq
(
CommentEntity:
:
getAuthorId
,
userId
));
}
}
community-service/src/main/java/com/tanpu/community/service/RedisService.java
View file @
fd84c963
package
com
.
tanpu
.
community
.
service
;
package
com
.
tanpu
.
community
.
service
;
import
com.tanpu.common.exception.BizException
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -45,4 +45,26 @@ public class RedisService {
...
@@ -45,4 +45,26 @@ public class RedisService {
Object
v
=
redisTemplate
.
opsForValue
().
get
(
key
);
Object
v
=
redisTemplate
.
opsForValue
().
get
(
key
);
return
v
==
null
?
null
:
(
Integer
)
v
;
return
v
==
null
?
null
:
(
Integer
)
v
;
}
}
/**
* incr
*/
public
long
incr
(
String
key
,
Long
delta
){
if
(
delta
<
0
){
throw
new
BizException
(
"递增银子必须大于0"
);
}
return
redisTemplate
.
opsForValue
().
increment
(
key
,
delta
);
}
/**
* incr
*/
public
long
decr
(
String
key
,
Long
delta
){
if
(
delta
<
0
){
throw
new
BizException
(
"递减银子必须大于0"
);
}
return
redisTemplate
.
opsForValue
().
decrement
(
key
,
delta
);
}
}
}
community-service/src/main/java/com/tanpu/community/service/ThemeService.java
0 → 100644
View file @
fd84c963
package
com
.
tanpu
.
community
.
service
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.tanpu.community.dao.entity.community.ThemeEntity
;
import
com.tanpu.community.dao.mapper.community.ThemeMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
@Service
public
class
ThemeService
{
@Resource
private
ThemeMapper
themeMapper
;
public
void
insertTheme
(
ThemeEntity
themeEntity
){
themeMapper
.
insert
(
themeEntity
);
}
//根据id返回主题详情
public
ThemeEntity
selectTheme
(
String
themeId
){
return
themeMapper
.
selectById
(
themeId
);
}
//根据话题查询主题
public
List
<
ThemeEntity
>
selectByTopic
(
String
topidId
){
QueryWrapper
<
ThemeEntity
>
themeEntityQueryWrapper
=
new
QueryWrapper
<>();
themeEntityQueryWrapper
.
eq
(
"topic_id"
,
topidId
);
return
themeMapper
.
selectList
(
themeEntityQueryWrapper
);
}
}
community-service/src/main/java/com/tanpu/community/service/TopicService.java
0 → 100644
View file @
fd84c963
package
com
.
tanpu
.
community
.
service
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.tanpu.community.dao.entity.community.TopicEntity
;
import
com.tanpu.community.dao.mapper.community.TopicMapper
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
@Service
@EnableCaching
public
class
TopicService
{
@Resource
private
TopicMapper
topicMapper
;
public
List
<
TopicEntity
>
queryTopicList
(){
return
topicMapper
.
selectList
(
new
QueryWrapper
<>());
}
public
void
addTopic
(
TopicEntity
topicEntity
){
topicMapper
.
insert
(
topicEntity
);
}
public
void
updateTopicToTop
(
String
topicId
){
UpdateWrapper
<
TopicEntity
>
updateWrapper
=
new
UpdateWrapper
<>();
updateWrapper
.
eq
(
"id"
,
topicId
);
updateWrapper
.
set
(
"is_top"
,
1
);
topicMapper
.
update
(
null
,
updateWrapper
);
}
public
void
updateTopicNotTop
(
String
topicId
){
UpdateWrapper
<
TopicEntity
>
updateWrapper
=
new
UpdateWrapper
<>();
updateWrapper
.
eq
(
"id"
,
topicId
);
updateWrapper
.
set
(
"is_top"
,
0
);
topicMapper
.
update
(
null
,
updateWrapper
);
}
public
void
updateTopicToConceal
(
String
topicId
){
UpdateWrapper
<
TopicEntity
>
updateWrapper
=
new
UpdateWrapper
<>();
updateWrapper
.
eq
(
"id"
,
topicId
);
updateWrapper
.
set
(
"is_conceal"
,
1
);
topicMapper
.
update
(
null
,
updateWrapper
);
}
public
void
updateTopicNotConceal
(
String
topicId
){
UpdateWrapper
<
TopicEntity
>
updateWrapper
=
new
UpdateWrapper
<>();
updateWrapper
.
eq
(
"id"
,
topicId
);
updateWrapper
.
set
(
"is_conceal"
,
0
);
topicMapper
.
update
(
null
,
updateWrapper
);
}
public
TopicEntity
queryById
(
String
topicId
)
{
return
topicMapper
.
selectById
(
topicId
);
}
}
docs/create.sql
View file @
fd84c963
...
@@ -50,7 +50,7 @@ CREATE TABLE `theme` (
...
@@ -50,7 +50,7 @@ CREATE TABLE `theme` (
CREATE
TABLE
`comment`
(
CREATE
TABLE
`comment`
(
`id`
varchar
(
64
)
PRIMARY
KEY
COMMENT
'id'
,
`id`
varchar
(
64
)
PRIMARY
KEY
COMMENT
'id'
,
`comment_type`
int
(
4
)
NOT
NULL
COMMENT
'类型'
,
`comment_type`
int
(
4
)
NOT
NULL
COMMENT
'类型
,目前仅支持1:文字,上限500字
'
,
`content`
text
COMMENT
'文本内容'
,
`content`
text
COMMENT
'文本内容'
,
`author_id`
varchar
(
64
)
NOT
NULL
COMMENT
'作者id'
,
`author_id`
varchar
(
64
)
NOT
NULL
COMMENT
'作者id'
,
`target_id`
varchar
(
64
)
NOT
NULL
COMMENT
'评论的目标id'
,
`target_id`
varchar
(
64
)
NOT
NULL
COMMENT
'评论的目标id'
,
...
@@ -67,7 +67,7 @@ CREATE TABLE `comment` (
...
@@ -67,7 +67,7 @@ CREATE TABLE `comment` (
CREATE
TABLE
`collection`
(
CREATE
TABLE
`collection`
(
`id`
varchar
(
64
)
PRIMARY
KEY
COMMENT
'id'
,
`id`
varchar
(
64
)
PRIMARY
KEY
COMMENT
'id'
,
`collection_type`
int
(
4
)
NOT
NULL
COMMENT
'类型'
,
`collection_type`
int
(
4
)
NOT
NULL
COMMENT
'类型
,1:点赞,2:收藏
'
,
`author_id`
varchar
(
64
)
NOT
NULL
COMMENT
'作者id'
,
`author_id`
varchar
(
64
)
NOT
NULL
COMMENT
'作者id'
,
`target_id`
varchar
(
64
)
NOT
NULL
COMMENT
'评论的目标id'
,
`target_id`
varchar
(
64
)
NOT
NULL
COMMENT
'评论的目标id'
,
`create_by`
varchar
(
64
)
DEFAULT
''
,
`create_by`
varchar
(
64
)
DEFAULT
''
,
...
@@ -82,7 +82,7 @@ CREATE TABLE `collection` (
...
@@ -82,7 +82,7 @@ CREATE TABLE `collection` (
CREATE
TABLE
`topic`
(
CREATE
TABLE
`topic`
(
`id`
varchar
(
64
)
PRIMARY
KEY
COMMENT
'id'
,
`id`
varchar
(
64
)
PRIMARY
KEY
COMMENT
'id'
,
`topic_title`
int
(
4
)
NOT
NULL
COMMENT
'话题名称'
,
`topic_title`
varchar
(
6
4
)
NOT
NULL
COMMENT
'话题名称'
,
`is_top`
int
(
4
)
NOT
NULL
COMMENT
'是否置顶'
,
`is_top`
int
(
4
)
NOT
NULL
COMMENT
'是否置顶'
,
`is_conceal`
int
(
4
)
NOT
NULL
COMMENT
'是否隐藏'
,
`is_conceal`
int
(
4
)
NOT
NULL
COMMENT
'是否隐藏'
,
`create_by`
varchar
(
64
)
DEFAULT
''
,
`create_by`
varchar
(
64
)
DEFAULT
''
,
...
@@ -111,7 +111,7 @@ CREATE TABLE `file_record` (
...
@@ -111,7 +111,7 @@ CREATE TABLE `file_record` (
CREATE
TABLE
`black_list`
(
CREATE
TABLE
`black_list`
(
`id`
varchar
(
64
)
PRIMARY
KEY
COMMENT
'id'
,
`id`
varchar
(
64
)
PRIMARY
KEY
COMMENT
'id'
,
`blocker`
varchar
(
64
)
NOT
NULL
COMMENT
'屏蔽发起人'
,
`blocker`
varchar
(
64
)
NOT
NULL
COMMENT
'屏蔽发起人'
,
`blocked_type`
int
(
4
)
NOT
NULL
COMMENT
'屏蔽类型'
,
`blocked_type`
int
(
4
)
NOT
NULL
COMMENT
'屏蔽类型
,1:用户,2:内容
'
,
`blocked_id`
varchar
(
64
)
NOT
NULL
COMMENT
'被屏蔽的'
,
`blocked_id`
varchar
(
64
)
NOT
NULL
COMMENT
'被屏蔽的'
,
`create_by`
varchar
(
64
)
DEFAULT
''
,
`create_by`
varchar
(
64
)
DEFAULT
''
,
`create_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
`create_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
,
...
...
pom.xml
View file @
fd84c963
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
<dependency>
<dependency>
<groupId>
com.tanpu
</groupId>
<groupId>
com.tanpu
</groupId>
<artifactId>
common
</artifactId>
<artifactId>
common
</artifactId>
<version>
1.0.
3
-RELEASE
</version>
<version>
1.0.
4
-RELEASE
</version>
</dependency>
</dependency>
<dependency>
<dependency>
...
...
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