...
|
...
|
@@ -63,8 +63,6 @@ public class IndexController implements ApplicationEventPublisherAware { |
|
|
@Autowired
|
|
|
private ProductIndexIndexBuilder productIndexIndexBuilder;
|
|
|
@Autowired
|
|
|
private AmqpTemplate amqpTemplate;
|
|
|
@Autowired
|
|
|
private RebuildFlagService rebuildFlagService;
|
|
|
@Autowired
|
|
|
private IndexRebuildJob indexRebuildJob;
|
...
|
...
|
@@ -217,23 +215,6 @@ public class IndexController implements ApplicationEventPublisherAware { |
|
|
return getResultMap(200, "rebuildAll success");
|
|
|
}
|
|
|
|
|
|
@RequestMapping(method = RequestMethod.POST, value = "/index/update/{indexName}")
|
|
|
@ResponseBody
|
|
|
public Map<String, Object> update(@PathVariable String indexName, @RequestBody String json, HttpServletRequest request) {
|
|
|
// 通过indexName得到消息地址,然后发消息
|
|
|
// 使用这个接口需要了解消息的格式
|
|
|
String channel = ISearchConstants.REDIS_CHANNEL_PRIFIX + indexName;
|
|
|
try {
|
|
|
amqpTemplate.convertAndSend(channel, createMessage(json));
|
|
|
} catch (AmqpException e) {
|
|
|
publisher.publishEvent(new SearchEvent(EventReportEnum.INDEXCONTROLLER_INDEX_UPDATE.getEventName(), EventReportEnum.INDEXCONTROLLER_INDEX_UPDATE.getFunctionName(),
|
|
|
EventReportEnum.INDEXCONTROLLER_INDEX_UPDATE.getMoudleName(), "exception", IgnoreSomeException.filterSomeException(e), null));
|
|
|
logger.error("[func=sendMessage][step=execption][e={}]", e.getMessage());
|
|
|
}
|
|
|
logger.info("[func=sendMessage][step=success][indexName={}][msg={}]", indexName, json);
|
|
|
return getResultMap(200, "update " + indexName + " success");
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/index/suggestion/flow")
|
|
|
@ResponseBody
|
|
|
public Map<String, Object> runSuggestionFlow() {
|
...
|
...
|
|