aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/juick/service/NullSearchService.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/main/java/com/juick/service/NullSearchService.java b/src/main/java/com/juick/service/NullSearchService.java
new file mode 100644
index 00000000..efaccd53
--- /dev/null
+++ b/src/main/java/com/juick/service/NullSearchService.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2008-2022, Juick
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package com.juick.service;
+
+import com.juick.model.User;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.stereotype.Repository;
+
+import java.util.Collections;
+import java.util.List;
+
+@Repository
+@ConditionalOnProperty(name = "spring.sql.init.platform", havingValue = "h2")
+public class NullSearchService implements SearchService {
+ @Override
+ public void setMaxResult(int maxResult) {
+
+ }
+
+ @Override
+ public List<Integer> searchInAllMessages(User visitor, String searchString, int messageIdBefore) {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public List<Integer> searchByStringAndUser(User visitor, String searchString, int userId, int messageIdBefore) {
+ return Collections.emptyList();
+ }
+}