Skip to content

Commit 1186f9c

Browse files
author
王井方
committed
解决bug
1 parent a49f974 commit 1186f9c

File tree

15 files changed

+266
-539
lines changed

15 files changed

+266
-539
lines changed

.idea/libraries/Maven__com_google_guava_guava_15_0.xml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.idea/libraries/Maven__io_dropwizard_metrics_metrics_core_3_1_0.xml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.idea/libraries/Maven__io_dropwizard_metrics_metrics_healthchecks_3_1_0.xml

Lines changed: 0 additions & 13 deletions
This file was deleted.

common/pom.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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>cxf3.1</artifactId>
7+
<groupId>com.cxf.my</groupId>
8+
<version>0.0.1-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
<groupId>com.jd.vd</groupId>
12+
<artifactId>common</artifactId>
13+
<version>0.0.1-SNAPSHOT</version>
14+
15+
</project>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package com.jd.vd.common.util;
2+
3+
public class ResultUtil {
4+
private int code;
5+
private String msg;
6+
private Object data;
7+
public static ResultUtil SUCCESS = new ResultUtil(0, "success", null);
8+
9+
public static ResultUtil success(Object data) {
10+
return new ResultUtil(0, "success", data);
11+
}
12+
13+
public ResultUtil(int code, String msg, Object data) {
14+
this.code = code;
15+
this.msg = msg;
16+
this.data = data;
17+
}
18+
19+
public static ResultUtil getInstance(int code, String msg, Object data) {
20+
return new ResultUtil(code, msg, data);
21+
}
22+
23+
public int getCode() {
24+
return this.code;
25+
}
26+
27+
public void setCode(int code) {
28+
this.code = code;
29+
}
30+
31+
public String getMsg() {
32+
return this.msg;
33+
}
34+
35+
public void setMsg(String msg) {
36+
this.msg = msg;
37+
}
38+
39+
public Object getData() {
40+
return this.data;
41+
}
42+
43+
public void setData(Object data) {
44+
this.data = data;
45+
}
46+
47+
@Override
48+
public String toString() {
49+
return "ResultUtil [code=" + code + ", msg=" + msg + ", data=" + data + "]";
50+
}
51+
}
52+

elastic-search/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<artifactId>cxf3.1</artifactId>
77
<groupId>com.cxf.my</groupId>
88
<version>0.0.1-SNAPSHOT</version>
9+
<relativePath>../pom.xml</relativePath>
910
</parent>
1011
<modelVersion>4.0.0</modelVersion>
1112

elastic-search/readme.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
基本需求:
2+
1. 到网上爬取信息
3+
2. 将信息存放到es里面
4+
3. 能够根据关键字爬取信息
5+
4. 能够关联推荐
6+
5. 能够限制接口访问流量
7+
7. 接口可以时rpc类型的接口
8+
8. 接口可以被网关代理
9+
9. 能够识别机器流量

gateway-module/pom.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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>cxf3.1</artifactId>
7+
<groupId>com.cxf.my</groupId>
8+
<version>0.0.1-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
<dependencies>
12+
<dependency>
13+
<groupId>com.jd.vd</groupId>
14+
<artifactId>common</artifactId>
15+
<version>0.0.1-SNAPSHOT</version>
16+
</dependency>
17+
</dependencies>
18+
<artifactId>gateway-module</artifactId>
19+
20+
21+
</project>

gateway/src/main/java/io/study/gateway/client/ClientOrigin.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package io.study.gateway.client;
22

3-
import com.sun.deploy.config.ClientConfig;
3+
44
import io.netty.channel.EventLoop;
55
import io.netty.util.concurrent.Promise;
6-
import io.study.gateway.balance.ILoadBalance;
76
import io.study.gateway.config.ProxyConfig;
87

98
public interface ClientOrigin {

gateway/src/main/java/io/study/gateway/proxy/ProxyFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void operationComplete(Future<? super PooledConnection> future) throws Ex
7575
operateConnectSuccess(endpoint,context,connectionPromise.get());
7676
}else{
7777

78-
throw new BizException("proxy.err_get_connection",future.cause());
78+
throw new BizException("proxy.err_get_connection");
7979
}
8080
}
8181
});
@@ -86,7 +86,7 @@ private void onConnectionFail(){
8686

8787
}
8888
private void operateConnectSuccess(ProxyEndpoint endpoint,StreamContext context,PooledConnection connection) {
89-
//context.setTargetNode(connection.getChannel().localAddress());
89+
//context.setTargetNode(connection.getChannel().localAddress());RequestStatFilter
9090
context.setToChannel(connection);
9191
connection.getChannel().attr(GatewayConstant.KEY_PROXY_ENDPOINT).set(endpoint);
9292
endpoint.proxy();

0 commit comments

Comments
 (0)