Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 40c9a5b

Browse files
openfeign日志增强
1 parent ff8e6aa commit 40c9a5b

File tree

45 files changed

+1145
-62
lines changed

Some content is hidden

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

45 files changed

+1145
-62
lines changed

‎.idea/compiler.xml‎

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

‎.idea/encodings.xml‎

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

‎.idea/workspace.xml‎

Lines changed: 165 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4" />

‎cloud-comsumerzk-order80/pom.xml‎

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>cloud2020</artifactId>
7+
<groupId>org.xzq.springcloud</groupId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>cloud-comsumerzk-order80</artifactId>
13+
<dependencies>
14+
<dependency>
15+
<groupId>org.xzq.springcloud</groupId>
16+
<artifactId>cloud-api-commons</artifactId>
17+
<version>${project.version}</version>
18+
</dependency>
19+
<dependency>
20+
<groupId>org.springframework.boot</groupId>
21+
<artifactId>spring-boot-starter-web</artifactId>
22+
</dependency>
23+
<!--SpringBoot整合Zookeeper客户端-->
24+
<dependency>
25+
<groupId>org.springframework.cloud</groupId>
26+
<artifactId>spring-cloud-starter-zookeeper-discovery</artifactId>
27+
<exclusions>
28+
<!--先排除自带的zookeeper3.5.3-->
29+
<exclusion>
30+
<groupId>org.apache.zookeeper</groupId>
31+
<artifactId>zookeeper</artifactId>
32+
</exclusion>
33+
</exclusions>
34+
</dependency>
35+
<!--添加zookeeper3.4.6版本-->
36+
<dependency>
37+
<groupId>org.apache.zookeeper</groupId>
38+
<artifactId>zookeeper</artifactId>
39+
<version>3.4.6</version>
40+
</dependency>
41+
<dependency>
42+
<groupId>org.springframework.boot</groupId>
43+
<artifactId>spring-boot-starter-actuator</artifactId>
44+
</dependency>
45+
<dependency>
46+
<groupId>org.springframework.boot</groupId>
47+
<artifactId>spring-boot-devtools</artifactId>
48+
<scope>runtime</scope>
49+
<optional>true</optional>
50+
</dependency>
51+
<dependency>
52+
<groupId>org.projectlombok</groupId>
53+
<artifactId>lombok</artifactId>
54+
<optional>true</optional>
55+
</dependency>
56+
<dependency>
57+
<groupId>org.springframework.boot</groupId>
58+
<artifactId>spring-boot-starter-test</artifactId>
59+
<scope>test</scope>
60+
</dependency>
61+
</dependencies>
62+
63+
</project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.xzq.springcloud;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
6+
7+
/**
8+
* @ClassName: OrderZKMain80
9+
* @description:
10+
* @author: XZQ
11+
* @create: 2020年3月6日 21:58
12+
**/
13+
@SpringBootApplication
14+
@EnableDiscoveryClient
15+
public class OrderZKMain80 {
16+
public static void main(String[] args) {
17+
SpringApplication.run(OrderZKMain80.class, args);
18+
}
19+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.xzq.springcloud.config;
2+
3+
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
4+
import org.springframework.context.annotation.Bean;
5+
import org.springframework.context.annotation.Configuration;
6+
import org.springframework.web.client.RestTemplate;
7+
8+
/**
9+
* @ClassName: ApplicationContextConfig
10+
* @description: 配置类
11+
* @author: XZQ
12+
* @create: 2020年3月5日 21:25
13+
**/
14+
@Configuration
15+
public class ApplicationContextConfig {
16+
17+
@Bean
18+
@LoadBalanced//开启负载均衡
19+
public RestTemplate getRestTemplate() {
20+
return new RestTemplate();
21+
}
22+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.xzq.springcloud.controller;
2+
3+
import com.xzq.springcloud.entities.CommonResult;
4+
import lombok.extern.slf4j.Slf4j;
5+
import org.springframework.beans.factory.annotation.Autowired;
6+
import org.springframework.web.bind.annotation.RequestMapping;
7+
import org.springframework.web.bind.annotation.RestController;
8+
import org.springframework.web.client.RestTemplate;
9+
10+
/**
11+
* @ClassName: OrderZKController
12+
* @description:
13+
* @author: XZQ
14+
* @create: 2020年3月6日 22:02
15+
**/
16+
@RestController
17+
@Slf4j
18+
@RequestMapping("/consumer")
19+
public class OrderZKController {
20+
21+
private static final String INVOKE_URL = "http://cloud-provider-payment";
22+
23+
@Autowired
24+
private RestTemplate restTemplate;
25+
26+
@RequestMapping("/payment/zk")
27+
public String get() {
28+
String result = restTemplate.getForObject(INVOKE_URL + "/payment/zk", String.class);
29+
return result;
30+
}
31+
32+
33+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
server:
2+
port: 80
3+
spring:
4+
application:
5+
name: cloud-provider-order
6+
cloud:
7+
zookeeper:
8+
connect-string: 118.178.91.123:2181
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4" />

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /