perf(database): 移除重复查询并添加FastJSON依赖
- 移除CmsContentLikeMapper中查询最近点赞的DISTINCT关键字 - 移除CmsContentMapper中查询最近创建内容的DISTINCT关键字 - 移除CmsContentViewMapper中查询最近浏览的DISTINCT关键字 - 添加FastJSON依赖用于JetCache序列化支持
This commit is contained in:
parent
95b4ac0600
commit
5bb2bfe0b9
7
pom.xml
7
pom.xml
|
|
@ -249,6 +249,13 @@
|
|||
<artifactId>redisson-spring-boot-starter</artifactId>
|
||||
<version>${redisson.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- FastJSON 用于 JetCache 序列化 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.83</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<dependencyManagement>
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
</select>
|
||||
|
||||
<select id="queryRecentLikesByUserId" resultType="Long">
|
||||
SELECT DISTINCT content_id FROM cms_content_like
|
||||
SELECT content_id FROM cms_content_like
|
||||
WHERE user_id = #{userId} AND delete_flag = 0
|
||||
ORDER BY like_time DESC
|
||||
LIMIT #{limit}
|
||||
|
|
|
|||
|
|
@ -298,7 +298,7 @@
|
|||
|
||||
<!--查询用户最近创建的内容ID列表-->
|
||||
<select id="queryRecentCreatedByUserId" resultType="Long">
|
||||
select distinct content_id from cms_content
|
||||
select content_id from cms_content
|
||||
where author_id = #{userId} and delete_flag = 0
|
||||
order by create_time desc
|
||||
limit #{limit}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
</select>
|
||||
|
||||
<select id="queryRecentViewsByUserId" resultType="Long">
|
||||
SELECT DISTINCT content_id FROM cms_content_view
|
||||
SELECT content_id FROM cms_content_view
|
||||
WHERE user_id = #{userId} AND delete_flag = 0
|
||||
ORDER BY view_time DESC
|
||||
LIMIT #{limit}
|
||||
|
|
|
|||
Loading…
Reference in New Issue