init
This commit is contained in:
24
ruoyi-common/ruoyi-common-elasticsearch/pom.xml
Normal file
24
ruoyi-common/ruoyi-common-elasticsearch/pom.xml
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>org.dromara</groupId>
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ruoyi-common-elasticsearch</artifactId>
|
||||
|
||||
<description>
|
||||
ruoyi-common-elasticsearch ES搜索引擎服务
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.dromara.easy-es</groupId>
|
||||
<artifactId>easy-es-boot-starter</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -0,0 +1,25 @@
|
||||
package org.dromara.common.elasticsearch.config;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.env.EnvironmentPostProcessor;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
|
||||
/**
|
||||
* 健康检查配置注入
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public class ActuatorEnvironmentPostProcessor implements EnvironmentPostProcessor, Ordered {
|
||||
|
||||
@Override
|
||||
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
|
||||
System.setProperty("management.health.elasticsearch.enabled", "false");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return Ordered.HIGHEST_PRECEDENCE;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package org.dromara.common.elasticsearch.config;
|
||||
|
||||
import org.dromara.easyes.spring.annotation.EsMapperScan;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
|
||||
/**
|
||||
* easy-es 配置
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@ConditionalOnProperty(value = "easy-es.enable", havingValue = "true")
|
||||
@EsMapperScan("org.dromara.**.esmapper")
|
||||
public class EasyEsConfiguration {
|
||||
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
org.springframework.boot.env.EnvironmentPostProcessor=\
|
||||
org.dromara.common.elasticsearch.config.ActuatorEnvironmentPostProcessor
|
@ -0,0 +1 @@
|
||||
org.dromara.common.elasticsearch.config.EasyEsConfiguration
|
Reference in New Issue
Block a user