├── .metadata
├── .lock
├── .mylyn
│ └── repositories.xml.zip
└── version.ini
├── api-gateway
├── .metadata
│ ├── .lock
│ ├── .plugins
│ │ ├── org.eclipse.rse.core
│ │ │ ├── .log
│ │ │ ├── initializerMarks
│ │ │ │ └── org.eclipse.rse.internal.core.RSELocalConnectionInitializer.mark
│ │ │ └── profiles
│ │ │ │ └── PRF.lap0523_112
│ │ │ │ ├── node.properties
│ │ │ │ ├── H.local_16
│ │ │ │ └── node.properties
│ │ │ │ └── FP.local.files_0
│ │ │ │ └── node.properties
│ │ ├── org.eclipse.rse.ui
│ │ │ └── .log
│ │ ├── org.eclipse.jdt.core
│ │ │ ├── javaLikeNames.txt
│ │ │ ├── externalFilesCache
│ │ │ ├── externalLibsTimeStamps
│ │ │ ├── invalidArchivesCache
│ │ │ ├── nonChainingJarsCache
│ │ │ ├── assumedExternalFilesCache
│ │ │ ├── indexNamesMap.txt
│ │ │ ├── savedIndexNames.txt
│ │ │ └── variablesAndContainers.dat
│ │ ├── org.eclipse.core.resources
│ │ │ ├── .root
│ │ │ │ ├── .indexes
│ │ │ │ │ ├── history.version
│ │ │ │ │ ├── properties.version
│ │ │ │ │ └── properties.index
│ │ │ │ └── 5.tree
│ │ │ └── .safetable
│ │ │ │ └── org.eclipse.core.resources
│ │ ├── org.eclipse.wst.jsdt.core
│ │ │ ├── variablesAndContainers.dat
│ │ │ ├── externalLibsTimeStamps
│ │ │ └── libraries
│ │ │ │ ├── xhr.js
│ │ │ │ ├── browserWindow.js
│ │ │ │ └── dom5.js
│ │ ├── org.eclipse.m2e.core
│ │ │ ├── nexus
│ │ │ │ ├── 104fe970756d922b8c90d44ab4560f0b
│ │ │ │ │ ├── write.lock
│ │ │ │ │ ├── _0_1.del
│ │ │ │ │ ├── _0.cfs
│ │ │ │ │ ├── _1.cfs
│ │ │ │ │ ├── segments_3
│ │ │ │ │ └── segments.gen
│ │ │ │ ├── 197b2e358a78d2328127c7dfc056d967
│ │ │ │ │ ├── write.lock
│ │ │ │ │ ├── _0_1.del
│ │ │ │ │ ├── _0.cfs
│ │ │ │ │ ├── _1.cfs
│ │ │ │ │ ├── segments_3
│ │ │ │ │ └── segments.gen
│ │ │ │ ├── 830bc118332e77292949ed1e6d2fabe0
│ │ │ │ │ ├── write.lock
│ │ │ │ │ ├── _0_1.del
│ │ │ │ │ ├── _1_1.del
│ │ │ │ │ ├── _0.cfs
│ │ │ │ │ ├── _1.cfs
│ │ │ │ │ ├── _2.cfs
│ │ │ │ │ ├── _3.cfs
│ │ │ │ │ ├── _4.cfs
│ │ │ │ │ ├── segments_6
│ │ │ │ │ └── segments.gen
│ │ │ │ └── e8cd3925342ccfec394fb78c3bf2fdac
│ │ │ │ │ ├── write.lock
│ │ │ │ │ ├── _0_1.del
│ │ │ │ │ ├── _0.cfs
│ │ │ │ │ ├── _1.cfs
│ │ │ │ │ ├── segments_3
│ │ │ │ │ └── segments.gen
│ │ │ ├── workspacestate.properties
│ │ │ └── workspaceState.ser
│ │ ├── org.eclipse.pde.core
│ │ │ └── .cache
│ │ │ │ └── clean-cache.properties
│ │ ├── org.eclipse.jdt.ui
│ │ │ ├── OpenTypeHistory.xml
│ │ │ ├── QualifiedTypeNameHistory.xml
│ │ │ └── dialog_settings.xml
│ │ ├── org.eclipse.wst.jsdt.ui
│ │ │ ├── OpenTypeHistory.xml
│ │ │ └── QualifiedTypeNameHistory.xml
│ │ ├── org.eclipse.ltk.core.refactoring
│ │ │ └── .refactorings
│ │ │ │ └── .workspace
│ │ │ │ └── 2015
│ │ │ │ └── 12
│ │ │ │ └── 49
│ │ │ │ ├── refactorings.index
│ │ │ │ └── refactorings.history
│ │ ├── org.tigris.subversion.subclipse.ui
│ │ │ └── dialog_settings.xml
│ │ ├── org.eclipse.wst.sse.core
│ │ │ └── task-tags.properties
│ │ ├── org.eclipse.jdt.launching
│ │ │ ├── .install.xml
│ │ │ └── libraryInfos.xml
│ │ ├── org.eclipse.ui.workbench
│ │ │ ├── workingsets.xml
│ │ │ └── dialog_settings.xml
│ │ ├── org.eclipse.ui.ide
│ │ │ └── dialog_settings.xml
│ │ ├── org.eclipse.debug.ui
│ │ │ ├── dialog_settings.xml
│ │ │ └── launchConfigurationHistory.xml
│ │ ├── org.eclipse.jdt.debug.ui
│ │ │ └── dialog_settings.xml
│ │ ├── org.eclipse.ltk.ui.refactoring
│ │ │ └── dialog_settings.xml
│ │ ├── org.eclipse.m2e.logback.configuration
│ │ │ ├── logback.1.5.0.20140606-0033.xml
│ │ │ └── 0.log
│ │ └── org.eclipse.m2e.core.ui
│ │ │ └── dialog_settings.xml
│ ├── version.ini
│ ├── .mylyn
│ │ └── repositories.xml.zip
│ └── .log
├── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── fly
│ │ │ │ └── app
│ │ │ │ └── gateway
│ │ │ │ ├── helper
│ │ │ │ └── package-info.java
│ │ │ │ ├── exception
│ │ │ │ ├── package-info.java
│ │ │ │ ├── enums
│ │ │ │ │ ├── package-info.java
│ │ │ │ │ └── ResponseCode.java
│ │ │ │ ├── ExceptionResponseBuilder.java
│ │ │ │ ├── BusinessException.java
│ │ │ │ ├── RequestValidatorException.java
│ │ │ │ ├── NoSuchRouteServiceException.java
│ │ │ │ ├── AbstractExceptionResponseBuilder.java
│ │ │ │ ├── ExceptionResponse.java
│ │ │ │ ├── RequestValidatorExceptionResponseBuilder.java
│ │ │ │ ├── BusinessExceptionResponseBuilder.java
│ │ │ │ ├── UnknowExceptionReponseBuilder.java
│ │ │ │ ├── NoSuchRouteServiceExceptionResponseBuilder.java
│ │ │ │ └── OpenApiHandlerExceptionResolver.java
│ │ │ │ ├── remote
│ │ │ │ └── call
│ │ │ │ │ ├── package-info.java
│ │ │ │ │ ├── impl
│ │ │ │ │ ├── package-info.java
│ │ │ │ │ └── RemoteDubboCallComposite.java
│ │ │ │ │ ├── util
│ │ │ │ │ ├── package-info.java
│ │ │ │ │ ├── JsonNullConvertToEmpty.java
│ │ │ │ │ └── DubboResultHelper.java
│ │ │ │ │ └── DubboRemoteCall.java
│ │ │ │ ├── reqest
│ │ │ │ └── parse
│ │ │ │ │ ├── package-info.java
│ │ │ │ │ ├── impl
│ │ │ │ │ ├── package-info.java
│ │ │ │ │ └── RequestParseHandler.java
│ │ │ │ │ ├── utils
│ │ │ │ │ ├── package-info.java
│ │ │ │ │ ├── StringToEnumConverterFactory.java
│ │ │ │ │ └── MethodUtil.java
│ │ │ │ │ └── RequestParse.java
│ │ │ │ ├── filter
│ │ │ │ ├── package-info.java
│ │ │ │ ├── WrappedRequest.java
│ │ │ │ └── HttpServletRequestReplacedFilter.java
│ │ │ │ ├── security
│ │ │ │ ├── common_validator
│ │ │ │ │ ├── chain
│ │ │ │ │ │ ├── package-info.java
│ │ │ │ │ │ ├── Validator.java
│ │ │ │ │ │ ├── CheckSignValidator.java
│ │ │ │ │ │ ├── FreezeUserValidator.java
│ │ │ │ │ │ └── RequestParameterValidator.java
│ │ │ │ │ └── ValidatorInterceptor.java
│ │ │ │ └── csrf_protect
│ │ │ │ │ ├── ProtectionCSRF.java
│ │ │ │ │ └── impl
│ │ │ │ │ └── ProtectionCSRFImpl.java
│ │ │ │ ├── route
│ │ │ │ ├── RegisterService.java
│ │ │ │ ├── dto
│ │ │ │ │ ├── UriServiceMapping.java
│ │ │ │ │ └── UniqueServiceDefined.java
│ │ │ │ └── impl
│ │ │ │ │ └── RegisterServiceImpl.java
│ │ │ │ ├── metrics
│ │ │ │ ├── MetricsReportConfig.java
│ │ │ │ └── RestApiTimerManager.java
│ │ │ │ ├── ApplicationBootstrap.java
│ │ │ │ ├── main
│ │ │ │ └── EmbeddedTomcatConfig.java
│ │ │ │ └── controller
│ │ │ │ └── RestEndpoint.java
│ │ └── resources
│ │ │ ├── shiro-jdbc-realm.ini
│ │ │ ├── spring
│ │ │ └── spring-metrics.xml
│ │ │ ├── application.properties
│ │ │ ├── routeRule.properties
│ │ │ └── logback.xml
│ └── test
│ │ └── java
│ │ └── com
│ │ └── fly
│ │ └── app
│ │ └── api_gateway
│ │ ├── TestClass.java
│ │ ├── AppTest.java
│ │ ├── shiro.sql
│ │ ├── JavassistTest.java
│ │ ├── ShiroTest.java
│ │ └── ParamMappingTest.java
├── README.markdown
├── pom.xml
└── api-gateway.iml
└── Git命令模式(推荐).doc
/.metadata/.lock:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.lock:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.rse.core/.log:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.rse.ui/.log:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt:
--------------------------------------------------------------------------------
1 | java
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.jdt.core/invalidArchivesCache:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Git命令模式(推荐).doc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/Git命令模式(推荐).doc
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.jdt.core/indexNamesMap.txt:
--------------------------------------------------------------------------------
1 | INDEX VERSION 1.127
2 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.wst.jsdt.core/variablesAndContainers.dat:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/104fe970756d922b8c90d44ab4560f0b/write.lock:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/197b2e358a78d2328127c7dfc056d967/write.lock:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/write.lock:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/e8cd3925342ccfec394fb78c3bf2fdac/write.lock:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/104fe970756d922b8c90d44ab4560f0b/_0_1.del:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/197b2e358a78d2328127c7dfc056d967/_0_1.del:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_0_1.del:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_1_1.del:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/e8cd3925342ccfec394fb78c3bf2fdac/_0_1.del:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/workspacestate.properties:
--------------------------------------------------------------------------------
1 | #Tue Dec 01 17:27:24 CST 2015
2 |
--------------------------------------------------------------------------------
/.metadata/.mylyn/repositories.xml.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/.metadata/.mylyn/repositories.xml.zip
--------------------------------------------------------------------------------
/.metadata/version.ini:
--------------------------------------------------------------------------------
1 | #Mon Mar 21 15:04:59 CST 2016
2 | org.eclipse.core.runtime=2
3 | org.eclipse.platform=4.4.0.v20140925-0400
4 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.rse.core/initializerMarks/org.eclipse.rse.internal.core.RSELocalConnectionInitializer.mark:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.pde.core/.cache/clean-cache.properties:
--------------------------------------------------------------------------------
1 | #Cached timestamps
2 | #Thu Dec 10 09:42:50 CST 2015
3 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/version.ini:
--------------------------------------------------------------------------------
1 | #Thu Dec 10 09:41:58 CST 2015
2 | org.eclipse.core.runtime=2
3 | org.eclipse.platform=4.4.0.v20140925-0400
4 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.mylyn/repositories.xml.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.mylyn/repositories.xml.zip
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.wst.jsdt.ui/OpenTypeHistory.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2015/12/49/refactorings.index:
--------------------------------------------------------------------------------
1 | 1448962043600 Delete resource 'api-gateway'
2 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt:
--------------------------------------------------------------------------------
1 | INDEX VERSION 1.127+E:\practice\micro-workspace\api-gateway\.metadata\.plugins\org.eclipse.jdt.core
2 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.wst.jsdt.ui/QualifiedTypeNameHistory.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.tigris.subversion.subclipse.ui/dialog_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/helper/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | /**
5 | * @author yinwei
6 | *
7 | */
8 | package com.fly.app.gateway.helper;
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/exception/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | /**
5 | * @author yinwei
6 | *
7 | */
8 | package com.fly.app.gateway.exception;
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/remote/call/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | /**
5 | * @author yinwei
6 | *
7 | */
8 | package com.fly.app.gateway.remote.call;
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/reqest/parse/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | /**
5 | * @author yinwei
6 | *
7 | */
8 | package com.fly.app.gateway.reqest.parse;
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.wst.sse.core/task-tags.properties:
--------------------------------------------------------------------------------
1 | #
2 | #Tue Dec 01 17:21:49 CST 2015
3 | task-tag-projects-already-scanned=api-gateway,RemoteSystemsTempFiles
4 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/exception/enums/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | /**
5 | * @author yinwei
6 | *
7 | */
8 | package com.fly.app.gateway.exception.enums;
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.core.resources/.root/5.tree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.core.resources/.root/5.tree
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/workspaceState.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/workspaceState.ser
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/remote/call/impl/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | /**
5 | * @author yinwei
6 | *
7 | */
8 | package com.fly.app.gateway.remote.call.impl;
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/remote/call/util/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | /**
5 | * @author yinwei
6 | *
7 | */
8 | package com.fly.app.gateway.remote.call.util;
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/reqest/parse/impl/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | /**
5 | * @author yinwei
6 | *
7 | */
8 | package com.fly.app.gateway.reqest.parse.impl;
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/reqest/parse/utils/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | /**
5 | * @author yinwei
6 | *
7 | */
8 | package com.fly.app.gateway.reqest.parse.utils;
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/filter/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 处理 request getReader 缓冲流不能重复读取的问题
3 | */
4 | /**
5 | * @author yinwei
6 | *
7 | */
8 | package com.fly.app.gateway.filter;
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.wst.jsdt.core/externalLibsTimeStamps:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.wst.jsdt.core/externalLibsTimeStamps
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/security/common_validator/chain/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | /**
5 | * @author tim.yin 这里主要处理通用的业务检测链
6 | *
7 | */
8 | package com.fly.app.gateway.security.common_validator.chain;
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/104fe970756d922b8c90d44ab4560f0b/_0.cfs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/104fe970756d922b8c90d44ab4560f0b/_0.cfs
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/104fe970756d922b8c90d44ab4560f0b/_1.cfs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/104fe970756d922b8c90d44ab4560f0b/_1.cfs
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/197b2e358a78d2328127c7dfc056d967/_0.cfs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/197b2e358a78d2328127c7dfc056d967/_0.cfs
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/197b2e358a78d2328127c7dfc056d967/_1.cfs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/197b2e358a78d2328127c7dfc056d967/_1.cfs
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_0.cfs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_0.cfs
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_1.cfs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_1.cfs
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_2.cfs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_2.cfs
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_3.cfs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_3.cfs
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_4.cfs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_4.cfs
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/e8cd3925342ccfec394fb78c3bf2fdac/_0.cfs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/e8cd3925342ccfec394fb78c3bf2fdac/_0.cfs
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/e8cd3925342ccfec394fb78c3bf2fdac/_1.cfs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/e8cd3925342ccfec394fb78c3bf2fdac/_1.cfs
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/104fe970756d922b8c90d44ab4560f0b/segments_3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/104fe970756d922b8c90d44ab4560f0b/segments_3
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/197b2e358a78d2328127c7dfc056d967/segments_3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/197b2e358a78d2328127c7dfc056d967/segments_3
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/segments_6:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/segments_6
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/e8cd3925342ccfec394fb78c3bf2fdac/segments_3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/e8cd3925342ccfec394fb78c3bf2fdac/segments_3
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat:
--------------------------------------------------------------------------------
1 | ECLIPSE_HOME JRE_SRC
2 | JUNIT_HOME M2_REPO JSR305_ANNOTATIONS JRE_SRCROOT FINDBUGS_ANNOTATIONS JRE_LIB JUNIT_SRC_HOME
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/104fe970756d922b8c90d44ab4560f0b/segments.gen:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/104fe970756d922b8c90d44ab4560f0b/segments.gen
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/197b2e358a78d2328127c7dfc056d967/segments.gen:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/197b2e358a78d2328127c7dfc056d967/segments.gen
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/segments.gen:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/segments.gen
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/e8cd3925342ccfec394fb78c3bf2fdac/segments.gen:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tim-yin/api-gateway/HEAD/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/e8cd3925342ccfec394fb78c3bf2fdac/segments.gen
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.rse.core/profiles/PRF.lap0523_112/node.properties:
--------------------------------------------------------------------------------
1 | # RSE DOM Node
2 | 00-name=LAP0523
3 | 01-type=Profile
4 | 03-attr.defaultPrivate=true
5 | 03-attr.isActive=true
6 | 05-ref.00000=FP.local.files_0
7 | 05-ref.00001=H.local_16
8 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index:
--------------------------------------------------------------------------------
1 | / org.eclipse.core.resources contentCacheState 1 contentCacheTimestamp
1418823933452 org.eclipse.jdt.core stateVersionNumber 27 org.eclipse.wst.jsdt.core stateVersionNumber 21
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.jdt.launching/.install.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/api-gateway/src/test/java/com/fly/app/api_gateway/TestClass.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.api_gateway;
2 |
3 | import java.util.Map;
4 |
5 | /**
6 | * @author tim.yin
7 | * @date 2015年12月30日 下午4:06:55
8 | * @version 1.0
9 | * @Description:TODO
10 | */
11 |
12 | public class TestClass {
13 | public String test(String name, int age, Map address) {
14 | return name;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/api-gateway/src/main/resources/shiro-jdbc-realm.ini:
--------------------------------------------------------------------------------
1 | jdbcRealm=org.apache.shiro.realm.jdbc.JdbcRealm
2 | dataSource=com.alibaba.druid.pool.DruidDataSource
3 | dataSource.driverClassName=com.mysql.jdbc.Driver
4 | dataSource.url=jdbc:mysql://192.168.0.12:3304/2013_nwd
5 | dataSource.username=root
6 | dataSource.password=gOtjP-%zBnI%ZqI
7 | jdbcRealm.dataSource=$dataSource
8 | securityManager.realms=$jdbcRealm
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/security/csrf_protect/ProtectionCSRF.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.security.csrf_protect;
2 |
3 | /**
4 | * @author tim.yin
5 | * @date 2015年11月30日 上午12:25:23
6 | * @version 1.0
7 | * @Description:TODO
8 | */
9 |
10 | public interface ProtectionCSRF {
11 |
12 | //生成随机token
13 | public String generatorRandomToken() throws Exception;
14 |
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/exception/ExceptionResponseBuilder.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.exception;
2 |
3 | /**
4 | * @author tim.yin
5 | * @date 2015年12月09日 上午09:50:14
6 | * @version 1.0
7 | * @Description:TODO
8 | */
9 |
10 | public interface ExceptionResponseBuilder {
11 |
12 | boolean support(Throwable t);
13 |
14 | ExceptionResponse buildExceptionResponse(Throwable t);
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.debug.ui/dialog_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings/.workspace/2015/12/49/refactorings.history:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.jdt.debug.ui/dialog_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.ltk.ui.refactoring/dialog_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/exception/BusinessException.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.exception;
2 |
3 | /**
4 | * @author tim.yin
5 | * @date 2015年12月10日 下午12:40:21
6 | * @version 1.0
7 | * @Description:TODO
8 | */
9 |
10 | public class BusinessException extends Exception {
11 |
12 | /**
13 | *
14 | */
15 | private static final long serialVersionUID = 1L;
16 |
17 | public BusinessException() {
18 |
19 | }
20 |
21 | public BusinessException(String message) {
22 | super(message);
23 | }
24 |
25 | public BusinessException(Exception e) {
26 | super(e);
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/exception/RequestValidatorException.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.exception;
2 |
3 | /**
4 | * @author tim.yin
5 | * @date 2016年1月5日 下午5:19:15
6 | * @version 1.0
7 | * @Description:拦截器验证异常
8 | */
9 |
10 | public class RequestValidatorException extends Exception {
11 |
12 | /**
13 | *
14 | */
15 | private static final long serialVersionUID = 1L;
16 |
17 | public RequestValidatorException() {
18 |
19 | }
20 |
21 | public RequestValidatorException(String message) {
22 | super(message);
23 | }
24 |
25 | public RequestValidatorException(Exception e) {
26 | super(e);
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/reqest/parse/RequestParse.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.reqest.parse;
2 |
3 | import java.io.IOException;
4 | import java.io.UnsupportedEncodingException;
5 | import java.util.Map;
6 |
7 | import javax.servlet.http.HttpServletRequest;
8 |
9 | /**
10 | * @author tim.yin
11 | * @date 2015年12月4日 下午2:51:12
12 | * @version 1.0
13 | * @Description:TODO
14 | */
15 |
16 | public interface RequestParse {
17 |
18 | // 对不同的前端请求进行参数的转化
19 | public Map convertRequestParam(HttpServletRequest request)
20 | throws UnsupportedEncodingException, IOException,
21 | ClassNotFoundException;
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/route/RegisterService.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.route;
2 |
3 | import com.fly.app.gateway.exception.NoSuchRouteServiceException;
4 | import com.fly.app.gateway.route.dto.UniqueServiceDefined;
5 |
6 | /**
7 | * @author tim.yin
8 | * @date 2016年1月4日 下午4:55:05
9 | * @version 1.0
10 | * @Description:TODO
11 | */
12 |
13 | public interface RegisterService {
14 |
15 | public void register(String requestSign,
16 | UniqueServiceDefined uniqueServiceDefined)
17 | throws ClassNotFoundException;
18 |
19 | public UniqueServiceDefined getRegisterService(String requestSign)
20 | throws NoSuchRouteServiceException;
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/exception/NoSuchRouteServiceException.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.exception;
2 |
3 | /**
4 | * @author tim.yin
5 | * @date 2016年1月5日 上午9:59:52
6 | * @version 1.0
7 | * @Description:根据前端唯一标识路由不到后台服务异常
8 | */
9 |
10 | public class NoSuchRouteServiceException extends Exception {
11 |
12 | /**
13 | *
14 | */
15 | private static final long serialVersionUID = 1L;
16 |
17 | public NoSuchRouteServiceException() {
18 |
19 | }
20 |
21 | public NoSuchRouteServiceException(String message) {
22 | super("前端唯一标识 named '" + message + "' 没有映射的后台服务");
23 | }
24 |
25 | public NoSuchRouteServiceException(Exception e) {
26 | super(e);
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/security/common_validator/chain/Validator.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.security.common_validator.chain;
2 |
3 | import java.util.Map;
4 |
5 | /**
6 | * @author tim.yin
7 | * @date 2015年11月30日 上午11:38:21
8 | * @version 1.0
9 | * @Description:TODO
10 | */
11 |
12 | public abstract class Validator {
13 |
14 | /**
15 | * 持有后继的责任对象
16 | */
17 | protected Validator successor;
18 |
19 | public abstract boolean requestHandler(Map params) throws Exception;
20 |
21 | public void setSuccessor(Validator successor) {
22 | this.successor = successor;
23 | }
24 |
25 | public Validator getSuccessor() {
26 | return successor;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/exception/AbstractExceptionResponseBuilder.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.exception;
2 |
3 | import java.util.List;
4 |
5 | /**
6 | * @author tim.yin
7 | * @date 2015年12月09日 上午10:02:38
8 | * @version 1.0
9 | * @Description:TODO
10 | */
11 |
12 | public abstract class AbstractExceptionResponseBuilder implements
13 | ExceptionResponseBuilder {
14 |
15 | @Override
16 | public boolean support(Throwable t) {
17 | final List> classes = exceptionType();
18 | for (final Class> c : classes) {
19 | if (c.isAssignableFrom(t.getClass())) {
20 | return true;
21 | }
22 | }
23 | return false;
24 | }
25 |
26 | public abstract List> exceptionType();
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/security/common_validator/chain/CheckSignValidator.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.security.common_validator.chain;
2 |
3 | import java.util.Map;
4 |
5 | import org.slf4j.Logger;
6 | import org.slf4j.LoggerFactory;
7 | import org.springframework.stereotype.Component;
8 |
9 | /**
10 | * @author tim.yin
11 | * @date 2015年11月30日 上午11:58:13
12 | * @version 1.0
13 | * @Description:TODO
14 | */
15 |
16 | @Component
17 | public class CheckSignValidator extends Validator {
18 |
19 | private static Logger logger = LoggerFactory
20 | .getLogger(CheckSignValidator.class);
21 |
22 | @Override
23 | public boolean requestHandler(Map params) throws Exception {
24 | // TODO log.info("验签校验开始............");
25 | return true;
26 | }
27 |
28 | }
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/remote/call/DubboRemoteCall.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.remote.call;
2 |
3 | import java.util.Map;
4 |
5 | import com.fly.app.gateway.exception.BusinessException;
6 | import com.fly.app.gateway.route.dto.UniqueServiceDefined;
7 |
8 | /**
9 | * @author tim.yin
10 | * @date 2015年12月2日 下午2:56:26
11 | * @version 1.0
12 | * @Description:dubbo 远程调用接口
13 | */
14 |
15 | public interface DubboRemoteCall {
16 |
17 | /**
18 | *
19 | * @param uniqueServiceDefined
20 | * 服务定义
21 | * @param params
22 | * 解析出来的请求参数
23 | * @return
24 | * @throws ClassNotFoundException
25 | */
26 | public Object call(UniqueServiceDefined uniqueServiceDefined,
27 | Map params) throws ClassNotFoundException,
28 | BusinessException;
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/api-gateway/src/main/resources/spring/spring-metrics.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/api-gateway/src/test/java/com/fly/app/api_gateway/AppTest.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.api_gateway;
2 |
3 | import junit.framework.Test;
4 | import junit.framework.TestCase;
5 | import junit.framework.TestSuite;
6 |
7 | /**
8 | * Unit test for simple App.
9 | */
10 | public class AppTest
11 | extends TestCase
12 | {
13 | /**
14 | * Create the test case
15 | *
16 | * @param testName name of the test case
17 | */
18 | public AppTest( String testName )
19 | {
20 | super( testName );
21 | }
22 |
23 | /**
24 | * @return the suite of tests being tested
25 | */
26 | public static Test suite()
27 | {
28 | return new TestSuite( AppTest.class );
29 | }
30 |
31 | /**
32 | * Rigourous Test :-)
33 | */
34 | public void testApp()
35 | {
36 | assertTrue( true );
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/exception/ExceptionResponse.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.exception;
2 |
3 | /**
4 | * @author tim.yin
5 | * @date 2015年12月09日 上午10:12:45
6 | * @version 1.0
7 | * @Description:TODO
8 | */
9 |
10 | public final class ExceptionResponse {
11 |
12 | private String errorCode;// 响应code:100:处理失败;200:处理成功;401:验签失败
13 | private String message;// 错误信息
14 |
15 | public ExceptionResponse() {
16 |
17 | }
18 |
19 | public ExceptionResponse(String errorCode , String message) {
20 | super();
21 | this.errorCode = errorCode;
22 | this.message = message;
23 | }
24 |
25 | public String getErrorCode() {
26 | return errorCode;
27 | }
28 |
29 | public void setErrorCode(String errorCode) {
30 | this.errorCode = errorCode;
31 | }
32 |
33 | public String getMessage() {
34 | return message;
35 | }
36 |
37 | public void setMessage(String message) {
38 | this.message = message;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
19 |
25 |
26 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/exception/RequestValidatorExceptionResponseBuilder.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.exception;
2 |
3 | import java.util.Collections;
4 | import java.util.List;
5 |
6 | import com.fly.app.gateway.exception.enums.ResponseCode;
7 |
8 | /**
9 | * @author tim.yin
10 | * @date 2016年1月5日 下午5:20:48
11 | * @version 1.0
12 | * @Description:TODO
13 | */
14 |
15 | public class RequestValidatorExceptionResponseBuilder extends
16 | AbstractExceptionResponseBuilder {
17 |
18 | private static final List> CLASSES = Collections
19 | .> singletonList(RequestValidatorException.class);
20 |
21 | @Override
22 | public ExceptionResponse buildExceptionResponse(Throwable t) {
23 |
24 | return new ExceptionResponse(
25 | ResponseCode.REQUESTVALIDATORFAILURE.getCode(), t.getMessage());
26 | }
27 |
28 | @Override
29 | public List> exceptionType() {
30 | return CLASSES;
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/exception/BusinessExceptionResponseBuilder.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.exception;
2 |
3 | import java.util.Collections;
4 | import java.util.List;
5 |
6 | import org.springframework.stereotype.Component;
7 |
8 | import com.fly.app.gateway.exception.enums.ResponseCode;
9 |
10 | /**
11 | * @author tim.yin
12 | * @date 2015年12月10日 上午11:51:29
13 | * @version 1.0
14 | * @Description:TODO
15 | */
16 | @Component
17 | public class BusinessExceptionResponseBuilder extends
18 | AbstractExceptionResponseBuilder {
19 |
20 | private static final List> CLASSES = Collections
21 | .> singletonList(BusinessException.class);
22 |
23 | @Override
24 | public ExceptionResponse buildExceptionResponse(Throwable t) {
25 |
26 | return new ExceptionResponse(ResponseCode.ERROR.getCode(),
27 | t.getMessage());
28 | }
29 |
30 | @Override
31 | public List> exceptionType() {
32 | return CLASSES;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/api-gateway/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | # server config
2 | server.port=8089
3 | servlet.container.maxThreads=1000
4 | servlet.container.minSpareThreads=100
5 | servlet.container.connectionTimeout=2000
6 |
7 | # api gateway dubbo consumer
8 | api.gateway.dubbo.application.name=app-api-gateway
9 | api.gateway.dubbo.application.owner=tim.yin
10 | #api.gateway.dubbo.registry.address=zookeeper://10.15.83.191:2181
11 | api.gateway.dubbo.registry.protocol=zookeeper
12 | #api.gateway.dubbo.registry.address=192.168.0.66:2181,192.168.0.67:2181,192.168.0.68:2181
13 | api.gateway.dubbo.registry.address=zk.youdaofortune.com:2181
14 | api.gateway.dubbo.registry.client=curator
15 | api.gateway.dubbo.registry.timeout=5000
16 |
17 | # datasource config
18 | spring.datasource.driverClassName=com.mysql.jdbc.Driver
19 | spring.datasource.url=jdbc:mysql://192.168.0.12:3304/2016_oauth2.0?autoReconnect=true&autoReconnectForPools=true&useUnicode=true&characterEncoding=utf8
20 | spring.datasource.username=root
21 | spring.datasource.password=gOtjP-%zBnI%ZqI
22 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/exception/UnknowExceptionReponseBuilder.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.exception;
2 |
3 | import java.util.Collections;
4 | import java.util.List;
5 |
6 | import com.fly.app.gateway.exception.enums.ResponseCode;
7 | import org.springframework.stereotype.Component;
8 |
9 | /**
10 | * @author tim.yin
11 | * @date 2015年12月10日 下午12:43:03
12 | * @version 1.0
13 | * @Description:未知异常
14 | */
15 |
16 | @Component
17 | public class UnknowExceptionReponseBuilder extends
18 | AbstractExceptionResponseBuilder {
19 |
20 | private static final List> CLASSES = Collections
21 | .> singletonList(Throwable.class);
22 |
23 | private static final String errorMsg = "系统繁忙,请稍后再试";
24 |
25 | @Override
26 | public ExceptionResponse buildExceptionResponse(Throwable t) {
27 | return new ExceptionResponse(ResponseCode.ERROR.getCode(), errorMsg);
28 | }
29 |
30 | @Override
31 | public List> exceptionType() {
32 | return CLASSES;
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/exception/NoSuchRouteServiceExceptionResponseBuilder.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.exception;
2 |
3 | import java.util.Collections;
4 | import java.util.List;
5 |
6 | import com.fly.app.gateway.exception.enums.ResponseCode;
7 | import org.springframework.stereotype.Component;
8 |
9 | /**
10 | * @author tim.yin
11 | * @date 2016年1月5日 上午10:02:12
12 | * @version 1.0
13 | * @Description:TODO
14 | */
15 | @Component
16 | public class NoSuchRouteServiceExceptionResponseBuilder extends
17 | AbstractExceptionResponseBuilder {
18 |
19 | private static final List> CLASSES = Collections
20 | .> singletonList(NoSuchRouteServiceException.class);
21 |
22 | @Override
23 | public ExceptionResponse buildExceptionResponse(Throwable t) {
24 |
25 | return new ExceptionResponse(
26 | ResponseCode.ROUTESERVICEFAILURE.getCode(), t.getMessage());
27 | }
28 |
29 | @Override
30 | public List> exceptionType() {
31 | return CLASSES;
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/api-gateway/src/test/java/com/fly/app/api_gateway/shiro.sql:
--------------------------------------------------------------------------------
1 | drop database if exists shiro;
2 | create database shiro;
3 | use shiro;
4 |
5 | create table users (
6 | id bigint auto_increment,
7 | username varchar(100),
8 | password varchar(100),
9 | password_salt varchar(100),
10 | constraint pk_users primary key(id)
11 | ) charset=utf8 ENGINE=InnoDB;
12 | create unique index idx_users_username on users(username);
13 |
14 | create table user_roles(
15 | id bigint auto_increment,
16 | username varchar(100),
17 | role_name varchar(100),
18 | constraint pk_user_roles primary key(id)
19 | ) charset=utf8 ENGINE=InnoDB;
20 | create unique index idx_user_roles on user_roles(username, role_name);
21 |
22 | create table roles_permissions(
23 | id bigint auto_increment,
24 | role_name varchar(100),
25 | permission varchar(100),
26 | constraint pk_roles_permissions primary key(id)
27 | ) charset=utf8 ENGINE=InnoDB;
28 | create unique index idx_roles_permissions on roles_permissions(role_name, permission);
29 |
30 | insert into users(username,password)values('yin','yin');
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/route/dto/UriServiceMapping.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.route.dto;
2 |
3 | import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
4 |
5 | /**
6 | * @author tim.yin
7 | * @date 2015年11月29日 下午2:05:24
8 | * @version 1.0
9 | * @Description:对应mapping.json 的配置
10 | */
11 |
12 | public class UriServiceMapping extends UniqueServiceDefined {
13 |
14 | private String uri;
15 |
16 | private String requestMethod;
17 |
18 | public String getUri() {
19 | return uri;
20 | }
21 |
22 | public void setUri(String uri) {
23 | this.uri = uri;
24 | }
25 |
26 | public String getRequestMethod() {
27 | return requestMethod;
28 | }
29 |
30 | public void setRequestMethod(String requestMethod) {
31 | this.requestMethod = requestMethod;
32 | }
33 |
34 | public UriServiceMapping() {
35 | super();
36 | }
37 |
38 | public UriServiceMapping(String uri, String requestMethod) {
39 | super();
40 | this.uri = uri;
41 | this.requestMethod = requestMethod;
42 | }
43 |
44 | public String toString() {
45 | return "映射参数:" + new ReflectionToStringBuilder(this).toString();
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/api-gateway/src/test/java/com/fly/app/api_gateway/JavassistTest.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.api_gateway;
2 |
3 | import static org.junit.Assert.assertArrayEquals;
4 |
5 | import java.lang.reflect.Method;
6 | import java.util.List;
7 |
8 | import org.junit.Test;
9 |
10 | import com.google.common.collect.Lists;
11 | import com.fly.app.gateway.reqest.parse.utils.MethodUtil;
12 |
13 | /**
14 | * @author tim.yin
15 | * @date 2015年12月30日 下午4:04:14
16 | * @version 1.0
17 | * @Description:TODO
18 | */
19 |
20 | public class JavassistTest {
21 |
22 | @Test
23 | public void methodTest() throws Exception {
24 |
25 | // Method method = Class
26 | // .forName(
27 | // "com.fly.fortune.endpoint.impl.MockAggregationServiceApiImpl")
28 | // .getDeclaredMethods()[1];
29 |
30 | Method method = TestClass.class.getDeclaredMethods()[0];
31 | String[] paramaterName = MethodUtil.getAllParamaterName(method);
32 | Class>[] type = method.getParameterTypes();
33 |
34 | List list = Lists.newArrayList();
35 | for (int i = 0; i < method.getParameterTypes().length; i++) {
36 | list.add(type[i].getName());
37 | }
38 | assertArrayEquals(paramaterName, new String[] { "name", "age",
39 | "address" });
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/api-gateway/.metadata/.plugins/org.eclipse.rse.core/profiles/PRF.lap0523_112/H.local_16/node.properties:
--------------------------------------------------------------------------------
1 | # RSE DOM Node
2 | 00-name=Local
3 | 01-type=Host
4 | 03-attr.description=
5 | 03-attr.hostname=LOCALHOST
6 | 03-attr.offline=false
7 | 03-attr.promptable=false
8 | 03-attr.systemType=org.eclipse.rse.systemtype.local
9 | 03-attr.type=Local
10 | 06-child.00000.00-name=Local Connector Service
11 | 06-child.00000.01-type=ConnectorService
12 | 06-child.00000.03-attr.group=Local Connector Service
13 | 06-child.00000.03-attr.port=0
14 | 06-child.00000.03-attr.useSSL=false
15 | 06-child.00000.06-child.00000.00-name=Local Files
16 | 06-child.00000.06-child.00000.01-type=SubSystem
17 | 06-child.00000.06-child.00000.03-attr.hidden=false
18 | 06-child.00000.06-child.00000.03-attr.type=local.files
19 | 06-child.00000.06-child.00000.06-child.00000.00-name=LAP0523___LAP0523\:local.files
20 | 06-child.00000.06-child.00000.06-child.00000.01-type=FilterPoolReference
21 | 06-child.00000.06-child.00000.06-child.00000.03-attr.refID=local.files
22 | 06-child.00000.06-child.00001.00-name=Local Shells
23 | 06-child.00000.06-child.00001.01-type=SubSystem
24 | 06-child.00000.06-child.00001.03-attr.hidden=false
25 | 06-child.00000.06-child.00001.03-attr.type=local.shells
26 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/metrics/MetricsReportConfig.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.metrics;
2 |
3 | import java.io.File;
4 | import java.util.Locale;
5 | import java.util.concurrent.TimeUnit;
6 |
7 | import org.springframework.context.annotation.Configuration;
8 |
9 | import com.codahale.metrics.CsvReporter;
10 | import com.codahale.metrics.MetricRegistry;
11 | import com.ryantenney.metrics.spring.config.annotation.EnableMetrics;
12 | import com.ryantenney.metrics.spring.config.annotation.MetricsConfigurerAdapter;
13 |
14 | /**
15 | * @author tim.yin
16 | * @date 2015年11月30日 下午1:37:38
17 | * @version 1.0
18 | * @Description:目前使用不到 对接配置:spring-metrics.xml
19 | */
20 | @Configuration
21 | @EnableMetrics
22 | @Deprecated
23 | public class MetricsReportConfig extends MetricsConfigurerAdapter {
24 |
25 | @Override
26 | public void configureReporters(MetricRegistry metricRegistry) {
27 |
28 | String csvReportPath = "/opt/metrics";
29 | final CsvReporter reporter = CsvReporter.forRegistry(metricRegistry)
30 | .formatFor(Locale.CHINESE).convertRatesTo(TimeUnit.SECONDS)
31 | .convertDurationsTo(TimeUnit.MILLISECONDS)
32 | .build(new File(csvReportPath));
33 |
34 | reporter.start(15, TimeUnit.MINUTES);
35 |
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/security/common_validator/chain/FreezeUserValidator.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.security.common_validator.chain;
2 |
3 | import java.util.Map;
4 | import java.util.Map.Entry;
5 |
6 | import org.apache.commons.lang3.StringUtils;
7 | import org.slf4j.Logger;
8 | import org.slf4j.LoggerFactory;
9 | import org.springframework.stereotype.Component;
10 |
11 | /**
12 | * @author tim.yin
13 | * @date 2015年11月30日 上午11:40:56
14 | * @version 1.0
15 | * @Description:验证用户uid对应是否冻结账户-(如果uid为空,不进行这个环节的验证.)
16 | */
17 | @Component
18 | public class FreezeUserValidator extends Validator{
19 |
20 |
21 | private static Logger logger = LoggerFactory
22 | .getLogger(FreezeUserValidator.class);
23 |
24 | private static final String UID = "uid";
25 |
26 | @Override
27 | public boolean requestHandler(Map params) throws Exception {
28 | for (Entry entry : params.entrySet()) {
29 | if (UID.equals(entry.getKey())) {
30 | if (!StringUtils.isEmpty(entry.getValue())) {
31 | logger.info("uid:"+entry.getValue());
32 | //TODO 这里调用 判断是否黑名单的边缘服务
33 | }
34 | }
35 | }
36 | if (getSuccessor() != null) {
37 | getSuccessor().requestHandler(params);
38 | }
39 | return true;
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/exception/enums/ResponseCode.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.exception.enums;
2 |
3 | /**
4 | * @author tim.yin
5 | * @date 2015年12月10日 上午11:52:38
6 | * @version 1.0
7 | * @Description:这里可以自定义异常返回码 推荐跟httpstatus 报错一致。原先
8 | */
9 |
10 | public enum ResponseCode {
11 |
12 | // 成功处理
13 | SUCCESS("200", "处理成功"),
14 |
15 | // 通用错误异常
16 | ERROR("500", "处理失败"),
17 |
18 | // 跳转异常,至于跳到什么页面,是客户端自己控制
19 | REDIRECTERROR("300", "跳转异常"),
20 |
21 | // 购买跳转异常 购买金额大于 标的可购余额 专用
22 | PURCHASEAMOUNTERROR("301", "购买金额跳转异常"),
23 |
24 | // 验签异常
25 | VALIDATORFAILURE("400", "验签失败"),
26 |
27 | // 用户权限的异常
28 | FREEZEUSERFAILURE("601",
29 | "“尊敬的你我贷用户,检测到您的账户存在异常,为了您的资金安全暂时冻结您的账户,如有疑问请致电客服:400-7910-888”。"), BLACKLISTUSERFAILURE(
30 | "602", "您在你我贷平台有高风险操作,为确保您和他人的资产安全,您已不能充值。详询4007-910-888"), ILLEGALCHARACTER(
31 | "603", "请求包含非法字符【<、>、\"、'、&】,请去掉后重试"),
32 |
33 | ROUTESERVICEFAILURE("602", "路由服务异常!"),
34 |
35 | REQUESTVALIDATORFAILURE("701", "请求通过拦截器异常!");
36 |
37 | public final String code;
38 |
39 | public final String codeMessage;
40 |
41 | private ResponseCode(String code, String codeMessage) {
42 | this.code = code;
43 | this.codeMessage = codeMessage;
44 | }
45 |
46 | public String getCode() {
47 | return code;
48 | }
49 |
50 | public String getCodeMessage() {
51 | return codeMessage;
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/reqest/parse/utils/StringToEnumConverterFactory.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.reqest.parse.utils;
2 |
3 | import org.springframework.core.convert.converter.Converter;
4 | import org.springframework.core.convert.converter.ConverterFactory;
5 | import org.springframework.stereotype.Component;
6 |
7 | /**
8 | * @author tim.yin
9 | * @date 2015年12月28日 上午11:22:03
10 | * @version 1.0
11 | * @Description:TODO
12 | */
13 |
14 | @SuppressWarnings("rawtypes")
15 | @Component
16 | public final class StringToEnumConverterFactory implements
17 | ConverterFactory {
18 |
19 | @SuppressWarnings("unchecked")
20 | public Converter getConverter(
21 | Class targetType) {
22 | return new StringToEnum(targetType);
23 | }
24 |
25 | private class StringToEnum implements Converter {
26 |
27 | private final Class enumType;
28 |
29 | public StringToEnum(Class enumType) {
30 | this.enumType = enumType;
31 | }
32 |
33 | public T convert(String source) {
34 | if (source.length() == 0) {
35 | // It's an empty enum identifier: reset the enum value to null.
36 | return null;
37 | }
38 |
39 | for (T t : enumType.getEnumConstants()) {
40 | if (source.equals(t.toString())) {
41 | return t;
42 | }
43 | }
44 |
45 | return null;
46 | // return (T) Enum.valueOf(this.enumType, source.trim());
47 | }
48 | }
49 |
50 | }
--------------------------------------------------------------------------------
/api-gateway/src/main/java/com/fly/app/gateway/remote/call/util/JsonNullConvertToEmpty.java:
--------------------------------------------------------------------------------
1 | package com.fly.app.gateway.remote.call.util;
2 |
3 | //import java.io.IOException;
4 | //
5 | //import org.codehaus.jackson.JsonGenerator;
6 | //import org.codehaus.jackson.JsonProcessingException;
7 | //import org.codehaus.jackson.map.JsonSerializer;
8 | //import org.codehaus.jackson.map.ObjectMapper;
9 | //import org.codehaus.jackson.map.SerializerProvider;
10 |
11 | import java.io.IOException;
12 |
13 | import com.fasterxml.jackson.core.JsonGenerator;
14 | import com.fasterxml.jackson.core.JsonProcessingException;
15 | import com.fasterxml.jackson.databind.JsonSerializer;
16 | import com.fasterxml.jackson.databind.ObjectMapper;
17 | import com.fasterxml.jackson.databind.SerializerProvider;
18 |
19 | /**
20 | * @author tim.yin
21 | * @date 2016年2月26日 下午5:42:43
22 | * @version 1.0
23 | * @Description:json 最终返回值 null 转化为 "" 数字类型转换为 0
24 | */
25 |
26 | public class JsonNullConvertToEmpty extends ObjectMapper {
27 |
28 | /**
29 | *
30 | */
31 | private static final long serialVersionUID = 1L;
32 |
33 | public JsonNullConvertToEmpty() {
34 | super();
35 |
36 | // 设置null转换""
37 | getSerializerProvider().setNullValueSerializer(new NullSerializer());
38 | }
39 |
40 | // null的JSON序列
41 | private class NullSerializer extends JsonSerializer