aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/configuration/DataConfiguration.java
diff options
context:
space:
mode:
authorGravatar Alexander Alexeev2016-11-18 15:36:16 +0700
committerGravatar Vitaly Takmazov2016-11-23 13:02:59 +0300
commit606e2a8d6fc8af288632e2857d3a89770fdbb69c (patch)
treef160cbe3f09459f2dd0dff441c5fbb8336c8a3d4 /juick-server/src/main/java/com/juick/configuration/DataConfiguration.java
parentd64b673c0d69309ff7ad75ffd1d3d7c3f664c8a1 (diff)
SearchService stub for most cases
Diffstat (limited to 'juick-server/src/main/java/com/juick/configuration/DataConfiguration.java')
-rw-r--r--juick-server/src/main/java/com/juick/configuration/DataConfiguration.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/configuration/DataConfiguration.java b/juick-server/src/main/java/com/juick/configuration/DataConfiguration.java
index 89fda764..150ced69 100644
--- a/juick-server/src/main/java/com/juick/configuration/DataConfiguration.java
+++ b/juick-server/src/main/java/com/juick/configuration/DataConfiguration.java
@@ -1,5 +1,6 @@
package com.juick.configuration;
+import com.juick.service.search.SearchService;
import org.apache.commons.dbcp2.BasicDataSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
@@ -13,6 +14,8 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.transaction.annotation.TransactionManagementConfigurer;
import javax.annotation.Resource;
+import java.util.Collections;
+import java.util.List;
/**
* Created by aalexeev on 11/11/16.
@@ -55,4 +58,23 @@ public class DataConfiguration implements TransactionManagementConfigurer {
public JdbcTemplate jdbcTemplate() {
return new JdbcTemplate(dataSource());
}
+
+ @Bean
+ public SearchService emptySearchService() {
+ return new SearchService() {
+ @Override
+ public void setMaxResult(int maxResult) {
+ }
+
+ @Override
+ public List<Integer> searchInAllMessages(String searchString, int messageIdBefore) {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public List<Integer> searchByStringAndUser(String searchString, int userId, int messageIdBefore) {
+ return Collections.emptyList();
+ }
+ };
+ }
}