Skip to content

Commit

Permalink
feat: UniPush
Browse files Browse the repository at this point in the history
  • Loading branch information
getrebuild committed Dec 2, 2023
1 parent 8c045a0 commit 8d2a77b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion @rbv
Submodule @rbv updated from 0d8d87 to e9abcf
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,11 @@
<artifactId>mammoth</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>com.getui.push</groupId>
<artifactId>restful-sdk</artifactId>
<version>1.0.0.15</version>
</dependency>

<!-- fix: CVEs -->
<dependency>
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/com/rebuild/core/service/notification/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import cn.devezhao.persist4j.engine.ID;
import com.rebuild.core.privileges.UserService;
import com.rebuild.core.support.i18n.Language;
import lombok.AccessLevel;
import lombok.Data;
import lombok.Setter;
Expand Down Expand Up @@ -57,4 +58,17 @@ public Message(ID fromUser, ID toUser, String message, int type, ID relatedRecor
this.type = type;
this.relatedRecord = relatedRecord;
}

/**
* 获取通知标题
* @return
*/
public String getTitle4Type() {
if (this.type == TYPE_ASSIGN) return Language.L("记录分配通知");
else if (this.type == TYPE_SAHRE) return Language.L("记录共享通知");
else if (this.type == TYPE_APPROVAL) return Language.L("记录审核通知");
else if (this.type == TYPE_FEEDS) return Language.L("动态通知");
else if (this.type == TYPE_PROJECT) return Language.L("项目任务通知");
else return Language.L("新通知");
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/rebuild/utils/MarkdownUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static String render(String md, boolean targetBlank) {
* @param md
* @return
*/
public static String cleanMd(String md) {
public static String cleanMarks(String md) {
String html = render(md);
return Jsoup.parse(html).body().text();
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/rebuild/utils/MarkdownUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void render() {

@Test
void cleanMd() {
System.out.println(MarkdownUtils.cleanMd("你有 2 条日程提醒(注意要两个换行符)\n" +
System.out.println(MarkdownUtils.cleanMarks("你有 2 条日程提醒(注意要两个换行符)\n" +
"\n- 123" +
"\n- [456](/rebuild/789)"));
}
Expand Down

0 comments on commit 8d2a77b

Please sign in to comment.