|
|
@@ -9,6 +9,7 @@ import com.uas.search.jms.LuceneMessageService;
|
|
|
import com.uas.search.service.IndexService;
|
|
|
import com.uas.search.support.DownloadHelper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import com.uas.search.util.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
@@ -42,6 +43,9 @@ public class IndexController {
|
|
|
@Autowired
|
|
|
private JmsListener jmsListener;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private JdbcTemplate jdbcTemplate;
|
|
|
+
|
|
|
@RequestMapping("/create")
|
|
|
@ResponseBody
|
|
|
public String initIndexes(String tableNames, HttpServletRequest request) {
|
|
|
@@ -49,6 +53,13 @@ public class IndexController {
|
|
|
indexService.createIndexes(toList(tableNames), true) / 1000.0);
|
|
|
}
|
|
|
|
|
|
+ @RequestMapping("/test")
|
|
|
+ @ResponseBody
|
|
|
+ public String testController(){
|
|
|
+ Integer count = jdbcTemplate.queryForObject("select count(1) from lucene$message", Integer.class);
|
|
|
+ return String.format("Indexes test success , %s", count);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 根据逗号进行分隔,将字符串转为 List
|
|
|
*
|