diff --git a/.gitignore b/.gitignore index c3b0517..f90953e 100644 --- a/.gitignore +++ b/.gitignore @@ -21,29 +21,6 @@ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - # project file *.iml *.ipr @@ -53,4 +30,4 @@ hs_err_pid* *.project *.settings/* /target/ -*/target/* \ No newline at end of file +*/target/* diff --git a/pom.xml b/pom.xml index 43116ed..911d445 100644 --- a/pom.xml +++ b/pom.xml @@ -12,6 +12,12 @@ com.soraka soraka 1.0-SNAPSHOT + pom + + + soraka-discovery + soraka-gateway + @@ -27,18 +33,6 @@ UTF-8 UTF-8 - 1.2.7 - 4.2.2.RELEASE - 1.2.4 - 3.2.6 - 2.5.3 - 4.12 - 1.2.17 - 1.7.7 - 1.4.4 - 1.0.26 - 5.1.22 - 2.9.0 diff --git a/soraka-eureka/pom.xml b/soraka-discovery/pom.xml similarity index 87% rename from soraka-eureka/pom.xml rename to soraka-discovery/pom.xml index 5d190e7..c3348da 100644 --- a/soraka-eureka/pom.xml +++ b/soraka-discovery/pom.xml @@ -4,17 +4,17 @@ 4.0.0 com.soraka - soraka-eureka + soraka-discovery 0.0.1-SNAPSHOT jar - soraka-eureka + soraka-discovery soraka注册中心 org.springframework.boot spring-boot-starter-parent - 2.0.4.RELEASE + 1.5.15.RELEASE @@ -22,13 +22,13 @@ UTF-8 UTF-8 1.8 - Finchley.SR1 + Edgware.SR4 org.springframework.cloud - spring-cloud-starter-netflix-eureka-server + spring-cloud-starter-eureka-server diff --git a/soraka-eureka/src/main/java/com/soraka/eureka/SorakaEurekaApplication.java b/soraka-discovery/src/main/java/com/soraka/discovery/SorakaDiscoveryApplication.java similarity index 67% rename from soraka-eureka/src/main/java/com/soraka/eureka/SorakaEurekaApplication.java rename to soraka-discovery/src/main/java/com/soraka/discovery/SorakaDiscoveryApplication.java index 9e7bd90..cda3819 100644 --- a/soraka-eureka/src/main/java/com/soraka/eureka/SorakaEurekaApplication.java +++ b/soraka-discovery/src/main/java/com/soraka/discovery/SorakaDiscoveryApplication.java @@ -1,4 +1,4 @@ -package com.soraka.eureka; +package com.soraka.discovery; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -9,12 +9,12 @@ * * @author yongjie.teng * @date 2018/8/9 - * @package com.soraka.eureka + * @package com.soraka.discovery */ @EnableEurekaServer @SpringBootApplication -public class SorakaEurekaApplication { +public class SorakaDiscoveryApplication { public static void main(String[] args) { - SpringApplication.run(SorakaEurekaApplication.class, args); + SpringApplication.run(SorakaDiscoveryApplication.class, args); } } diff --git a/soraka-eureka/src/main/resources/application.yml b/soraka-discovery/src/main/resources/application.yml similarity index 72% rename from soraka-eureka/src/main/resources/application.yml rename to soraka-discovery/src/main/resources/application.yml index a712a13..749e4ae 100644 --- a/soraka-eureka/src/main/resources/application.yml +++ b/soraka-discovery/src/main/resources/application.yml @@ -1,10 +1,8 @@ spring: application: - name: soraka-eureka - + name: soraka-discovery server: port: 8001 - eureka: instance: hostname: localhost @@ -13,4 +11,6 @@ eureka: client: registerWithEureka: false fetchRegistry: false + service-url: + defaultZone: http://localhost:8001/eureka/ diff --git a/soraka-eureka/src/test/java/com/soraka/eureka/SorakaEurekaApplicationTest.java b/soraka-discovery/src/test/java/com/soraka/discovery/SorakaDiscoveryApplicationTest.java similarity index 75% rename from soraka-eureka/src/test/java/com/soraka/eureka/SorakaEurekaApplicationTest.java rename to soraka-discovery/src/test/java/com/soraka/discovery/SorakaDiscoveryApplicationTest.java index 4a7e286..77843af 100644 --- a/soraka-eureka/src/test/java/com/soraka/eureka/SorakaEurekaApplicationTest.java +++ b/soraka-discovery/src/test/java/com/soraka/discovery/SorakaDiscoveryApplicationTest.java @@ -1,4 +1,4 @@ -package com.soraka.eureka; +package com.soraka.discovery; import org.junit.Test; import org.junit.runner.RunWith; @@ -8,11 +8,11 @@ /** * @author yongjie.teng * @date 2018/8/9 - * @package com.soraka.eureka + * @package com.soraka.discovery */ @RunWith(SpringRunner.class) @SpringBootTest -public class SorakaEurekaApplicationTest { +public class SorakaDiscoveryApplicationTest { @Test public void contextLoads() { diff --git a/soraka-gateway/pom.xml b/soraka-gateway/pom.xml new file mode 100644 index 0000000..890c569 --- /dev/null +++ b/soraka-gateway/pom.xml @@ -0,0 +1,67 @@ + + + 4.0.0 + + com.soraka + soraka-gateway + 0.0.1-SNAPSHOT + jar + + soraka-gateway + soraka网关 + + + org.springframework.boot + spring-boot-starter-parent + 1.5.15.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + Edgware.SR4 + + + + + org.springframework.cloud + spring-cloud-starter-zuul + + + org.springframework.cloud + spring-cloud-starter-eureka + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git a/soraka-gateway/src/main/java/com/soraka/gateway/SorakaGatewayApplication.java b/soraka-gateway/src/main/java/com/soraka/gateway/SorakaGatewayApplication.java new file mode 100644 index 0000000..b40be7e --- /dev/null +++ b/soraka-gateway/src/main/java/com/soraka/gateway/SorakaGatewayApplication.java @@ -0,0 +1,23 @@ +package com.soraka.gateway; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.netflix.eureka.EnableEurekaClient; +import org.springframework.cloud.netflix.zuul.EnableZuulProxy; + +/** + * Soraka网关 + * + * @author yongjie.teng + * @date 2018/8/10 + * @package com.soraka.gateway + */ +@EnableZuulProxy +@EnableEurekaClient +@SpringBootApplication +public class SorakaGatewayApplication { + + public static void main(String[] args) { + SpringApplication.run(SorakaGatewayApplication.class, args); + } +} diff --git a/soraka-gateway/src/main/resources/application.yml b/soraka-gateway/src/main/resources/application.yml new file mode 100644 index 0000000..2215c77 --- /dev/null +++ b/soraka-gateway/src/main/resources/application.yml @@ -0,0 +1,21 @@ +spring: + application: + name: soraka-gateway +server: + port: 8002 +eureka: + instance: + hostname: localhost + prefer-ip-address: true + client: + register-with-eureka: true + fetch-registry: true + service-url: + defaultZone: http://localhost:8001/eureka/ +zuul: + ignored-services: '**' + routes: + soraka-weixin: 'mp/**' +management: + security: + enabled: false diff --git a/soraka-gateway/src/test/java/com/soraka/gateway/SorakaGatewayApplicationTests.java b/soraka-gateway/src/test/java/com/soraka/gateway/SorakaGatewayApplicationTests.java new file mode 100644 index 0000000..a897d8f --- /dev/null +++ b/soraka-gateway/src/test/java/com/soraka/gateway/SorakaGatewayApplicationTests.java @@ -0,0 +1,16 @@ +package com.soraka.gateway; + +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 +public class SorakaGatewayApplicationTests { + + @Test + public void contextLoads() { + } + +}