添加eureka注册中心支持

This commit is contained in:
macro
2019-10-17 16:36:05 +08:00
parent feff3937ac
commit 47eaa3a5af
39 changed files with 192 additions and 1150 deletions

View File

@@ -0,0 +1,15 @@
package com.macro.mall;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@EnableEurekaServer
@SpringBootApplication
public class MallRegistryApplication {
public static void main(String[] args) {
SpringApplication.run(MallRegistryApplication.class, args);
}
}

View File

@@ -0,0 +1,13 @@
server:
port: 8001
spring:
application:
name: mall-registry
eureka:
instance:
hostname: localhost
client:
fetch-registry: false
register-with-eureka: false
server:
enable-self-preservation: false

View File

@@ -0,0 +1,16 @@
package com.macro.mall;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
class MallRegistryApplicationTests {
@Test
void contextLoads() {
}
}