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
d3594c25
Commit
d3594c25
authored
Feb 21, 2022
by
刘基明
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2.3.1' into 'dev'
置頂 See merge request
!49
parents
e1cd4c35
666c52da
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
64 additions
and
24 deletions
+64
-24
ThemeQo.java
...c/main/java/com/tanpu/community/api/beans/qo/ThemeQo.java
+9
-0
CodeAutoGenerator.java
.../main/java/com/tanpu/community/dao/CodeAutoGenerator.java
+1
-1
ThemeEntity.java
...com/tanpu/community/dao/entity/community/ThemeEntity.java
+26
-2
ThemeMapper.java
...com/tanpu/community/dao/mapper/community/ThemeMapper.java
+1
-1
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+1
-1
TopicManager.java
...c/main/java/com/tanpu/community/manager/TopicManager.java
+1
-1
ConvertUtil.java
...e/src/main/java/com/tanpu/community/util/ConvertUtil.java
+1
-0
ThemeEntityMapper.xml
...src/main/resources/mapper/community/ThemeEntityMapper.xml
+24
-18
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/qo/ThemeQo.java
View file @
d3594c25
...
...
@@ -9,6 +9,7 @@ import lombok.Data;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.util.List
;
@Data
...
...
@@ -98,8 +99,16 @@ public class ThemeQo implements Serializable {
@ApiModelProperty
(
value
=
"评论Id(我的评论列表使用)"
)
public
String
commentId
;
@ApiModelProperty
(
value
=
"是否顶置 1是 0否"
)
private
Integer
isTop
;
@ApiModelProperty
(
value
=
"置顶时间"
)
private
LocalDateTime
setTopTime
;
@ApiModelProperty
(
value
=
"创建时间"
)
public
Long
createTime
;
@ApiModelProperty
(
value
=
"更新时间"
)
public
Long
updateTime
;
//认证标签相关
...
...
community-service/src/main/java/com/tanpu/community/dao/CodeAutoGenerator.java
View file @
d3594c25
...
...
@@ -23,7 +23,7 @@ public class CodeAutoGenerator {
String
mysqlPassword
=
"@imeng123"
;
String
jdbcUrl
=
"jdbc:mysql://rm-uf6r22t3d798q4kmkao.mysql.rds.aliyuncs.com:3306/tamp_community"
;
// String[] tables = new String[]{"theme"};
String
[]
tables
=
new
String
[]{
"
comment
"
};
String
[]
tables
=
new
String
[]{
"
theme
"
};
String
basePackage
=
"com.tanpu.community"
;
String
mapperPackage
=
"dao.mapper.community"
;
String
entityPackage
=
"dao.entity.community"
;
...
...
community-service/src/main/java/com/tanpu/community/dao/entity/community/ThemeEntity.java
View file @
d3594c25
...
...
@@ -18,7 +18,7 @@ import java.time.LocalDateTime;
* </p>
*
* @author xudong
* @since 202
1-07-28
* @since 202
2-02-21
*/
@TableName
(
"theme"
)
@Builder
...
...
@@ -42,7 +42,7 @@ public class ThemeEntity implements Serializable {
@ApiModelProperty
(
value
=
"类型 1:讨论无标题 2:长文有标题 3:转发"
)
private
Integer
themeType
;
@ApiModelProperty
(
value
=
"文本内容(json),type:附件类型(108:文本,88:产品 3:直播 6:短视频 303:新版课程-
视频,304: 新版课程-音
频,109:单图(长文) 110:多图(讨论)),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
;
@ApiModelProperty
(
value
=
"作者id"
)
...
...
@@ -60,6 +60,12 @@ public class ThemeEntity implements Serializable {
@ApiModelProperty
(
value
=
"举报状态 0:未被举报 1:被举报 2:已处理"
)
private
Integer
reportStatus
;
@ApiModelProperty
(
value
=
"是否顶置 1是 0否"
)
private
Integer
isTop
;
@ApiModelProperty
(
value
=
"置顶时间"
)
private
LocalDateTime
setTopTime
;
private
LocalDateTime
createTime
;
private
LocalDateTime
updateTime
;
...
...
@@ -148,6 +154,22 @@ public class ThemeEntity implements Serializable {
this
.
reportStatus
=
reportStatus
;
}
public
Integer
getIsTop
()
{
return
isTop
;
}
public
void
setIsTop
(
Integer
isTop
)
{
this
.
isTop
=
isTop
;
}
public
LocalDateTime
getSetTopTime
()
{
return
setTopTime
;
}
public
void
setSetTopTime
(
LocalDateTime
setTopTime
)
{
this
.
setTopTime
=
setTopTime
;
}
public
LocalDateTime
getCreateTime
()
{
return
createTime
;
}
...
...
@@ -185,6 +207,8 @@ public class ThemeEntity implements Serializable {
", topicId="
+
topicId
+
", reviewStatus="
+
reviewStatus
+
", reportStatus="
+
reportStatus
+
", isTop="
+
isTop
+
", setTopTime="
+
setTopTime
+
", createTime="
+
createTime
+
", updateTime="
+
updateTime
+
", deleteTag="
+
deleteTag
+
...
...
community-service/src/main/java/com/tanpu/community/dao/mapper/community/ThemeMapper.java
View file @
d3594c25
...
...
@@ -16,7 +16,7 @@ import java.util.List;
* </p>
*
* @author xudong
* @since 202
1-07-23
* @since 202
2-02-21
*/
public
interface
ThemeMapper
extends
BaseMapper
<
ThemeEntity
>
{
...
...
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
d3594c25
...
...
@@ -548,7 +548,7 @@ public class ThemeManager {
// todo 测试性能
commentService
.
queryRecentComments
(
resp
.
themes
);
// 讨论区添加是否管理员
// 讨论区添加是否管理员
,是否顶置
if
(
ThemeListTypeEnum
.
TOPIC_LATEST
.
getCode
().
equals
(
req
.
getType
())
||
ThemeListTypeEnum
.
TOPIC_HOT
.
getCode
().
equals
(
req
.
getType
()))
{
topicService
.
checkManager
(
req
.
getTopicId
(),
resp
.
themes
);
...
...
community-service/src/main/java/com/tanpu/community/manager/TopicManager.java
View file @
d3594c25
...
...
@@ -66,7 +66,7 @@ public class TopicManager {
List
<
TopicRankQo
>
topicList
=
rankService
.
getRankTopicList
(
keyword
);
if
(
CollectionUtils
.
isEmpty
(
topicList
))
return
topicList
;
// 只取前两条
if
(
topicList
.
size
()
>
2
)
topicList
=
topicList
.
subList
(
0
,
1
);
if
(
topicList
.
size
()
>
2
)
topicList
=
topicList
.
subList
(
0
,
2
);
// 添加权限
topicService
.
batchCheckPermission
(
topicList
,
userHolder
.
getUserId
());
return
topicList
;
...
...
community-service/src/main/java/com/tanpu/community/util/ConvertUtil.java
View file @
d3594c25
...
...
@@ -50,6 +50,7 @@ public class ConvertUtil {
themeQO
.
setUpToNowTime
(
TimeUtils
.
calUpToNowTime
(
themeEntity
.
getCreateTime
()));
themeQO
.
setFormatTime
(
TimeUtils
.
format
(
themeEntity
.
getCreateTime
()));
List
<
ThemeContentQo
>
themeContentQos
=
JsonUtil
.
toBean
(
themeEntity
.
getContent
(),
new
TypeReference
<
List
<
ThemeContentQo
>>()
{
});
// 屏蔽手机号和邮箱
...
...
community-service/src/main/resources/mapper/community/ThemeEntityMapper.xml
View file @
d3594c25
<?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.ThemeMapper"
>
<!-- 通用查询映射结果 -->
<sql
id=
"Base_Column_List"
>
id,
...
...
@@ -14,38 +13,45 @@
topic_id,
review_status,
report_status,
is_top,
set_top_time,
create_time,
update_time,
delete_tag
</sql>
<resultMap
id=
"BaseResultMap"
type=
"com.tanpu.community.dao.entity.community.ThemeEntity"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"theme_id"
property=
"themeId"
/>
<result
column=
"title"
property=
"title"
/>
<result
column=
"theme_type"
property=
"themeType"
/>
<result
column=
"content"
property=
"content"
/>
<result
column=
"author_id"
property=
"authorId"
/>
<result
column=
"former_theme_id"
property=
"formerThemeId"
/>
<result
column=
"topic_id"
property=
"topicId"
/>
<result
column=
"review_status"
property=
"reviewStatus"
/>
<result
column=
"report_status"
property=
"reportStatus"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
<result
column=
"delete_tag"
property=
"deleteTag"
/>
<id
column=
"id"
property=
"id"
/>
<result
column=
"theme_id"
property=
"themeId"
/>
<result
column=
"title"
property=
"title"
/>
<result
column=
"theme_type"
property=
"themeType"
/>
<result
column=
"content"
property=
"content"
/>
<result
column=
"author_id"
property=
"authorId"
/>
<result
column=
"former_theme_id"
property=
"formerThemeId"
/>
<result
column=
"topic_id"
property=
"topicId"
/>
<result
column=
"review_status"
property=
"reviewStatus"
/>
<result
column=
"report_status"
property=
"reportStatus"
/>
<result
column=
"is_top"
property=
"isTop"
/>
<result
column=
"set_top_time"
property=
"setTopTime"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
<result
column=
"delete_tag"
property=
"deleteTag"
/>
</resultMap>
<!--auto generated by MybatisCodeHelper on 2022-02-17-->
<!--auto generated by MybatisCodeHelper on 2022-02-17-->
<select
id=
"queryOneByTopicIdOrderByUpdateTimeDesc"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from theme
where topic_id=#{topicId} order by update_time desc limit 1
where topic_id = #{topicId}
order by update_time desc
limit 1
</select>
<!--auto generated by MybatisCodeHelper on 2022-02-17-->
<!--auto generated by MybatisCodeHelper on 2022-02-17-->
<select
id=
"countByTopicIdAndCreateTimeAfter"
resultType=
"java.lang.Integer"
>
select count(1)
from theme
where topic_id=#{topicId} and create_time
<![CDATA[>]]>
#{minCreateTime}
where topic_id = #{topicId}
and create_time
<![CDATA[>]]>
#{minCreateTime}
</select>
</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