2525 *
2626 */
2727@ Entity
28- @ Table (indexes = {@ Index (name ="topic_idx" , columnList ="tagId,status" ),@ Index (name ="topic_3_idx" , columnList ="userName,postTime" ),@ Index (name ="topic_5_idx" , columnList ="status,sort,lastReplyTime" )})
28+ @ Table (indexes = {@ Index (name ="topic_idx" , columnList ="tagId,status" ),@ Index (name ="topic_3_idx" , columnList ="userName,postTime" ),@ Index (name ="topic_5_idx" , columnList ="status,sort,lastReplyTime" ), @ Index ( name = "topic_6_idx" , columnList = "weight" ) })
2929public class Topic implements Serializable {
3030 private static final long serialVersionUID = -684257451052921859L ;
3131
@@ -49,7 +49,12 @@ public class Topic implements Serializable{
4949 @ Lob
5050 private String summary ;
5151
52+ /** 是否使用Markdown **/
53+ private Boolean isMarkdown ;
5254
55+ /** Markdown内容 **/
56+ @ Lob
57+ private String markdownContent ;
5358
5459 /** 发表时间 **/
5560 @ Temporal (TemporalType .TIMESTAMP )
@@ -131,6 +136,9 @@ public class Topic implements Serializable{
131136 /** 状态 10.待审核 20.已发布 110.待审核删除 120.已发布删除 **/
132137 private Integer status = 10 ;
133138
139+ /** 权重 = P表示热度因子(评论数+点赞数+浏览数);T表示距离发帖的时间(单位为小时);G表示"重力因子"(gravityth power),即将帖子排名往下拉的力量,默认值为1.8; 权重小于0时表示强制下沉,不再在热门榜上显示; 超出时间限制的热门话题权重在重新计算时设置为0 KaTeX公式表示:Score = \dfrac{P-1}{(T+2)^G} **/
140+ private Double weight = 0d ;
141+
134142 public Long getId () {
135143 return id ;
136144 }
@@ -318,5 +326,23 @@ public Integer getUserInfoStatus() {
318326 public void setUserInfoStatus (Integer userInfoStatus ) {
319327 this .userInfoStatus = userInfoStatus ;
320328 }
329+ public Boolean getIsMarkdown () {
330+ return isMarkdown ;
331+ }
332+ public void setIsMarkdown (Boolean isMarkdown ) {
333+ this .isMarkdown = isMarkdown ;
334+ }
335+ public String getMarkdownContent () {
336+ return markdownContent ;
337+ }
338+ public void setMarkdownContent (String markdownContent ) {
339+ this .markdownContent = markdownContent ;
340+ }
341+ public Double getWeight () {
342+ return weight ;
343+ }
344+ public void setWeight (Double weight ) {
345+ this .weight = weight ;
346+ }
321347
322348}
0 commit comments