Skip to content

Commit b949e55

Browse files
committed
create project
0 parents  commit b949e55

File tree

261 files changed

+5646
-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.

261 files changed

+5646
-0
lines changed

.idea/SpringCloud_Sell.iml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api-gateway/.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/target/
2+
!.mvn/wrapper/maven-wrapper.jar
3+
4+
### STS ###
5+
.apt_generated
6+
.classpath
7+
.factorypath
8+
.project
9+
.settings
10+
.springBeans
11+
.sts4-cache
12+
13+
### IntelliJ IDEA ###
14+
.idea
15+
*.iws
16+
*.iml
17+
*.ipr
18+
19+
### NetBeans ###
20+
/nbproject/private/
21+
/build/
22+
/nbbuild/
23+
/dist/
24+
/nbdist/
25+
/.nb-gradle/

api-gateway/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM hub.c.163.com/library/java:8-alpine
2+
3+
MAINTAINER 文琪 hi.fanwenqi@gmail.com
4+
5+
ADD target/*.jar app.jar
6+
7+
EXPOSE 8080
8+
9+
ENTRYPOINT ["java","-jar","/app.jar"]

api-gateway/build.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
mvn clean package -Dmaven.test.skip=true -U
4+
5+
docker build -t hub.c.163.com/fanwenqi/api-gateway .
6+
7+
docker push hub.c.163.com/fanwenqi/api-gateway

api-gateway/pom.xml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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.wenqi</groupId>
7+
<artifactId>api-gateway</artifactId>
8+
<version>0.0.1-SNAPSHOT</version>
9+
<packaging>jar</packaging>
10+
11+
<name>api-gateway</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>2.0.0.M3</version>
18+
<relativePath/> <!-- lookup parent from repository -->
19+
</parent>
20+
21+
<properties>
22+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
24+
<java.version>1.8</java.version>
25+
<spring-cloud.version>Finchley.M2</spring-cloud.version>
26+
</properties>
27+
28+
<dependencies>
29+
<dependency>
30+
<groupId>org.springframework.cloud</groupId>
31+
<artifactId>spring-cloud-starter-config</artifactId>
32+
</dependency>
33+
<dependency>
34+
<groupId>org.springframework.cloud</groupId>
35+
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
36+
</dependency>
37+
<dependency>
38+
<groupId>org.springframework.cloud</groupId>
39+
<artifactId>spring-cloud-starter-netflix-zuul</artifactId>
40+
</dependency>
41+
42+
<dependency>
43+
<groupId>org.springframework.boot</groupId>
44+
<artifactId>spring-boot-starter-data-redis</artifactId>
45+
</dependency>
46+
47+
<dependency>
48+
<groupId>org.springframework.boot</groupId>
49+
<artifactId>spring-boot-starter-test</artifactId>
50+
<scope>test</scope>
51+
</dependency>
52+
</dependencies>
53+
54+
<dependencyManagement>
55+
<dependencies>
56+
<dependency>
57+
<groupId>org.springframework.cloud</groupId>
58+
<artifactId>spring-cloud-dependencies</artifactId>
59+
<version>${spring-cloud.version}</version>
60+
<type>pom</type>
61+
<scope>import</scope>
62+
</dependency>
63+
</dependencies>
64+
</dependencyManagement>
65+
66+
<build>
67+
<plugins>
68+
<plugin>
69+
<groupId>org.springframework.boot</groupId>
70+
<artifactId>spring-boot-maven-plugin</artifactId>
71+
</plugin>
72+
</plugins>
73+
</build>
74+
75+
<repositories>
76+
<repository>
77+
<id>spring-milestones</id>
78+
<name>Spring Milestones</name>
79+
<url>https://repo.spring.io/milestone</url>
80+
<snapshots>
81+
<enabled>false</enabled>
82+
</snapshots>
83+
</repository>
84+
</repositories>
85+
86+
87+
</project>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.wenqi.apigateway;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
import org.springframework.boot.context.properties.ConfigurationProperties;
6+
import org.springframework.cloud.context.config.annotation.RefreshScope;
7+
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
8+
import org.springframework.cloud.netflix.zuul.filters.ZuulProperties;
9+
10+
@SpringBootApplication
11+
@EnableZuulProxy
12+
public class ApiGatewayApplication {
13+
14+
public static void main(String[] args) {
15+
SpringApplication.run(ApiGatewayApplication.class, args);
16+
}
17+
18+
@ConfigurationProperties("zuul")
19+
@RefreshScope
20+
public ZuulProperties zuulProperties(){
21+
return new ZuulProperties();
22+
}
23+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//package com.wenqi.apigateway;
2+
//
3+
//import org.springframework.boot.context.properties.ConfigurationProperties;
4+
//import org.springframework.cloud.context.config.annotation.RefreshScope;
5+
//import org.springframework.cloud.netflix.zuul.filters.ZuulProperties;
6+
//import org.springframework.stereotype.Component;
7+
//
8+
///**
9+
// * @Author: 文琪
10+
// * @Description:
11+
// * @Date: Created in 2018/4/13 上午11:57
12+
// * @Modified By:
13+
// */
14+
//@Component
15+
//public class ZuulConfig {
16+
//
17+
// @ConfigurationProperties("zuul")
18+
// @RefreshScope
19+
// public ZuulProperties zuulProperties(){
20+
// return new ZuulProperties();
21+
// }
22+
//}

0 commit comments

Comments
 (0)