Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gateway-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SuperHive
back-end
gateway-service
Commits
f1247c1b
Commit
f1247c1b
authored
Oct 13, 2020
by
zhangzc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
e1e4ab6a
Pipeline
#557
failed with stages
Changes
21
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
57 additions
and
47 deletions
+57
-47
pom.xml
pom.xml
+5
-5
GatewayApplication.java
...in/java/com/esv/superhive/gateway/GatewayApplication.java
+2
-2
ApplicationLoadRunner.java
...rhive/gateway/common/component/ApplicationLoadRunner.java
+1
-1
ServiceFallbackProvider.java
...ive/gateway/common/component/ServiceFallbackProvider.java
+2
-2
CommonConstants.java
...v/superhive/gateway/common/constants/CommonConstants.java
+1
-1
EException.java
...om/esv/superhive/gateway/common/exception/EException.java
+1
-1
ECode.java
...java/com/esv/superhive/gateway/common/response/ECode.java
+1
-1
EResponse.java
.../com/esv/superhive/gateway/common/response/EResponse.java
+2
-3
CorsConfig.java
...ain/java/com/esv/superhive/gateway/config/CorsConfig.java
+1
-1
FilterConfig.java
...n/java/com/esv/superhive/gateway/config/FilterConfig.java
+4
-4
AuthFeignClient.java
...java/com/esv/superhive/gateway/feign/AuthFeignClient.java
+2
-2
WebReqAuthReq.java
...n/java/com/esv/superhive/gateway/feign/WebReqAuthReq.java
+1
-1
WebReqAuthRes.java
...n/java/com/esv/superhive/gateway/feign/WebReqAuthRes.java
+1
-1
AccessFilter.java
...n/java/com/esv/superhive/gateway/filter/AccessFilter.java
+1
-1
AuthRoutingFilter.java
...a/com/esv/superhive/gateway/filter/AuthRoutingFilter.java
+9
-10
LogBackPreFilter.java
...va/com/esv/superhive/gateway/filter/LogBackPreFilter.java
+2
-2
LogUtils.java
src/main/java/com/esv/superhive/gateway/util/LogUtils.java
+2
-2
RequestUriUtils.java
.../java/com/esv/superhive/gateway/util/RequestUriUtils.java
+1
-1
ResponseUtils.java
...in/java/com/esv/superhive/gateway/util/ResponseUtils.java
+2
-2
application-local.yml
src/main/resources/application-local.yml
+14
-2
bootstrap.yml
src/main/resources/bootstrap.yml
+2
-2
No files found.
pom.xml
View file @
f1247c1b
...
...
@@ -8,11 +8,11 @@
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.1.1.RELEASE
</version>
</parent>
<groupId>
com.esv.
datacenter
</groupId>
<artifactId>
datacenter
-gateway-service
</artifactId>
<groupId>
com.esv.
superhive
</groupId>
<artifactId>
superhive
-gateway-service
</artifactId>
<version>
1.0.0-SNAPSHOT
</version>
<name>
datacenter
-gateway-service
</name>
<description>
datacenter
-gateway-service
</description>
<name>
superhive
-gateway-service
</name>
<description>
superhive
-gateway-service
</description>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
...
...
@@ -145,7 +145,7 @@
</profiles>
<build>
<finalName>
datacenter
-gateway-service
</finalName>
<finalName>
superhive
-gateway-service
</finalName>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
...
...
src/main/java/com/esv/
datacenter
/gateway/GatewayApplication.java
→
src/main/java/com/esv/
superhive
/gateway/GatewayApplication.java
View file @
f1247c1b
package
com
.
esv
.
datacenter
.
gateway
;
package
com
.
esv
.
superhive
.
gateway
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
...
...
@@ -21,7 +21,7 @@ import java.util.TimeZone;
@SpringBootApplication
@EnableDiscoveryClient
@EnableZuulProxy
@EnableFeignClients
({
"com.esv.
datacenter
.gateway.feign"
})
@EnableFeignClients
({
"com.esv.
superhive
.gateway.feign"
})
public
class
GatewayApplication
{
public
static
void
main
(
String
[]
args
)
{
...
...
src/main/java/com/esv/
datacenter
/gateway/common/component/ApplicationLoadRunner.java
→
src/main/java/com/esv/
superhive
/gateway/common/component/ApplicationLoadRunner.java
View file @
f1247c1b
package
com
.
esv
.
datacenter
.
gateway
.
common
.
component
;
package
com
.
esv
.
superhive
.
gateway
.
common
.
component
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
src/main/java/com/esv/
datacenter
/gateway/common/component/ServiceFallbackProvider.java
→
src/main/java/com/esv/
superhive
/gateway/common/component/ServiceFallbackProvider.java
View file @
f1247c1b
package
com
.
esv
.
datacenter
.
gateway
.
common
.
component
;
package
com
.
esv
.
superhive
.
gateway
.
common
.
component
;
import
com.alibaba.fastjson.JSONObject
;
import
com.esv.
datacenter
.gateway.util.LogUtils
;
import
com.esv.
superhive
.gateway.util.LogUtils
;
import
com.netflix.client.ClientException
;
import
com.netflix.hystrix.exception.HystrixTimeoutException
;
import
lombok.extern.slf4j.Slf4j
;
...
...
src/main/java/com/esv/
datacenter
/gateway/common/constants/CommonConstants.java
→
src/main/java/com/esv/
superhive
/gateway/common/constants/CommonConstants.java
View file @
f1247c1b
package
com
.
esv
.
datacenter
.
gateway
.
common
.
constants
;
package
com
.
esv
.
superhive
.
gateway
.
common
.
constants
;
/**
* @description: 全局常量
...
...
src/main/java/com/esv/
datacenter
/gateway/common/exception/EException.java
→
src/main/java/com/esv/
superhive
/gateway/common/exception/EException.java
View file @
f1247c1b
package
com
.
esv
.
datacenter
.
gateway
.
common
.
exception
;
package
com
.
esv
.
superhive
.
gateway
.
common
.
exception
;
/**
* @description:
...
...
src/main/java/com/esv/
datacenter
/gateway/common/response/ECode.java
→
src/main/java/com/esv/
superhive
/gateway/common/response/ECode.java
View file @
f1247c1b
package
com
.
esv
.
datacenter
.
gateway
.
common
.
response
;
package
com
.
esv
.
superhive
.
gateway
.
common
.
response
;
/**
* @description:
...
...
src/main/java/com/esv/
datacenter
/gateway/common/response/EResponse.java
→
src/main/java/com/esv/
superhive
/gateway/common/response/EResponse.java
View file @
f1247c1b
package
com
.
esv
.
datacenter
.
gateway
.
common
.
response
;
package
com
.
esv
.
superhive
.
gateway
.
common
.
response
;
import
com.esv.datacenter.gateway.util.LogUtils
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.esv.superhive.gateway.util.LogUtils
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
...
...
src/main/java/com/esv/
datacenter
/gateway/config/CorsConfig.java
→
src/main/java/com/esv/
superhive
/gateway/config/CorsConfig.java
View file @
f1247c1b
package
com
.
esv
.
datacenter
.
gateway
.
config
;
package
com
.
esv
.
superhive
.
gateway
.
config
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
src/main/java/com/esv/
datacenter
/gateway/config/FilterConfig.java
→
src/main/java/com/esv/
superhive
/gateway/config/FilterConfig.java
View file @
f1247c1b
package
com
.
esv
.
datacenter
.
gateway
.
config
;
package
com
.
esv
.
superhive
.
gateway
.
config
;
import
com.esv.
datacenter
.gateway.filter.AccessFilter
;
import
com.esv.
datacenter
.gateway.filter.AuthRoutingFilter
;
import
com.esv.
datacenter
.gateway.filter.LogBackPreFilter
;
import
com.esv.
superhive
.gateway.filter.AccessFilter
;
import
com.esv.
superhive
.gateway.filter.AuthRoutingFilter
;
import
com.esv.
superhive
.gateway.filter.LogBackPreFilter
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
src/main/java/com/esv/
datacenter
/gateway/feign/AuthFeignClient.java
→
src/main/java/com/esv/
superhive
/gateway/feign/AuthFeignClient.java
View file @
f1247c1b
package
com
.
esv
.
datacenter
.
gateway
.
feign
;
package
com
.
esv
.
superhive
.
gateway
.
feign
;
import
com.esv.
datacenter
.gateway.common.response.EResponse
;
import
com.esv.
superhive
.gateway.common.response.EResponse
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
src/main/java/com/esv/
datacenter
/gateway/feign/WebReqAuthReq.java
→
src/main/java/com/esv/
superhive
/gateway/feign/WebReqAuthReq.java
View file @
f1247c1b
package
com
.
esv
.
datacenter
.
gateway
.
feign
;
package
com
.
esv
.
superhive
.
gateway
.
feign
;
import
lombok.Data
;
...
...
src/main/java/com/esv/
datacenter
/gateway/feign/WebReqAuthRes.java
→
src/main/java/com/esv/
superhive
/gateway/feign/WebReqAuthRes.java
View file @
f1247c1b
package
com
.
esv
.
datacenter
.
gateway
.
feign
;
package
com
.
esv
.
superhive
.
gateway
.
feign
;
import
lombok.Data
;
...
...
src/main/java/com/esv/
datacenter
/gateway/filter/AccessFilter.java
→
src/main/java/com/esv/
superhive
/gateway/filter/AccessFilter.java
View file @
f1247c1b
package
com
.
esv
.
datacenter
.
gateway
.
filter
;
package
com
.
esv
.
superhive
.
gateway
.
filter
;
import
lombok.extern.slf4j.Slf4j
;
...
...
src/main/java/com/esv/
datacenter
/gateway/filter/AuthRoutingFilter.java
→
src/main/java/com/esv/
superhive
/gateway/filter/AuthRoutingFilter.java
View file @
f1247c1b
package
com
.
esv
.
datacenter
.
gateway
.
filter
;
import
com.esv.
datacenter
.gateway.common.response.EResponse
;
import
com.esv.
datacenter
.gateway.feign.AuthFeignClient
;
import
com.esv.
datacenter
.gateway.feign.WebReqAuthReq
;
import
com.esv.
datacenter
.gateway.feign.WebReqAuthRes
;
import
com.esv.
datacenter
.gateway.util.LogUtils
;
import
com.esv.
datacenter
.gateway.util.RequestUriUtils
;
import
com.esv.
datacenter
.gateway.util.ResponseUtils
;
package
com
.
esv
.
superhive
.
gateway
.
filter
;
import
com.esv.
superhive
.gateway.common.response.EResponse
;
import
com.esv.
superhive
.gateway.feign.AuthFeignClient
;
import
com.esv.
superhive
.gateway.feign.WebReqAuthReq
;
import
com.esv.
superhive
.gateway.feign.WebReqAuthRes
;
import
com.esv.
superhive
.gateway.util.LogUtils
;
import
com.esv.
superhive
.gateway.util.RequestUriUtils
;
import
com.esv.
superhive
.gateway.util.ResponseUtils
;
import
com.esv.gateway.common.GatewayHeaders
;
import
com.netflix.zuul.ZuulFilter
;
import
com.netflix.zuul.context.RequestContext
;
import
com.netflix.zuul.exception.ZuulException
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.MDC
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.cloud.context.config.annotation.RefreshScope
;
...
...
src/main/java/com/esv/
datacenter
/gateway/filter/LogBackPreFilter.java
→
src/main/java/com/esv/
superhive
/gateway/filter/LogBackPreFilter.java
View file @
f1247c1b
package
com
.
esv
.
datacenter
.
gateway
.
filter
;
package
com
.
esv
.
superhive
.
gateway
.
filter
;
import
com.esv.
datacenter
.gateway.common.constants.CommonConstants
;
import
com.esv.
superhive
.gateway.common.constants.CommonConstants
;
import
com.netflix.zuul.ZuulFilter
;
import
com.netflix.zuul.context.RequestContext
;
import
com.netflix.zuul.exception.ZuulException
;
...
...
src/main/java/com/esv/
datacenter
/gateway/util/LogUtils.java
→
src/main/java/com/esv/
superhive
/gateway/util/LogUtils.java
View file @
f1247c1b
package
com
.
esv
.
datacenter
.
gateway
.
util
;
package
com
.
esv
.
superhive
.
gateway
.
util
;
import
com.esv.
datacenter
.gateway.common.constants.CommonConstants
;
import
com.esv.
superhive
.gateway.common.constants.CommonConstants
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.MDC
;
...
...
src/main/java/com/esv/
datacenter
/gateway/util/RequestUriUtils.java
→
src/main/java/com/esv/
superhive
/gateway/util/RequestUriUtils.java
View file @
f1247c1b
package
com
.
esv
.
datacenter
.
gateway
.
util
;
package
com
.
esv
.
superhive
.
gateway
.
util
;
/**
* @description:
...
...
src/main/java/com/esv/
datacenter
/gateway/util/ResponseUtils.java
→
src/main/java/com/esv/
superhive
/gateway/util/ResponseUtils.java
View file @
f1247c1b
package
com
.
esv
.
datacenter
.
gateway
.
util
;
package
com
.
esv
.
superhive
.
gateway
.
util
;
import
com.esv.
datacenter
.gateway.common.response.EResponse
;
import
com.esv.
superhive
.gateway.common.response.EResponse
;
import
com.netflix.zuul.context.RequestContext
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
...
...
src/main/resources/application-local.yml
View file @
f1247c1b
...
...
@@ -11,7 +11,11 @@ management:
app
:
service
:
cc
:
name
:
datacenter-cc-service
name
:
superhive-cc-service
base
:
name
:
superhive-base-service
iot
:
name
:
superhive-iot-service
# 负载均衡设置
ribbon
:
# http建立socket超时时间,毫秒
...
...
@@ -45,5 +49,13 @@ zuul:
routes
:
cc-service
:
path
:
/cc/**
service-id
:
datacenter-cc-service
service-id
:
superhive-cc-service
stripPrefix
:
false
base-service
:
path
:
/base/**
service-id
:
superhive-base-service
stripPrefix
:
false
iot-service
:
path
:
/iot/**
service-id
:
superhive-iot-service
stripPrefix
:
false
\ No newline at end of file
src/main/resources/bootstrap.yml
View file @
f1247c1b
...
...
@@ -4,11 +4,11 @@ server:
context-path
:
/
nacos
:
url
:
192.168.31.248:8848
namespace
:
1697ea67-be4c-4d38-b00d-39392b9dee8f
namespace
:
a068bd25-15f8-4752-8774-08017416270d
group
:
DEFAULT_GROUP
spring
:
application
:
name
:
datacenter
-gateway-service
name
:
superhive
-gateway-service
profiles
:
active
:
local
cloud
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment