Skip to content

Commit cc71dec

Browse files
author
fanxb
committed
重命名文件夹并新增服务网关代码
1 parent 33004fa commit cc71dec

File tree

93 files changed

+1131
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+1131
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>com.fxb</groupId>
7+
<artifactId>demo</artifactId>
8+
<version>0.0.1-SNAPSHOT</version>
9+
<packaging>jar</packaging>
10+
11+
<name>confsvr</name>
12+
<description>Demo project for Spring Boot</description>
13+
14+
<parent>
15+
<groupId>org.springframework.boot</groupId>
16+
<artifactId>spring-boot-starter-parent</artifactId>
17+
<version>1.4.4.RELEASE</version>
18+
</parent>
19+
<dependencyManagement>
20+
<dependencies>
21+
<dependency>
22+
<groupId>org.springframework.cloud</groupId>
23+
<artifactId>spring-cloud-dependencies</artifactId>
24+
<version>Camden.SR5</version>
25+
<type>pom</type>
26+
<scope>import</scope>
27+
</dependency>
28+
</dependencies>
29+
</dependencyManagement>
30+
31+
<properties>
32+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
33+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
34+
<java.version>1.8</java.version>
35+
<spring-cloud.version>Camden.SR5</spring-cloud.version>
36+
</properties>
37+
38+
<dependencies>
39+
<dependency>
40+
<groupId>org.springframework.cloud</groupId>
41+
<artifactId>spring-cloud-config-server</artifactId>
42+
</dependency>
43+
<dependency>
44+
<groupId>org.springframework.cloud</groupId>
45+
<artifactId>spring-cloud-starter-eureka</artifactId>
46+
</dependency>
47+
48+
<dependency>
49+
<groupId>org.springframework.boot</groupId>
50+
<artifactId>spring-boot-starter-test</artifactId>
51+
<scope>test</scope>
52+
</dependency>
53+
</dependencies>
54+
55+
<build>
56+
<plugins>
57+
<plugin>
58+
<groupId>org.springframework.boot</groupId>
59+
<artifactId>spring-boot-maven-plugin</artifactId>
60+
</plugin>
61+
</plugins>
62+
</build>
63+
64+
65+
</project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.fxb.demo;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
6+
import org.springframework.cloud.config.server.EnableConfigServer;
7+
8+
@SpringBootApplication
9+
@EnableConfigServer
10+
@EnableDiscoveryClient
11+
public class ConfsvrApplication {
12+
13+
public static void main(String[] args) {
14+
SpringApplication.run(ConfsvrApplication.class, args);
15+
}
16+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
server:
2+
port: 8888
3+
4+
eureka:
5+
instance:
6+
#注册服务的IP,而不是服务器名
7+
prefer-ip-address: true
8+
client:
9+
#向eureka注册服务
10+
register-with-eureka: true
11+
#拉取注册表的本地副本
12+
fetch-registry: true
13+
service-url:
14+
#Eureka服务的位置(如果有多个注册中心,使用,分隔)
15+
defaultZone: http://localhost:8761/eureka/
16+
17+
spring:
18+
profiles:
19+
# 使用文件系统来存储配置信息,需要设置为native
20+
active: native
21+
application:
22+
name: confsvr
23+
cloud:
24+
config:
25+
server:
26+
native:
27+
# 使用文件来存放配置文件,为每个应用程序提供用逗号分隔的文件夹列表
28+
searchLocations: file:///D:/configFolder/licensingservice,file:///D:/configFolder/organizationservice
29+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.fxb.demo;
2+
3+
import org.junit.Test;
4+
import org.junit.runner.RunWith;
5+
import org.springframework.boot.test.context.SpringBootTest;
6+
import org.springframework.test.context.junit4.SpringRunner;
7+
8+
@RunWith(SpringRunner.class)
9+
@SpringBootTest
10+
public class ConfsvrApplicationTests {
11+
12+
@Test
13+
public void contextLoads() {
14+
}
15+
16+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>com.fxb</groupId>
7+
<artifactId>eurekasvr</artifactId>
8+
<version>0.0.1-SNAPSHOT</version>
9+
<packaging>jar</packaging>
10+
11+
<name>eurekasvr</name>
12+
<description>Demo project for Spring Boot</description>
13+
14+
<parent>
15+
<groupId>org.springframework.boot</groupId>
16+
<artifactId>spring-boot-starter-parent</artifactId>
17+
<version>1.4.4.RELEASE</version>
18+
</parent>
19+
<dependencyManagement>
20+
<dependencies>
21+
<dependency>
22+
<groupId>org.springframework.cloud</groupId>
23+
<artifactId>spring-cloud-dependencies</artifactId>
24+
<version>Camden.SR5</version>
25+
<type>pom</type>
26+
<scope>import</scope>
27+
</dependency>
28+
</dependencies>
29+
</dependencyManagement>
30+
31+
<properties>
32+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
33+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
34+
<java.version>1.8</java.version>
35+
<spring-cloud.version>Camden.SR5</spring-cloud.version>
36+
</properties>
37+
38+
<dependencies>
39+
<dependency>
40+
<groupId>org.springframework.cloud</groupId>
41+
<artifactId>spring-cloud-starter-eureka-server</artifactId>
42+
</dependency>
43+
44+
<dependency>
45+
<groupId>org.springframework.boot</groupId>
46+
<artifactId>spring-boot-starter-test</artifactId>
47+
<scope>test</scope>
48+
</dependency>
49+
</dependencies>
50+
51+
<build>
52+
<plugins>
53+
<plugin>
54+
<groupId>org.springframework.boot</groupId>
55+
<artifactId>spring-boot-maven-plugin</artifactId>
56+
</plugin>
57+
</plugins>
58+
</build>
59+
60+
<repositories>
61+
<repository>
62+
<id>spring-milestones</id>
63+
<name>Spring Milestones</name>
64+
<url>https://repo.spring.io/milestone</url>
65+
<snapshots>
66+
<enabled>false</enabled>
67+
</snapshots>
68+
</repository>
69+
</repositories>
70+
71+
72+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.fxb.eurekasvr;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
6+
7+
@SpringBootApplication
8+
@EnableEurekaServer
9+
public class EurekasvrApplication {
10+
11+
public static void main(String[] args) {
12+
SpringApplication.run(EurekasvrApplication.class, args);
13+
}
14+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
server:
2+
port: 8761
3+
4+
eureka:
5+
client:
6+
#不注册自己
7+
register-with-eureka: false
8+
#不在本地缓存注册表信息
9+
fetch-registry: false
10+
server:
11+
#接受请求前的等待实际,开发模式下不要开启
12+
#wait-time-in-ms-when-sync-empty: 5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.fxb.eurekasvr;
2+
3+
import org.junit.Test;
4+
import org.junit.runner.RunWith;
5+
import org.springframework.boot.test.context.SpringBootTest;
6+
import org.springframework.test.context.junit4.SpringRunner;
7+
8+
@RunWith(SpringRunner.class)
9+
@SpringBootTest
10+
public class EurekasvrApplicationTests {
11+
12+
@Test
13+
public void contextLoads() {
14+
}
15+
16+
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>com.fxb</groupId>
7+
<artifactId>licensingservice</artifactId>
8+
<version>0.0.1-SNAPSHOT</version>
9+
<packaging>jar</packaging>
10+
11+
<name>licensingservice</name>
12+
<description>Demo project for Spring Boot</description>
13+
14+
<parent>
15+
<groupId>org.springframework.boot</groupId>
16+
<artifactId>spring-boot-starter-parent</artifactId>
17+
<version>1.4.4.RELEASE</version>
18+
</parent>
19+
<dependencyManagement>
20+
<dependencies>
21+
<dependency>
22+
<groupId>org.springframework.cloud</groupId>
23+
<artifactId>spring-cloud-dependencies</artifactId>
24+
<version>Camden.SR5</version>
25+
<type>pom</type>
26+
<scope>import</scope>
27+
</dependency>
28+
</dependencies>
29+
</dependencyManagement>
30+
31+
<properties>
32+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
33+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
34+
<java.version>1.8</java.version>
35+
<spring-cloud.version>Camden.SR5</spring-cloud.version>
36+
</properties>
37+
38+
<dependencies>
39+
<dependency>
40+
<groupId>org.springframework.cloud</groupId>
41+
<artifactId>spring-cloud-starter-eureka</artifactId>
42+
</dependency>
43+
<dependency>
44+
<groupId>org.springframework.cloud</groupId>
45+
<artifactId>spring-cloud-config-client</artifactId>
46+
</dependency>
47+
<dependency>
48+
<groupId>org.springframework.cloud</groupId>
49+
<artifactId>spring-cloud-starter-feign</artifactId>
50+
</dependency>
51+
<dependency>
52+
<groupId>org.springframework.cloud</groupId>
53+
<artifactId>spring-cloud-starter-hystrix</artifactId>
54+
</dependency>
55+
<!--本依赖不是必须的,spring-cloud-starter-hystrix已经带了,但是在Camden.SR5发行版本中使用了1.5.6,这个版本有一个不一致的地方,在
56+
没有后备的情况下会抛出java.lang.reflect.UndeclaredThrowableException而不是com.netflix.hystrix.exception.HystrixRuntimeException,
57+
在后续版本中修复了这个问题-->
58+
<dependency>
59+
<groupId>com.netflix.hystrix</groupId>
60+
<artifactId>hystrix-javanica</artifactId>
61+
<version>1.5.9</version>
62+
</dependency>
63+
64+
<dependency>
65+
<groupId>org.springframework.boot</groupId>
66+
<artifactId>spring-boot-starter-test</artifactId>
67+
<scope>test</scope>
68+
</dependency>
69+
</dependencies>
70+
71+
<build>
72+
<plugins>
73+
<plugin>
74+
<groupId>org.springframework.boot</groupId>
75+
<artifactId>spring-boot-maven-plugin</artifactId>
76+
</plugin>
77+
</plugins>
78+
</build>
79+
80+
81+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.fxb.licensingservice.Entity;
2+
3+
import java.io.Serializable;
4+
5+
/**
6+
* 类功能简述:
7+
* 类功能详述:
8+
*
9+
* @author fanxb
10+
* @date 2018/11/22 19:52
11+
*/
12+
public class Licensing implements Serializable {
13+
private Organization organization;
14+
private boolean isValid;
15+
16+
public Organization getOrganization() {
17+
return organization;
18+
}
19+
20+
public void setOrganization(Organization organization) {
21+
this.organization = organization;
22+
}
23+
24+
public boolean isValid() {
25+
return isValid;
26+
}
27+
28+
public void setValid(boolean valid) {
29+
isValid = valid;
30+
}
31+
}

0 commit comments

Comments
 (0)