diff --git a/mall-admin/src/main/resources/application-dev.yml b/mall-admin/src/main/resources/application-dev.yml index 3ed4765..8fdd9ce 100644 --- a/mall-admin/src/main/resources/application-dev.yml +++ b/mall-admin/src/main/resources/application-dev.yml @@ -18,6 +18,7 @@ eureka: fetch-registry: true service-url: defaultZone: http://localhost:8001/eureka/ + registry-fetch-interval-seconds: 10 management: #开启SpringBoot Admin的监控 endpoints: web: diff --git a/mall-admin/src/main/resources/application.yml b/mall-admin/src/main/resources/application.yml index b8df343..b31c0c6 100644 --- a/mall-admin/src/main/resources/application.yml +++ b/mall-admin/src/main/resources/application.yml @@ -4,7 +4,7 @@ spring: application: name: mall-admin server: - port: 8080 + port: 8180 mybatis: mapper-locations: - classpath:dao/*.xml diff --git a/mall-gateway/.gitignore b/mall-gateway/.gitignore new file mode 100644 index 0000000..a2a3040 --- /dev/null +++ b/mall-gateway/.gitignore @@ -0,0 +1,31 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/** +!**/src/test/** + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ + +### VS Code ### +.vscode/ diff --git a/mall-gateway/pom.xml b/mall-gateway/pom.xml new file mode 100644 index 0000000..1e569a2 --- /dev/null +++ b/mall-gateway/pom.xml @@ -0,0 +1,37 @@ + + + 4.0.0 + com.macro.mall + mall-gateway + 0.0.1-SNAPSHOT + mall-gateway + mall-gateway project for mall + + + com.macro.mall + mall + 1.0-SNAPSHOT + + + + + org.springframework.cloud + spring-cloud-starter-netflix-eureka-client + + + org.springframework.cloud + spring-cloud-starter-netflix-zuul + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/mall-gateway/src/main/java/com/macro/mall/MallGatewayApplication.java b/mall-gateway/src/main/java/com/macro/mall/MallGatewayApplication.java new file mode 100644 index 0000000..eb0d2cd --- /dev/null +++ b/mall-gateway/src/main/java/com/macro/mall/MallGatewayApplication.java @@ -0,0 +1,17 @@ +package com.macro.mall; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.netflix.zuul.EnableZuulProxy; + +@EnableZuulProxy +@EnableDiscoveryClient +@SpringBootApplication +public class MallGatewayApplication { + + public static void main(String[] args) { + SpringApplication.run(MallGatewayApplication.class, args); + } + +} diff --git a/mall-gateway/src/main/resources/application.yml b/mall-gateway/src/main/resources/application.yml new file mode 100644 index 0000000..96070f3 --- /dev/null +++ b/mall-gateway/src/main/resources/application.yml @@ -0,0 +1,23 @@ +server: + port: 8201 +spring: + application: + name: mall-gateway +eureka: + client: + register-with-eureka: true + fetch-registry: true + service-url: + defaultZone: http://localhost:8001/eureka/ + registry-fetch-interval-seconds: 10 +zuul: + sensitive-headers: #默认会过滤Cookie,Set-Cookie,Authorization,配置为空不过滤 + add-host-header: true #设置为true重定向是会添加host请求头 +management: #开启SpringBoot Admin的监控 + endpoints: + web: + exposure: + include: '*' + endpoint: + health: + show-details: always diff --git a/mall-gateway/src/test/java/com/macro/mall/MallGatewayApplicationTests.java b/mall-gateway/src/test/java/com/macro/mall/MallGatewayApplicationTests.java new file mode 100644 index 0000000..d10b59c --- /dev/null +++ b/mall-gateway/src/test/java/com/macro/mall/MallGatewayApplicationTests.java @@ -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 +public class MallGatewayApplicationTests { + + @Test + public void contextLoads() { + } + +}