aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/api
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/api')
-rw-r--r--juick-server/src/main/java/com/juick/server/api/Messages.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/server/api/Messages.java b/juick-server/src/main/java/com/juick/server/api/Messages.java
index 35b7e6b2..36d3e1dd 100644
--- a/juick-server/src/main/java/com/juick/server/api/Messages.java
+++ b/juick-server/src/main/java/com/juick/server/api/Messages.java
@@ -20,6 +20,7 @@ package com.juick.server.api;
import com.juick.Message;
import com.juick.Tag;
import com.juick.User;
+import com.juick.server.Utils;
import com.juick.server.component.MessageReadEvent;
import com.juick.server.util.HttpBadRequestException;
import com.juick.server.util.UserUtils;
@@ -90,6 +91,7 @@ public class Messages {
@RequestParam(required = false, defaultValue = "0") Integer daysback,
@RequestParam(required = false) String withrecommended,
@RequestParam(required = false) String popular,
+ @RequestParam(required = false) String search,
@RequestParam(required = false) String media,
@RequestParam(required = false) String tag) {
@@ -112,6 +114,8 @@ public class Messages {
mids = messagesService.getUserBlogWithRecommendations(user.getUid(), 0, before);
} else if (daysback > 0) {
mids = messagesService.getUserBlogAtDay(user.getUid(), 0, daysback);
+ } else if (!StringUtils.isEmpty(search)) {
+ mids = messagesService.getUserSearch(user.getUid(), Utils.encodeSphinx(search), 0, before);
} else {
mids = messagesService.getUserBlog(user.getUid(), 0, before);
}
@@ -130,6 +134,8 @@ public class Messages {
} else {
return NOT_FOUND;
}
+ } else if (!StringUtils.isEmpty(search)) {
+ mids = messagesService.getSearch(Utils.encodeSphinx(search), before);
} else {
mids = messagesService.getAll(visitor.getUid(), before);
}