Skip to content

Commit c53d3f0

Browse files
committed
fix[all]:修复部署到生产后的问题
1 parent b51cd6a commit c53d3f0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+791
-213
lines changed

dbblog-backend/dbblog-core/src/main/java/cn/dblearn/blog/entity/article/Article.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,7 @@ public class Article implements Serializable {
7676
@ApiModelProperty(value = "发布状态")
7777
private Boolean publish;
7878

79+
@ApiModelProperty(value = "是否置顶")
80+
private Boolean top;
7981

8082
}

dbblog-backend/dbblog-core/src/main/java/cn/dblearn/blog/entity/book/BookNote.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,9 @@ public class BookNote implements Serializable {
8282
@ApiModelProperty(value = "封面类型")
8383
private Integer coverType;
8484

85+
@ApiModelProperty(value = "是否置顶")
86+
private Boolean top;
87+
88+
8589

8690
}

dbblog-backend/dbblog-core/src/main/java/cn/dblearn/blog/mapper/article/ArticleMapper.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,11 @@ public interface ArticleMapper extends BaseMapper<Article> {
5757
* @param parseInt
5858
*/
5959
void updateLikeNum(int parseInt);
60+
61+
/**
62+
* 判断类别下是否有文章
63+
* @param categoryId
64+
* @return
65+
*/
66+
int checkByCategory(Integer categoryId);
6067
}

dbblog-backend/dbblog-core/src/main/java/cn/dblearn/blog/mapper/book/BookMapper.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,11 @@ public interface BookMapper extends BaseMapper<Book> {
4848
* @param parseInt
4949
*/
5050
void updateLikeNum(int parseInt);
51+
52+
/**
53+
* 判断类别下是否有图书
54+
* @param categoryId
55+
* @return
56+
*/
57+
int checkByCategory(Integer categoryId);
5158
}

dbblog-backend/dbblog-core/src/main/java/cn/dblearn/blog/mapper/book/BookNoteMapper.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,11 @@ public interface BookNoteMapper extends BaseMapper<BookNote> {
6363
* @param parseInt
6464
*/
6565
void updateLikeNum(int parseInt);
66+
67+
/**
68+
* 判断该类别下是否有笔记
69+
* @param categoryId
70+
* @return
71+
*/
72+
int checkByCategory(Integer categoryId);
6673
}

dbblog-backend/dbblog-core/src/main/java/cn/dblearn/blog/mapper/operation/TagMapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
public interface TagMapper extends BaseMapper<Tag> {
2121

2222
/**
23-
* 根据foreignId获取Tag列表
23+
* 根据linkId获取Tag列表
2424
* @param linkId
2525
* @param type
2626
* @return
2727
*/
2828
List<Tag> listByLinkId(@Param("linkId") Integer linkId, @Param("type") Integer type);
2929

3030
/**
31-
* 根据foreignId删除多对多关联
31+
* 根据linkId删除多对多关联
3232
* @param linkId
3333
* @param type
3434
*/

dbblog-backend/dbblog-core/src/main/resources/application-prod.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ oss:
4040
qiniu:
4141
domain: http://oss.dblearn.cn
4242
prefix: dbblog
43-
accessKey: ENC(pVGOa/io1AnqiEKkDTVORO3W8nzn+vbOl53TeRBIGgCuWvqUEzOAdIBLmdpoYVmsDHESGVc2QzY=)
44-
secretKey: ENC(UXM3TEuaIuLrPdKuDASHoZExQyOrgGl7PqV/iB0EbHOFhnUSF3bMol8D2qh+QlthccS5QD0fHbM=)
45-
bucketName: dbblog
43+
accessKey: tn86cySoW7wAY2dj8T1OBCwR4UeUPAi5MXPU-4vS
44+
secretKey: IODztoTbbgmXxiO26CxM_8o4wpLX42Q8DYu9Wj2l
45+
bucketName: dbblog

dbblog-backend/dbblog-core/src/main/resources/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ server:
1515
spring:
1616
profiles:
1717
# 环境 开发dev,测试test,生产prod
18-
active: dev
18+
active: prod
1919
jackson:
2020
serialization:
2121
# jackson返回时间戳

dbblog-backend/dbblog-core/src/main/resources/logback-spring.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@
1313

1414
<!-- 生产环境 -->
1515
<springProfile name="prod">
16-
<logger name="org.springframework.web" level="ERROR"/>
17-
<logger name="org.springboot.sample" level="ERROR" />
18-
<logger name="cn.dblearn.blog" level="ERROR" />
16+
<!--<logger name="org.springframework.web" level="ERROR"/>-->
17+
<!--<logger name="org.springboot.sample" level="ERROR" />-->
18+
<!--<logger name="cn.dblearn.blog" level="ERROR" />-->
19+
<logger name="org.springframework.web" level="INFO"/>
20+
<logger name="org.springboot.sample" level="INFO" />
21+
<logger name="cn.dblearn.blog" level="DEBUG" />
1922
</springProfile>
2023

2124
</configuration>

dbblog-backend/dbblog-core/src/main/resources/mapper/article/ArticleMapper.xml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<mapper namespace="cn.dblearn.blog.mapper.article.ArticleMapper">
44

55
<sql id="homeArticleColumn">
6-
id,title,description,author,read_num,comment_num,like_num,cover,cover_type,create_time
6+
id,title,description,author,read_num,comment_num,like_num,cover,cover_type,create_time,top
77
</sql>
88

99
<select id="listArticleVo" resultType="cn.dblearn.blog.entity.article.vo.ArticleVo">
@@ -24,18 +24,19 @@
2424
<if test="params.categoryId !=null and params.categoryId != ''">
2525
and find_in_set(#{params.categoryId},category_id)
2626
</if>
27+
and publish = true
2728
</where>
2829
<if test="params.recommend !=null and params.recommend != ''">
29-
order by create_time desc
30+
order by top desc, recommend desc
3031
</if>
3132
<if test="params.latest !=null and params.latest != ''">
32-
order by create_time desc
33+
order by top desc,create_time desc
3334
</if>
3435
<if test="params.favorite !=null and params.favorite != ''">
35-
order by like_num desc
36+
order by top desc,like_num desc
3637
</if>
3738
<if test="params.commentMost !=null and params.commentMost != ''">
38-
order by comment_num desc
39+
order by top desc,comment_num desc
3940
</if>
4041

4142
</select>
@@ -51,4 +52,8 @@
5152
<update id="updateLikeNum">
5253
update article set like_num = like_num + 1 where id = #{id}
5354
</update>
55+
56+
<select id="checkByCategory" resultType="Integer">
57+
select count(*) from article where category_id = #{categoryId}
58+
</select>
5459
</mapper>

0 commit comments

Comments
 (0)