Skip to content

Commit 8b4a8cb

Browse files
committed
更新
1 parent 5656b8a commit 8b4a8cb

File tree

71 files changed

+2168
-397
lines changed

Some content is hidden

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

71 files changed

+2168
-397
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>bbs</groupId>
44
<artifactId>bbs</artifactId>
5-
<version>6.0</version>
5+
<version>6.1</version>
66
<packaging>war</packaging>
77
<name>bbs</name>
88
<description/>

src/main/java/cms/bean/help/Help.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ public class Help implements Serializable{
4343
/** 帮助内容 **/
4444
@Lob
4545
private String content;
46+
/** 是否使用Markdown **/
47+
private Boolean isMarkdown;
48+
/** Markdown内容 **/
49+
@Lob
50+
private String markdownContent;
4651
/** 发表时间 **/
4752
@Temporal(TemporalType.TIMESTAMP)
4853
private Date times = new Date();
@@ -121,6 +126,18 @@ public boolean isVisible() {
121126
public void setVisible(boolean visible) {
122127
this.visible = visible;
123128
}
129+
public Boolean getIsMarkdown() {
130+
return isMarkdown;
131+
}
132+
public void setIsMarkdown(Boolean isMarkdown) {
133+
this.isMarkdown = isMarkdown;
134+
}
135+
public String getMarkdownContent() {
136+
return markdownContent;
137+
}
138+
public void setMarkdownContent(String markdownContent) {
139+
this.markdownContent = markdownContent;
140+
}
124141

125142

126143

src/main/java/cms/bean/question/Answer.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ public class Answer implements Serializable{
6868
/** 答案内容 **/
6969
@Lob
7070
private String content;
71+
/** 是否使用Markdown **/
72+
private Boolean isMarkdown;
73+
/** Markdown内容 **/
74+
@Lob
75+
private String markdownContent;
7176
/** 回答时间 **/
7277
@Temporal(TemporalType.TIMESTAMP)
7378
private Date postTime = new Date();
@@ -253,6 +258,22 @@ public Integer getUserInfoStatus() {
253258
public void setUserInfoStatus(Integer userInfoStatus) {
254259
this.userInfoStatus = userInfoStatus;
255260
}
261+
262+
public Boolean getIsMarkdown() {
263+
return isMarkdown;
264+
}
265+
266+
public void setIsMarkdown(Boolean isMarkdown) {
267+
this.isMarkdown = isMarkdown;
268+
}
269+
270+
public String getMarkdownContent() {
271+
return markdownContent;
272+
}
273+
274+
public void setMarkdownContent(String markdownContent) {
275+
this.markdownContent = markdownContent;
276+
}
256277

257278

258279

src/main/java/cms/bean/question/AppendQuestionItem.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import java.io.Serializable;
44
import java.util.Date;
55

6+
import javax.persistence.Lob;
7+
68
/**
79
* 追加问题项
810
* @author Gao
@@ -14,6 +16,10 @@ public class AppendQuestionItem implements Serializable{
1416
private String id;
1517
/** 追加内容 **/
1618
private String content;
19+
/** 是否使用Markdown **/
20+
private Boolean isMarkdown;
21+
/** Markdown内容 **/
22+
private String markdownContent;
1723
/** 追加时间 **/
1824
private Date postTime;
1925

@@ -36,6 +42,18 @@ public Date getPostTime() {
3642
public void setPostTime(Date postTime) {
3743
this.postTime = postTime;
3844
}
45+
public Boolean getIsMarkdown() {
46+
return isMarkdown;
47+
}
48+
public void setIsMarkdown(Boolean isMarkdown) {
49+
this.isMarkdown = isMarkdown;
50+
}
51+
public String getMarkdownContent() {
52+
return markdownContent;
53+
}
54+
public void setMarkdownContent(String markdownContent) {
55+
this.markdownContent = markdownContent;
56+
}
3957

4058

4159
}

src/main/java/cms/bean/question/Question.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ public class Question implements Serializable{
4141
/** 问题内容 **/
4242
@Lob
4343
private String content;
44+
/** 是否使用Markdown **/
45+
private Boolean isMarkdown;
46+
/** Markdown内容 **/
47+
@Lob
48+
private String markdownContent;
4449
/** 内容摘要 **/
4550
@Lob
4651
private String summary;
@@ -322,6 +327,26 @@ public Integer getUserInfoStatus() {
322327
public void setUserInfoStatus(Integer userInfoStatus) {
323328
this.userInfoStatus = userInfoStatus;
324329
}
330+
331+
332+
public Boolean getIsMarkdown() {
333+
return isMarkdown;
334+
}
335+
336+
337+
public void setIsMarkdown(Boolean isMarkdown) {
338+
this.isMarkdown = isMarkdown;
339+
}
340+
341+
342+
public String getMarkdownContent() {
343+
return markdownContent;
344+
}
345+
346+
347+
public void setMarkdownContent(String markdownContent) {
348+
this.markdownContent = markdownContent;
349+
}
325350

326351

327352
}

src/main/java/cms/bean/setting/SystemSetting.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ public class SystemSetting implements Serializable{
3737
/** 支持访问设备 1.自动识别终端 2.电脑端 3.移动端 **/
3838
private Integer supportAccessDevice = 1;
3939

40+
/** 支持编辑器 10.仅富文本编辑器 20.仅Markdown编辑器 30.富文本编辑器优先 40.Markdown编辑器优先 **/
41+
private Integer supportEditor = 10;
42+
4043
/** 是否允许注册
4144
private boolean allowRegister = true; **/
4245
/** 允许注册账号类型 json AllowRegisterAccount格式数据**/
@@ -174,6 +177,11 @@ public class SystemSetting implements Serializable{
174177
/** 后台分页数量 **/
175178
private Integer backstagePageNumber = 20;
176179

180+
/** 话题热度因子加权 例如:评论=200|点赞=100|浏览量=1|重力因子=1.8 以竖线符号分割各热度因子,因子的分数越高,在热度因子中占比重越大;如果不设参数,则因子的加权值默认为1;因子加权值“评论|点赞|浏览量”可以为0至9999之间的整数,“重力因子”可以为0.1至2之间的数 **/
181+
private String topicHeatFactor;
182+
183+
/** 热门话题仅推荐发布N小时内的话题 空值为不限制 **/
184+
private Integer topicHotRecommendedTime;
177185

178186
/** 每用户每24小时内发送短信次数 **/
179187
private Integer userSentSmsCount = 10;
@@ -743,6 +751,30 @@ public void setReportMaxImageUpload(Integer reportMaxImageUpload) {
743751
this.reportMaxImageUpload = reportMaxImageUpload;
744752
}
745753

754+
public Integer getSupportEditor() {
755+
return supportEditor;
756+
}
757+
758+
public void setSupportEditor(Integer supportEditor) {
759+
this.supportEditor = supportEditor;
760+
}
761+
762+
public String getTopicHeatFactor() {
763+
return topicHeatFactor;
764+
}
765+
766+
public void setTopicHeatFactor(String topicHeatFactor) {
767+
this.topicHeatFactor = topicHeatFactor;
768+
}
769+
770+
public Integer getTopicHotRecommendedTime() {
771+
return topicHotRecommendedTime;
772+
}
773+
774+
public void setTopicHotRecommendedTime(Integer topicHotRecommendedTime) {
775+
this.topicHotRecommendedTime = topicHotRecommendedTime;
776+
}
777+
746778

747779

748780

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package cms.bean.template;
2+
3+
import java.io.Serializable;
4+
5+
/**
6+
* 热门话题
7+
*
8+
*/
9+
public class Forum_TopicRelated_HotTopic implements Serializable{
10+
private static final long serialVersionUID = 5980498481240294504L;
11+
12+
/** 版块---话题相关--热门话题 Id **/
13+
private String hotTopic_id;
14+
15+
/** 显示记录数 **/
16+
private Integer hotTopic_maxResult;
17+
18+
public String getHotTopic_id() {
19+
return hotTopic_id;
20+
}
21+
22+
public void setHotTopic_id(String hotTopic_id) {
23+
this.hotTopic_id = hotTopic_id;
24+
}
25+
26+
public Integer getHotTopic_maxResult() {
27+
return hotTopic_maxResult;
28+
}
29+
30+
public void setHotTopic_maxResult(Integer hotTopic_maxResult) {
31+
this.hotTopic_maxResult = hotTopic_maxResult;
32+
}
33+
34+
35+
}

src/main/java/cms/bean/topic/Comment.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ public class Comment implements Serializable{
7878
/** 评论内容 **/
7979
@Lob
8080
private String content;
81+
/** 是否使用Markdown **/
82+
private Boolean isMarkdown;
83+
/** Markdown内容 **/
84+
@Lob
85+
private String markdownContent;
8186
/** 评论时间 **/
8287
@Temporal(TemporalType.TIMESTAMP)
8388
private Date postTime = new Date();
@@ -333,5 +338,25 @@ public Integer getUserInfoStatus() {
333338
public void setUserInfoStatus(Integer userInfoStatus) {
334339
this.userInfoStatus = userInfoStatus;
335340
}
341+
342+
343+
public Boolean getIsMarkdown() {
344+
return isMarkdown;
345+
}
346+
347+
348+
public void setIsMarkdown(Boolean isMarkdown) {
349+
this.isMarkdown = isMarkdown;
350+
}
351+
352+
353+
public String getMarkdownContent() {
354+
return markdownContent;
355+
}
356+
357+
358+
public void setMarkdownContent(String markdownContent) {
359+
this.markdownContent = markdownContent;
360+
}
336361

337362
}

src/main/java/cms/bean/topic/Topic.java

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
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")})
2929
public 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
}

src/main/java/cms/service/topic/TopicService.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,17 @@ public interface TopicService extends DAO<Topic>{
6868
* @return
6969
*/
7070
public List<Topic> findTopicByPage(String userName,Date postTime,int firstIndex, int maxResult);
71+
/**
72+
* 查询热门话题
73+
* @param maxResult 需要获取的记录数
74+
* @return
75+
*/
76+
public List<Topic> findHotTopic(int maxResult);
77+
/**
78+
* 查询热门话题 - 缓存
79+
* @return
80+
*/
81+
public List<Topic> findHotTopic_cache(int maxResult);
7182
/**
7283
* 保存话题
7384
* @param topic
@@ -129,6 +140,12 @@ public interface TopicService extends DAO<Topic>{
129140
* @return
130141
*/
131142
public int addViewCount(Map<Long,Long> countMap);
143+
/**
144+
* 增加权重
145+
* @param countMap key: 话题Id value:权重
146+
* @return
147+
*/
148+
public int addWeightCount(Map<Long,Double> countMap);
132149
/**
133150
* 修改话题状态
134151
* @param topicId 话题Id

0 commit comments

Comments
 (0)