├── .metadata ├── .bak_0.log ├── .bak_1.log ├── .bak_2.log ├── .lock ├── .log ├── .mylyn │ └── repositories.xml.zip └── version.ini ├── Git命令模式(推荐).doc └── api-gateway ├── .metadata ├── .lock ├── .log ├── .mylyn │ └── repositories.xml.zip ├── .plugins │ ├── org.eclipse.core.resources │ │ ├── .root │ │ │ ├── .indexes │ │ │ │ ├── history.version │ │ │ │ ├── properties.index │ │ │ │ └── properties.version │ │ │ └── 5.tree │ │ └── .safetable │ │ │ └── org.eclipse.core.resources │ ├── org.eclipse.debug.ui │ │ ├── dialog_settings.xml │ │ └── launchConfigurationHistory.xml │ ├── org.eclipse.e4.workbench │ │ └── workbench.xmi │ ├── org.eclipse.jdt.core │ │ ├── assumedExternalFilesCache │ │ ├── externalFilesCache │ │ ├── externalLibsTimeStamps │ │ ├── indexNamesMap.txt │ │ ├── invalidArchivesCache │ │ ├── javaLikeNames.txt │ │ ├── nonChainingJarsCache │ │ ├── savedIndexNames.txt │ │ └── variablesAndContainers.dat │ ├── org.eclipse.jdt.debug.ui │ │ └── dialog_settings.xml │ ├── org.eclipse.jdt.launching │ │ ├── .install.xml │ │ └── libraryInfos.xml │ ├── org.eclipse.jdt.ui │ │ ├── OpenTypeHistory.xml │ │ ├── QualifiedTypeNameHistory.xml │ │ └── dialog_settings.xml │ ├── org.eclipse.ltk.core.refactoring │ │ └── .refactorings │ │ │ └── .workspace │ │ │ └── 2015 │ │ │ └── 12 │ │ │ └── 49 │ │ │ ├── refactorings.history │ │ │ └── refactorings.index │ ├── org.eclipse.ltk.ui.refactoring │ │ └── dialog_settings.xml │ ├── org.eclipse.m2e.core.ui │ │ └── dialog_settings.xml │ ├── org.eclipse.m2e.core │ │ ├── nexus │ │ │ ├── 104fe970756d922b8c90d44ab4560f0b │ │ │ │ ├── _0.cfs │ │ │ │ ├── _0_1.del │ │ │ │ ├── _1.cfs │ │ │ │ ├── segments.gen │ │ │ │ ├── segments_3 │ │ │ │ └── write.lock │ │ │ ├── 197b2e358a78d2328127c7dfc056d967 │ │ │ │ ├── _0.cfs │ │ │ │ ├── _0_1.del │ │ │ │ ├── _1.cfs │ │ │ │ ├── segments.gen │ │ │ │ ├── segments_3 │ │ │ │ └── write.lock │ │ │ ├── 830bc118332e77292949ed1e6d2fabe0 │ │ │ │ ├── _0.cfs │ │ │ │ ├── _0_1.del │ │ │ │ ├── _1.cfs │ │ │ │ ├── _1_1.del │ │ │ │ ├── _2.cfs │ │ │ │ ├── _3.cfs │ │ │ │ ├── _4.cfs │ │ │ │ ├── segments.gen │ │ │ │ ├── segments_6 │ │ │ │ └── write.lock │ │ │ └── e8cd3925342ccfec394fb78c3bf2fdac │ │ │ │ ├── _0.cfs │ │ │ │ ├── _0_1.del │ │ │ │ ├── _1.cfs │ │ │ │ ├── segments.gen │ │ │ │ ├── segments_3 │ │ │ │ └── write.lock │ │ ├── workspaceState.ser │ │ └── workspacestate.properties │ ├── org.eclipse.m2e.logback.configuration │ │ ├── 0.log │ │ └── logback.1.5.0.20140606-0033.xml │ ├── org.eclipse.pde.core │ │ └── .cache │ │ │ └── clean-cache.properties │ ├── org.eclipse.rse.core │ │ ├── .log │ │ ├── initializerMarks │ │ │ └── org.eclipse.rse.internal.core.RSELocalConnectionInitializer.mark │ │ └── profiles │ │ │ └── PRF.lap0523_112 │ │ │ ├── FP.local.files_0 │ │ │ └── node.properties │ │ │ ├── H.local_16 │ │ │ └── node.properties │ │ │ └── node.properties │ ├── org.eclipse.rse.ui │ │ └── .log │ ├── org.eclipse.ui.ide │ │ └── dialog_settings.xml │ ├── org.eclipse.ui.workbench │ │ ├── dialog_settings.xml │ │ └── workingsets.xml │ ├── org.eclipse.wst.jsdt.core │ │ ├── externalLibsTimeStamps │ │ ├── libraries │ │ │ ├── baseBrowserLibrary.js │ │ │ ├── browserWindow.js │ │ │ ├── dom5.js │ │ │ ├── system.js │ │ │ └── xhr.js │ │ └── variablesAndContainers.dat │ ├── org.eclipse.wst.jsdt.ui │ │ ├── OpenTypeHistory.xml │ │ └── QualifiedTypeNameHistory.xml │ ├── org.eclipse.wst.sse.core │ │ └── task-tags.properties │ └── org.tigris.subversion.subclipse.ui │ │ └── dialog_settings.xml └── version.ini ├── README.markdown ├── api-gateway.iml ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── fly │ │ └── app │ │ └── gateway │ │ ├── ApplicationBootstrap.java │ │ ├── controller │ │ └── RestEndpoint.java │ │ ├── exception │ │ ├── AbstractExceptionResponseBuilder.java │ │ ├── BusinessException.java │ │ ├── BusinessExceptionResponseBuilder.java │ │ ├── ExceptionResponse.java │ │ ├── ExceptionResponseBuilder.java │ │ ├── NoSuchRouteServiceException.java │ │ ├── NoSuchRouteServiceExceptionResponseBuilder.java │ │ ├── OpenApiHandlerExceptionResolver.java │ │ ├── RequestValidatorException.java │ │ ├── RequestValidatorExceptionResponseBuilder.java │ │ ├── UnknowExceptionReponseBuilder.java │ │ ├── enums │ │ │ ├── ResponseCode.java │ │ │ └── package-info.java │ │ └── package-info.java │ │ ├── filter │ │ ├── HttpServletRequestReplacedFilter.java │ │ ├── WrappedRequest.java │ │ └── package-info.java │ │ ├── helper │ │ └── package-info.java │ │ ├── main │ │ └── EmbeddedTomcatConfig.java │ │ ├── metrics │ │ ├── MetricsReportConfig.java │ │ └── RestApiTimerManager.java │ │ ├── remote │ │ └── call │ │ │ ├── DubboRemoteCall.java │ │ │ ├── impl │ │ │ ├── RemoteDubboCallComposite.java │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ └── util │ │ │ ├── DubboResultHelper.java │ │ │ ├── JsonNullConvertToEmpty.java │ │ │ └── package-info.java │ │ ├── reqest │ │ └── parse │ │ │ ├── RequestParse.java │ │ │ ├── impl │ │ │ ├── RequestParseHandler.java │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ └── utils │ │ │ ├── MethodUtil.java │ │ │ ├── StringToEnumConverterFactory.java │ │ │ └── package-info.java │ │ ├── route │ │ ├── RegisterService.java │ │ ├── dto │ │ │ ├── UniqueServiceDefined.java │ │ │ └── UriServiceMapping.java │ │ └── impl │ │ │ └── RegisterServiceImpl.java │ │ └── security │ │ ├── common_validator │ │ ├── ValidatorInterceptor.java │ │ └── chain │ │ │ ├── CheckSignValidator.java │ │ │ ├── FreezeUserValidator.java │ │ │ ├── RequestParameterValidator.java │ │ │ ├── Validator.java │ │ │ └── package-info.java │ │ └── csrf_protect │ │ ├── ProtectionCSRF.java │ │ └── impl │ │ └── ProtectionCSRFImpl.java └── resources │ ├── application.properties │ ├── logback.xml │ ├── routeRule.properties │ ├── shiro-jdbc-realm.ini │ └── spring │ └── spring-metrics.xml └── test └── java └── com └── fly └── app └── api_gateway ├── AppTest.java ├── JavassistTest.java ├── ParamMappingTest.java ├── ShiroTest.java ├── TestClass.java └── shiro.sql /.metadata/.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/.metadata/.lock -------------------------------------------------------------------------------- /.metadata/.mylyn/repositories.xml.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/.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 | -------------------------------------------------------------------------------- /Git命令模式(推荐).doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/Git命令模式(推荐).doc -------------------------------------------------------------------------------- /api-gateway/.metadata/.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.lock -------------------------------------------------------------------------------- /api-gateway/.metadata/.log: -------------------------------------------------------------------------------- 1 | !SESSION 2015-12-01 17:17:59.378 ----------------------------------------------- 2 | eclipse.buildId=4.4.1.M20140925-0400 3 | java.version=1.7.0_67 4 | java.vendor=Oracle Corporation 5 | BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=zh_CN 6 | Framework arguments: -product org.eclipse.epp.package.jee.product 7 | Command-line arguments: -data E:\practice\micro-workspace\api-gateway -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product 8 | 9 | !ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-12-01 17:18:01.499 10 | !MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String 11 | !STACK 0 12 | java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String 13 | at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) 14 | at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) 15 | at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) 16 | at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) 17 | at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) 18 | at java.util.TimerThread.mainLoop(Unknown Source) 19 | at java.util.TimerThread.run(Unknown Source) 20 | 21 | !ENTRY org.eclipse.egit.ui 2 0 2015-12-01 17:18:10.985 22 | !MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level 23 | Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. 24 | The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in 25 | this system level configuration. The Git installation location can be configured on the 26 | Team > Git > Configuration preference page's 'System Settings' tab. 27 | This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. 28 | 29 | !ENTRY org.eclipse.egit.ui 2 0 2015-12-01 17:18:10.985 30 | !MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git 31 | user global configuration and to define the default location to store repositories: 'C:\Users\yinwei'. If this is 32 | not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and 33 | EGit might behave differently since they see different configuration options. 34 | This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. 35 | 36 | !ENTRY com.zeroturnaround.eclipse.optimizer.plugin 1 0 2015-12-01 17:18:11.727 37 | !MESSAGE location of launcher INI: D:\software\eclipse\eclipse.ini 38 | 39 | !ENTRY org.tigris.subversion.subclipse.core 4 0 2015-12-01 17:21:48.645 40 | !MESSAGE Could not auto-share project api-gateway 41 | !STACK 1 42 | org.tigris.subversion.subclipse.core.SVNException: 提供的 SVN 信息与磁盘上“api-gateway”项目的信息不相匹配。 43 | at org.tigris.subversion.subclipse.core.resources.SVNWorkspaceRoot.setSharing(SVNWorkspaceRoot.java:206) 44 | at org.tigris.subversion.subclipse.core.SVNTeamProviderType$AutoShareJob.autoconnectSVNProject(SVNTeamProviderType.java:140) 45 | at org.tigris.subversion.subclipse.core.SVNTeamProviderType$AutoShareJob.run(SVNTeamProviderType.java:106) 46 | at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) 47 | !SUBENTRY 1 org.tigris.subversion.subclipse.core 4 4 2015-12-01 17:21:48.646 48 | !MESSAGE 提供的 SVN 信息与磁盘上“api-gateway”项目的信息不相匹配。 49 | !SESSION 2015-12-01 17:25:22.803 ----------------------------------------------- 50 | eclipse.buildId=4.4.1.M20140925-0400 51 | java.version=1.7.0_67 52 | java.vendor=Oracle Corporation 53 | BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=zh_CN 54 | Framework arguments: -product org.eclipse.epp.package.jee.product 55 | Command-line arguments: -data E:\practice\micro-workspace\api-gateway -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product 56 | 57 | !ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-12-01 17:25:24.989 58 | !MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String 59 | !STACK 0 60 | java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String 61 | at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) 62 | at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) 63 | at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) 64 | at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) 65 | at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) 66 | at java.util.TimerThread.mainLoop(Unknown Source) 67 | at java.util.TimerThread.run(Unknown Source) 68 | 69 | !ENTRY com.zeroturnaround.eclipse.optimizer.plugin 1 0 2015-12-01 17:25:31.203 70 | !MESSAGE location of launcher INI: D:\software\eclipse\eclipse.ini 71 | 72 | !ENTRY org.eclipse.egit.ui 2 0 2015-12-01 17:25:33.044 73 | !MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level 74 | Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. 75 | The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in 76 | this system level configuration. The Git installation location can be configured on the 77 | Team > Git > Configuration preference page's 'System Settings' tab. 78 | This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. 79 | 80 | !ENTRY org.eclipse.egit.ui 2 0 2015-12-01 17:25:33.045 81 | !MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git 82 | user global configuration and to define the default location to store repositories: 'C:\Users\yinwei'. If this is 83 | not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and 84 | EGit might behave differently since they see different configuration options. 85 | This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. 86 | 87 | !ENTRY org.eclipse.m2e.logback.appender 4 0 2015-12-01 17:28:41.731 88 | !MESSAGE Unable to create project from archetype [org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE] 89 | 90 | !ENTRY org.eclipse.m2e.core 4 -1 2015-12-01 17:28:41.734 91 | !MESSAGE Unable to create project from archetype [org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE] 92 | !STACK 0 93 | org.apache.maven.archetype.old.ArchetypeTemplateProcessingException: Unable to add module to the current project as it is not of packaging type 'pom' 94 | at org.apache.maven.archetype.old.DefaultOldArchetype.createArchetype(DefaultOldArchetype.java:308) 95 | at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.processOldArchetype(DefaultArchetypeGenerator.java:253) 96 | at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:143) 97 | at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:286) 98 | at org.apache.maven.archetype.DefaultArchetype.generateProjectFromArchetype(DefaultArchetype.java:69) 99 | at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.createArchetypeProjects0(ProjectConfigurationManager.java:770) 100 | at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$5.call(ProjectConfigurationManager.java:719) 101 | at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$5.call(ProjectConfigurationManager.java:1) 102 | at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:166) 103 | at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:142) 104 | at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:96) 105 | at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1348) 106 | at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.createArchetypeProjects(ProjectConfigurationManager.java:717) 107 | at org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizard$5.doCreateMavenProjects(MavenProjectWizard.java:244) 108 | at org.eclipse.m2e.core.ui.internal.wizards.AbstactCreateMavenProjectJob$1.doCreateMavenProjects(AbstactCreateMavenProjectJob.java:46) 109 | at org.eclipse.m2e.core.ui.internal.wizards.AbstractCreateMavenProjectsOperation.run(AbstractCreateMavenProjectsOperation.java:62) 110 | at org.eclipse.m2e.core.ui.internal.wizards.AbstactCreateMavenProjectJob.runInWorkspace(AbstactCreateMavenProjectJob.java:50) 111 | at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) 112 | at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) 113 | 114 | !ENTRY org.eclipse.m2e.logback.appender 4 0 2015-12-01 17:29:51.525 115 | !MESSAGE Unable to create project from archetype [org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE] 116 | 117 | !ENTRY org.eclipse.m2e.core 4 -1 2015-12-01 17:29:51.526 118 | !MESSAGE Unable to create project from archetype [org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE] 119 | !STACK 0 120 | org.apache.maven.archetype.old.ArchetypeTemplateProcessingException: Unable to add module to the current project as it is not of packaging type 'pom' 121 | at org.apache.maven.archetype.old.DefaultOldArchetype.createArchetype(DefaultOldArchetype.java:308) 122 | at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.processOldArchetype(DefaultArchetypeGenerator.java:253) 123 | at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:143) 124 | at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:286) 125 | at org.apache.maven.archetype.DefaultArchetype.generateProjectFromArchetype(DefaultArchetype.java:69) 126 | at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.createArchetypeProjects0(ProjectConfigurationManager.java:770) 127 | at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$5.call(ProjectConfigurationManager.java:719) 128 | at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$5.call(ProjectConfigurationManager.java:1) 129 | at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:166) 130 | at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:142) 131 | at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:96) 132 | at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1348) 133 | at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.createArchetypeProjects(ProjectConfigurationManager.java:717) 134 | at org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizard$5.doCreateMavenProjects(MavenProjectWizard.java:244) 135 | at org.eclipse.m2e.core.ui.internal.wizards.AbstactCreateMavenProjectJob$1.doCreateMavenProjects(AbstactCreateMavenProjectJob.java:46) 136 | at org.eclipse.m2e.core.ui.internal.wizards.AbstractCreateMavenProjectsOperation.run(AbstractCreateMavenProjectsOperation.java:62) 137 | at org.eclipse.m2e.core.ui.internal.wizards.AbstactCreateMavenProjectJob.runInWorkspace(AbstactCreateMavenProjectJob.java:50) 138 | at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) 139 | at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) 140 | !SESSION 2015-12-01 17:42:09.534 ----------------------------------------------- 141 | eclipse.buildId=4.4.1.M20140925-0400 142 | java.version=1.7.0_67 143 | java.vendor=Oracle Corporation 144 | BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=zh_CN 145 | Framework arguments: -product org.eclipse.epp.package.jee.product 146 | Command-line arguments: -data E:\practice\micro-workspace\api-gateway -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product 147 | 148 | !ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-12-01 17:42:11.752 149 | !MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String 150 | !STACK 0 151 | java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String 152 | at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) 153 | at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) 154 | at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) 155 | at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) 156 | at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) 157 | at java.util.TimerThread.mainLoop(Unknown Source) 158 | at java.util.TimerThread.run(Unknown Source) 159 | 160 | !ENTRY org.eclipse.egit.ui 2 0 2015-12-01 17:42:16.427 161 | !MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level 162 | Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. 163 | The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in 164 | this system level configuration. The Git installation location can be configured on the 165 | Team > Git > Configuration preference page's 'System Settings' tab. 166 | This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. 167 | 168 | !ENTRY org.eclipse.egit.ui 2 0 2015-12-01 17:42:16.428 169 | !MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git 170 | user global configuration and to define the default location to store repositories: 'C:\Users\yinwei'. If this is 171 | not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and 172 | EGit might behave differently since they see different configuration options. 173 | This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. 174 | 175 | !ENTRY com.zeroturnaround.eclipse.optimizer.plugin 1 0 2015-12-01 17:42:17.032 176 | !MESSAGE location of launcher INI: D:\software\eclipse\eclipse.ini 177 | !SESSION 2015-12-04 09:43:07.694 ----------------------------------------------- 178 | eclipse.buildId=4.4.1.M20140925-0400 179 | java.version=1.7.0_67 180 | java.vendor=Oracle Corporation 181 | BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=zh_CN 182 | Framework arguments: -product org.eclipse.epp.package.jee.product 183 | Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product 184 | 185 | !ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-12-04 09:43:31.003 186 | !MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String 187 | !STACK 0 188 | java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String 189 | at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) 190 | at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) 191 | at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) 192 | at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) 193 | at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) 194 | at java.util.TimerThread.mainLoop(Unknown Source) 195 | at java.util.TimerThread.run(Unknown Source) 196 | 197 | !ENTRY org.eclipse.egit.ui 2 0 2015-12-04 09:43:35.846 198 | !MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level 199 | Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. 200 | The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in 201 | this system level configuration. The Git installation location can be configured on the 202 | Team > Git > Configuration preference page's 'System Settings' tab. 203 | This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. 204 | 205 | !ENTRY org.eclipse.egit.ui 2 0 2015-12-04 09:43:35.847 206 | !MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git 207 | user global configuration and to define the default location to store repositories: 'C:\Users\yinwei'. If this is 208 | not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and 209 | EGit might behave differently since they see different configuration options. 210 | This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. 211 | 212 | !ENTRY com.zeroturnaround.eclipse.optimizer.plugin 1 0 2015-12-04 09:43:36.513 213 | !MESSAGE location of launcher INI: D:\software\eclipse\eclipse.ini 214 | !SESSION 2015-12-10 09:41:36.338 ----------------------------------------------- 215 | eclipse.buildId=4.4.1.M20140925-0400 216 | java.version=1.7.0_67 217 | java.vendor=Oracle Corporation 218 | BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=zh_CN 219 | Framework arguments: -product org.eclipse.epp.package.jee.product 220 | Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product 221 | 222 | !ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-12-10 09:42:02.624 223 | !MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String 224 | !STACK 0 225 | java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String 226 | at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) 227 | at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) 228 | at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) 229 | at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) 230 | at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) 231 | at java.util.TimerThread.mainLoop(Unknown Source) 232 | at java.util.TimerThread.run(Unknown Source) 233 | 234 | !ENTRY org.eclipse.egit.ui 2 0 2015-12-10 09:42:18.199 235 | !MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level 236 | Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. 237 | The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in 238 | this system level configuration. The Git installation location can be configured on the 239 | Team > Git > Configuration preference page's 'System Settings' tab. 240 | This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. 241 | 242 | !ENTRY org.eclipse.egit.ui 2 0 2015-12-10 09:42:18.199 243 | !MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git 244 | user global configuration and to define the default location to store repositories: 'C:\Users\yinwei'. If this is 245 | not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and 246 | EGit might behave differently since they see different configuration options. 247 | This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. 248 | 249 | !ENTRY com.zeroturnaround.eclipse.optimizer.plugin 1 0 2015-12-10 09:42:20.285 250 | !MESSAGE location of launcher INI: D:\software\eclipse\eclipse.ini 251 | -------------------------------------------------------------------------------- /api-gateway/.metadata/.mylyn/repositories.xml.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.mylyn/repositories.xml.zip -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index: -------------------------------------------------------------------------------- 1 | /org.eclipse.core.resourcescontentCacheState1contentCacheTimestamp 1418823933452org.eclipse.jdt.corestateVersionNumber27org.eclipse.wst.jsdt.corestateVersionNumber21 -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.core.resources/.root/5.tree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.core.resources/.root/5.tree -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.debug.ui/dialog_settings.xml: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 5 | 6 | 7 |
8 |
9 | -------------------------------------------------------------------------------- /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/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /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/indexNamesMap.txt: -------------------------------------------------------------------------------- 1 | INDEX VERSION 1.127 2 | -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.jdt.core/invalidArchivesCache: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt: -------------------------------------------------------------------------------- 1 | java -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /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.jdt.core/variablesAndContainers.dat: -------------------------------------------------------------------------------- 1 |  ECLIPSE_HOMEJRE_SRC 2 | JUNIT_HOMEM2_REPOJSR305_ANNOTATIONS JRE_SRCROOTFINDBUGS_ANNOTATIONSJRE_LIBJUNIT_SRC_HOME -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.jdt.debug.ui/dialog_settings.xml: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 |
8 | -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.jdt.launching/.install.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.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 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 |
6 | -------------------------------------------------------------------------------- /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.ltk.core.refactoring/.refactorings/.workspace/2015/12/49/refactorings.index: -------------------------------------------------------------------------------- 1 | 1448962043600 Delete resource 'api-gateway' 2 | -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.ltk.ui.refactoring/dialog_settings.xml: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 5 | 6 | 7 |
8 |
9 | 10 | 11 |
12 |
13 | -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core.ui/dialog_settings.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 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
45 |
46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 |
58 |
59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 |
76 |
77 | -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/104fe970756d922b8c90d44ab4560f0b/_0.cfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/104fe970756d922b8c90d44ab4560f0b/_0.cfs -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/104fe970756d922b8c90d44ab4560f0b/_0_1.del: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/104fe970756d922b8c90d44ab4560f0b/_1.cfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/104fe970756d922b8c90d44ab4560f0b/_1.cfs -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/104fe970756d922b8c90d44ab4560f0b/segments.gen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/104fe970756d922b8c90d44ab4560f0b/segments.gen -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/104fe970756d922b8c90d44ab4560f0b/segments_3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/104fe970756d922b8c90d44ab4560f0b/segments_3 -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/104fe970756d922b8c90d44ab4560f0b/write.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/104fe970756d922b8c90d44ab4560f0b/write.lock -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/197b2e358a78d2328127c7dfc056d967/_0.cfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/197b2e358a78d2328127c7dfc056d967/_0.cfs -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/197b2e358a78d2328127c7dfc056d967/_0_1.del: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/197b2e358a78d2328127c7dfc056d967/_1.cfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/197b2e358a78d2328127c7dfc056d967/_1.cfs -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/197b2e358a78d2328127c7dfc056d967/segments.gen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/197b2e358a78d2328127c7dfc056d967/segments.gen -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/197b2e358a78d2328127c7dfc056d967/segments_3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/197b2e358a78d2328127c7dfc056d967/segments_3 -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/197b2e358a78d2328127c7dfc056d967/write.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/197b2e358a78d2328127c7dfc056d967/write.lock -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_0.cfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_0.cfs -------------------------------------------------------------------------------- /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.cfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_1.cfs -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_1_1.del: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_2.cfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/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/5d59851e45c44b5b92f6f4a40a357861b355546b/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/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/_4.cfs -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/segments.gen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/segments.gen -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/segments_6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/segments_6 -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/write.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/830bc118332e77292949ed1e6d2fabe0/write.lock -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/e8cd3925342ccfec394fb78c3bf2fdac/_0.cfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/e8cd3925342ccfec394fb78c3bf2fdac/_0.cfs -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/e8cd3925342ccfec394fb78c3bf2fdac/_0_1.del: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/e8cd3925342ccfec394fb78c3bf2fdac/_1.cfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/e8cd3925342ccfec394fb78c3bf2fdac/_1.cfs -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/e8cd3925342ccfec394fb78c3bf2fdac/segments.gen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/e8cd3925342ccfec394fb78c3bf2fdac/segments.gen -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/e8cd3925342ccfec394fb78c3bf2fdac/segments_3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/e8cd3925342ccfec394fb78c3bf2fdac/segments_3 -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/e8cd3925342ccfec394fb78c3bf2fdac/write.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/nexus/e8cd3925342ccfec394fb78c3bf2fdac/write.lock -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/workspaceState.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.m2e.core/workspaceState.ser -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.core/workspacestate.properties: -------------------------------------------------------------------------------- 1 | #Tue Dec 01 17:27:24 CST 2015 2 | -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log: -------------------------------------------------------------------------------- 1 | 2015-12-01 17:21:44,964 [Worker-6] INFO o.e.m.c.i.l.LifecycleMappingFactory - Using org.eclipse.m2e.jdt.JarLifecycleMapping lifecycle mapping for MavenProject: com.niwodai.app:api-gateway:0.0.1-SNAPSHOT @ E:\api-gateway\pom.xml. 2 | 2015-12-01 17:21:46,895 [Worker-6] INFO o.e.m.j.i.AbstractJavaProjectConfigurator - Adding source folder /api-gateway/src/main/java 3 | 2015-12-01 17:21:46,895 [Worker-6] INFO o.e.m.j.i.AbstractJavaProjectConfigurator - Adding resource folder /api-gateway/src/main/resources 4 | 2015-12-01 17:21:46,896 [Worker-6] INFO o.e.m.j.i.AbstractJavaProjectConfigurator - Adding resource folder /api-gateway/src/main/resources 5 | 2015-12-01 17:21:46,897 [Worker-6] INFO o.e.m.j.i.AbstractJavaProjectConfigurator - Adding source folder /api-gateway/src/test/java 6 | 2015-12-01 17:21:47,532 [Worker-3] INFO o.e.m.c.i.l.LifecycleMappingFactory - Using org.eclipse.m2e.jdt.JarLifecycleMapping lifecycle mapping for MavenProject: com.niwodai.app:api-gateway:0.0.1-SNAPSHOT @ E:\api-gateway\pom.xml. 7 | 2015-12-01 17:21:48,441 [Worker-6] INFO o.e.m.c.i.p.ProjectConfigurationManager - Imported and configured 1 project(s) in 4 sec 8 | 2015-12-01 17:21:53,188 [Worker-9] INFO o.e.m.c.i.embedder.EclipseLogger - Using 'UTF-8' encoding to copy filtered resources. 9 | 2015-12-01 17:21:53,193 [Worker-9] INFO o.e.m.c.i.embedder.EclipseLogger - Copying 1 resource 10 | 2015-12-01 17:21:53,209 [Worker-9] INFO o.e.m.c.i.embedder.EclipseLogger - Copying 3 resources 11 | 2015-12-01 17:21:53,216 [Worker-9] INFO o.e.m.c.i.embedder.EclipseLogger - Using 'UTF-8' encoding to copy filtered resources. 12 | 2015-12-01 17:21:53,216 [Worker-9] INFO o.e.m.c.i.embedder.EclipseLogger - skip non existing resourceDirectory E:\api-gateway\src\test\resources 13 | 2015-12-01 17:21:54,828 [Worker-3] INFO o.e.m.c.i.embedder.EclipseLogger - Using 'UTF-8' encoding to copy filtered resources. 14 | 2015-12-01 17:21:54,829 [Worker-3] INFO o.e.m.c.i.embedder.EclipseLogger - Copying 0 resource 15 | 2015-12-01 17:21:54,830 [Worker-3] INFO o.e.m.c.i.embedder.EclipseLogger - Copying 0 resource 16 | 2015-12-01 17:21:54,833 [Worker-3] INFO o.e.m.c.i.embedder.EclipseLogger - Using 'UTF-8' encoding to copy filtered resources. 17 | 2015-12-01 17:21:54,834 [Worker-3] INFO o.e.m.c.i.embedder.EclipseLogger - skip non existing resourceDirectory E:\api-gateway\src\test\resources 18 | 2015-12-01 17:22:00,977 [Worker-9] INFO o.e.m.c.i.l.LifecycleMappingFactory - Using org.eclipse.m2e.jdt.JarLifecycleMapping lifecycle mapping for MavenProject: com.niwodai.app:api-gateway:0.0.1-SNAPSHOT @ E:\api-gateway\pom.xml. 19 | 2015-12-01 17:22:01,645 [Worker-9] INFO o.e.m.c.i.embedder.EclipseLogger - Using 'UTF-8' encoding to copy filtered resources. 20 | 2015-12-01 17:22:01,647 [Worker-9] INFO o.e.m.c.i.embedder.EclipseLogger - Copying 1 resource 21 | 2015-12-01 17:22:01,649 [Worker-9] INFO o.e.m.c.i.embedder.EclipseLogger - Copying 3 resources 22 | 2015-12-01 17:22:01,654 [Worker-9] INFO o.e.m.c.i.embedder.EclipseLogger - Using 'UTF-8' encoding to copy filtered resources. 23 | 2015-12-01 17:22:01,655 [Worker-9] INFO o.e.m.c.i.embedder.EclipseLogger - skip non existing resourceDirectory E:\api-gateway\src\test\resources 24 | 2015-12-01 17:22:17,955 [main] INFO o.e.m2e.actions.ExecutePomAction - Creating new launch configuration 25 | 2015-12-01 17:22:25,211 [Worker-7] INFO o.e.m.i.launch.MavenLaunchDelegate - E:\api-gateway 26 | 2015-12-01 17:22:25,211 [Worker-7] INFO o.e.m.i.launch.MavenLaunchDelegate - mvn -B -Dmaven.test.skip=true -DskipTests clean install 27 | 2015-12-01 17:23:45,825 [main] INFO o.e.m2e.actions.ExecutePomAction - Using existing launch configuration 28 | 2015-12-01 17:23:45,951 [Worker-5] INFO o.e.m.i.launch.MavenLaunchDelegate - E:\api-gateway 29 | 2015-12-01 17:23:45,951 [Worker-5] INFO o.e.m.i.launch.MavenLaunchDelegate - mvn -B -Dmaven.test.skip=true -DskipTests clean install 30 | 2015-12-01 17:28:41,728 [Worker-2] ERROR o.e.m.c.i.p.ProjectConfigurationManager - Unable to create project from archetype [org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE] 31 | org.apache.maven.archetype.old.ArchetypeTemplateProcessingException: Unable to add module to the current project as it is not of packaging type 'pom' 32 | at org.apache.maven.archetype.old.DefaultOldArchetype.createArchetype(DefaultOldArchetype.java:308) ~[archetype-common-2.0-alpha-4.jar:2.0-alpha-4] 33 | at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.processOldArchetype(DefaultArchetypeGenerator.java:253) ~[archetype-common-2.0-alpha-4.jar:2.0-alpha-4] 34 | at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:143) ~[archetype-common-2.0-alpha-4.jar:2.0-alpha-4] 35 | at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:286) ~[archetype-common-2.0-alpha-4.jar:2.0-alpha-4] 36 | at org.apache.maven.archetype.DefaultArchetype.generateProjectFromArchetype(DefaultArchetype.java:69) ~[archetype-common-2.0-alpha-4.jar:2.0-alpha-4] 37 | at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.createArchetypeProjects0(ProjectConfigurationManager.java:770) [org.eclipse.m2e.core_1.5.0.20140606-0033.jar:na] 38 | at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$5.call(ProjectConfigurationManager.java:719) [org.eclipse.m2e.core_1.5.0.20140606-0033.jar:na] 39 | at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$5.call(ProjectConfigurationManager.java:1) [org.eclipse.m2e.core_1.5.0.20140606-0033.jar:na] 40 | at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:166) [org.eclipse.m2e.core_1.5.0.20140606-0033.jar:na] 41 | at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:142) [org.eclipse.m2e.core_1.5.0.20140606-0033.jar:na] 42 | at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:96) [org.eclipse.m2e.core_1.5.0.20140606-0033.jar:na] 43 | at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1348) [org.eclipse.m2e.core_1.5.0.20140606-0033.jar:na] 44 | at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.createArchetypeProjects(ProjectConfigurationManager.java:717) [org.eclipse.m2e.core_1.5.0.20140606-0033.jar:na] 45 | at org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizard$5.doCreateMavenProjects(MavenProjectWizard.java:244) [org.eclipse.m2e.core.ui_1.5.0.20140606-0033.jar:na] 46 | at org.eclipse.m2e.core.ui.internal.wizards.AbstactCreateMavenProjectJob$1.doCreateMavenProjects(AbstactCreateMavenProjectJob.java:46) [org.eclipse.m2e.core.ui_1.5.0.20140606-0033.jar:na] 47 | at org.eclipse.m2e.core.ui.internal.wizards.AbstractCreateMavenProjectsOperation.run(AbstractCreateMavenProjectsOperation.java:62) [org.eclipse.m2e.core.ui_1.5.0.20140606-0033.jar:na] 48 | at org.eclipse.m2e.core.ui.internal.wizards.AbstactCreateMavenProjectJob.runInWorkspace(AbstactCreateMavenProjectJob.java:50) [org.eclipse.m2e.core.ui_1.5.0.20140606-0033.jar:na] 49 | at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) [org.eclipse.core.resources_3.9.1.v20140825-1431.jar:na] 50 | at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) [org.eclipse.core.jobs_3.6.0.v20140424-0053.jar:na] 51 | 2015-12-01 17:29:51,524 [Worker-2] ERROR o.e.m.c.i.p.ProjectConfigurationManager - Unable to create project from archetype [org.apache.maven.archetypes:maven-archetype-quickstart:RELEASE] 52 | org.apache.maven.archetype.old.ArchetypeTemplateProcessingException: Unable to add module to the current project as it is not of packaging type 'pom' 53 | at org.apache.maven.archetype.old.DefaultOldArchetype.createArchetype(DefaultOldArchetype.java:308) ~[archetype-common-2.0-alpha-4.jar:2.0-alpha-4] 54 | at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.processOldArchetype(DefaultArchetypeGenerator.java:253) ~[archetype-common-2.0-alpha-4.jar:2.0-alpha-4] 55 | at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:143) ~[archetype-common-2.0-alpha-4.jar:2.0-alpha-4] 56 | at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:286) ~[archetype-common-2.0-alpha-4.jar:2.0-alpha-4] 57 | at org.apache.maven.archetype.DefaultArchetype.generateProjectFromArchetype(DefaultArchetype.java:69) ~[archetype-common-2.0-alpha-4.jar:2.0-alpha-4] 58 | at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.createArchetypeProjects0(ProjectConfigurationManager.java:770) [org.eclipse.m2e.core_1.5.0.20140606-0033.jar:na] 59 | at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$5.call(ProjectConfigurationManager.java:719) [org.eclipse.m2e.core_1.5.0.20140606-0033.jar:na] 60 | at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$5.call(ProjectConfigurationManager.java:1) [org.eclipse.m2e.core_1.5.0.20140606-0033.jar:na] 61 | at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:166) [org.eclipse.m2e.core_1.5.0.20140606-0033.jar:na] 62 | at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:142) [org.eclipse.m2e.core_1.5.0.20140606-0033.jar:na] 63 | at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:96) [org.eclipse.m2e.core_1.5.0.20140606-0033.jar:na] 64 | at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1348) [org.eclipse.m2e.core_1.5.0.20140606-0033.jar:na] 65 | at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.createArchetypeProjects(ProjectConfigurationManager.java:717) [org.eclipse.m2e.core_1.5.0.20140606-0033.jar:na] 66 | at org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizard$5.doCreateMavenProjects(MavenProjectWizard.java:244) [org.eclipse.m2e.core.ui_1.5.0.20140606-0033.jar:na] 67 | at org.eclipse.m2e.core.ui.internal.wizards.AbstactCreateMavenProjectJob$1.doCreateMavenProjects(AbstactCreateMavenProjectJob.java:46) [org.eclipse.m2e.core.ui_1.5.0.20140606-0033.jar:na] 68 | at org.eclipse.m2e.core.ui.internal.wizards.AbstractCreateMavenProjectsOperation.run(AbstractCreateMavenProjectsOperation.java:62) [org.eclipse.m2e.core.ui_1.5.0.20140606-0033.jar:na] 69 | at org.eclipse.m2e.core.ui.internal.wizards.AbstactCreateMavenProjectJob.runInWorkspace(AbstactCreateMavenProjectJob.java:50) [org.eclipse.m2e.core.ui_1.5.0.20140606-0033.jar:na] 70 | at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) [org.eclipse.core.resources_3.9.1.v20140825-1431.jar:na] 71 | at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) [org.eclipse.core.jobs_3.6.0.v20140424-0053.jar:na] 72 | -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.5.0.20140606-0033.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %date [%thread] %-5level %logger{35} - %msg%n 5 | 6 | 7 | OFF 8 | 9 | 10 | 11 | 12 | ${org.eclipse.m2e.log.dir}/0.log 13 | 14 | ${org.eclipse.m2e.log.dir}/%i.log 15 | 1 16 | 10 17 | 18 | 19 | 100MB 20 | 21 | 22 | %date [%thread] %-5level %logger{35} - %msg%n 23 | 24 | 25 | 26 | 27 | 28 | WARN 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /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/.plugins/org.eclipse.rse.core/.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.rse.core/.log -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.rse.core/initializerMarks/org.eclipse.rse.internal.core.RSELocalConnectionInitializer.mark: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.rse.core/initializerMarks/org.eclipse.rse.internal.core.RSELocalConnectionInitializer.mark -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.rse.core/profiles/PRF.lap0523_112/FP.local.files_0/node.properties: -------------------------------------------------------------------------------- 1 | # RSE DOM Node 2 | 00-name=LAP0523\:local.files 3 | 01-type=FilterPool 4 | 03-attr.default=true 5 | 03-attr.deletable=true 6 | 03-attr.id=local.files 7 | 03-attr.nonRenamable=false 8 | 03-attr.owningParentName=null 9 | 03-attr.release=200 10 | 03-attr.singleFilterStringOnly=false 11 | 03-attr.singleFilterStringOnlyESet=false 12 | 03-attr.stringsCaseSensitive=true 13 | 03-attr.supportsDuplicateFilterStrings=false 14 | 03-attr.supportsNestedFilters=true 15 | 03-attr.type=default 16 | 06-child.00000.00-name=My Home 17 | 06-child.00000.01-type=Filter 18 | 06-child.00000.03-attr.default=false 19 | 06-child.00000.03-attr.filterType=default 20 | 06-child.00000.03-attr.id=My Home 21 | 06-child.00000.03-attr.nonChangable=false 22 | 06-child.00000.03-attr.nonDeletable=false 23 | 06-child.00000.03-attr.nonRenamable=false 24 | 06-child.00000.03-attr.promptable=false 25 | 06-child.00000.03-attr.relativeOrder=0 26 | 06-child.00000.03-attr.release=200 27 | 06-child.00000.03-attr.singleFilterStringOnly=false 28 | 06-child.00000.03-attr.stringsCaseSensitive=false 29 | 06-child.00000.03-attr.stringsNonChangable=false 30 | 06-child.00000.03-attr.supportsDuplicateFilterStrings=false 31 | 06-child.00000.03-attr.supportsNestedFilters=true 32 | 06-child.00000.06-child.00000.00-name=E\:\\yinwei\\* 33 | 06-child.00000.06-child.00000.01-type=FilterString 34 | 06-child.00000.06-child.00000.03-attr.default=false 35 | 06-child.00000.06-child.00000.03-attr.string=E\:\\yinwei\\* 36 | 06-child.00000.06-child.00000.03-attr.type=default 37 | 06-child.00001.00-name=Drives 38 | 06-child.00001.01-type=Filter 39 | 06-child.00001.03-attr.default=false 40 | 06-child.00001.03-attr.filterType=default 41 | 06-child.00001.03-attr.id=Drives 42 | 06-child.00001.03-attr.nonChangable=false 43 | 06-child.00001.03-attr.nonDeletable=false 44 | 06-child.00001.03-attr.nonRenamable=false 45 | 06-child.00001.03-attr.promptable=false 46 | 06-child.00001.03-attr.relativeOrder=0 47 | 06-child.00001.03-attr.release=200 48 | 06-child.00001.03-attr.singleFilterStringOnly=false 49 | 06-child.00001.03-attr.stringsCaseSensitive=false 50 | 06-child.00001.03-attr.stringsNonChangable=false 51 | 06-child.00001.03-attr.supportsDuplicateFilterStrings=false 52 | 06-child.00001.03-attr.supportsNestedFilters=true 53 | 06-child.00001.06-child.00000.00-name=* 54 | 06-child.00001.06-child.00000.01-type=FilterString 55 | 06-child.00001.06-child.00000.03-attr.default=false 56 | 06-child.00001.06-child.00000.03-attr.string=* 57 | 06-child.00001.06-child.00000.03-attr.type=default 58 | -------------------------------------------------------------------------------- /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/.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.rse.ui/.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.rse.ui/.log -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.ui.ide/dialog_settings.xml: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 5 | 6 |
7 |
8 | 9 | 10 |
11 |
12 | -------------------------------------------------------------------------------- /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 |
16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 24 |
25 |
26 | -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.wst.jsdt.core/externalLibsTimeStamps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tim-yin/api-gateway/5d59851e45c44b5b92f6f4a40a357861b355546b/api-gateway/.metadata/.plugins/org.eclipse.wst.jsdt.core/externalLibsTimeStamps -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/browserWindow.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2008, 2013 IBM Corporation and others. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * IBM Corporation - initial API and implementation 10 | *******************************************************************************/ 11 | function BarProp(){}; 12 | BarProp.prototype = new Array(); 13 | 14 | /** 15 | * Object Window() 16 | * @super Global 17 | * @constructor 18 | * @since Common Usage, no standard 19 | */ 20 | function Window(){}; 21 | Window.prototype = new EventTarget(); 22 | Window.prototype.self = new Window(); 23 | Window.prototype.window = new Window(); 24 | Window.prototype.frames = new Array(); 25 | /** 26 | * Property closed 27 | * @type Boolean 28 | * @memberOf Window 29 | */ 30 | Window.prototype.closed = new Boolean(); 31 | /** 32 | * Property defaultStatus 33 | * @type String 34 | * @memberOf Window 35 | */ 36 | Window.prototype.defaultStatus = ""; 37 | /** 38 | * Property document 39 | * @type Document 40 | * @memberOf Window 41 | */ 42 | Window.prototype.document= new HTMLDocument(); 43 | /** 44 | * Property history 45 | * @type History 46 | * @memberOf Window 47 | */ 48 | Window.prototype.history= new History(); 49 | /** 50 | * Property location 51 | * @type Location 52 | * @memberOf Window 53 | */ 54 | Window.prototype.location=new Location(); 55 | /** 56 | * Property name 57 | * @type String 58 | * @memberOf Window 59 | */ 60 | Window.prototype.name = ""; 61 | /** 62 | * Property navigator 63 | * @type Navigator 64 | * @memberOf Window 65 | */ 66 | Window.prototype.navigator = new Navigator(); 67 | /** 68 | * Property opener 69 | * @type Window 70 | * @memberOf Window 71 | */ 72 | Window.prototype.opener = new Window(); 73 | /** 74 | * Property outerWidth 75 | * @type Number 76 | * @memberOf Window 77 | */ 78 | Window.prototype.outerWidth = 0; 79 | /** 80 | * Property outerHeight 81 | * @type Number 82 | * @memberOf Window 83 | */ 84 | Window.prototype.outerHeight = 0; 85 | /** 86 | * Property pageXOffset 87 | * @type Number 88 | * @memberOf Window 89 | */ 90 | Window.prototype.pageXOffset = 0; 91 | /** 92 | * Property pageYOffset 93 | * @type Number 94 | * @memberOf Window 95 | */ 96 | Window.prototype.pageYOffset = 0; 97 | /** 98 | * Property parent 99 | * @type Window 100 | * @memberOf Window 101 | */ 102 | Window.prototype.parent = new Window(); 103 | /** 104 | * Property screen 105 | * @type Screen 106 | * @memberOf Window 107 | */ 108 | Window.prototype.screen = new Screen(); 109 | /** 110 | * Property status 111 | * @type String 112 | * @memberOf Window 113 | */ 114 | Window.prototype.status = ""; 115 | /** 116 | * Property top 117 | * @type Window 118 | * @memberOf Window 119 | */ 120 | Window.prototype.top = new Window(); 121 | 122 | 123 | /* 124 | * These properties may need to be moved into a browswer specific library. 125 | */ 126 | 127 | /** 128 | * Property innerWidth 129 | * @type Number 130 | * @memberOf Window 131 | */ 132 | Window.prototype.innerWidth = 0; 133 | /** 134 | * Property innerHeight 135 | * @type Number 136 | * @memberOf Window 137 | */ 138 | Window.prototype.innerHeight = 0; 139 | /** 140 | * Property screenX 141 | * @type Number 142 | * @memberOf Window 143 | */ 144 | Window.prototype.screenX = 0; 145 | /** 146 | * Property screenY 147 | * @type Number 148 | * @memberOf Window 149 | */ 150 | Window.prototype.screenY = 0; 151 | /** 152 | * Property screenLeft 153 | * @type Number 154 | * @memberOf Window 155 | */ 156 | Window.prototype.screenLeft = 0; 157 | /** 158 | * Property screenTop 159 | * @type Number 160 | * @memberOf Window 161 | */ 162 | Window.prototype.screenTop = 0; 163 | //Window.prototype.event = new Event(); 164 | Window.prototype.length = 0; 165 | Window.prototype.scrollbars= new BarProp(); 166 | Window.prototype.scrollX=0; 167 | Window.prototype.scrollY=0; 168 | Window.prototype.content= new Window(); 169 | Window.prototype.menubar= new BarProp(); 170 | Window.prototype.toolbar= new BarProp(); 171 | Window.prototype.locationbar= new BarProp(); 172 | Window.prototype.personalbar= new BarProp(); 173 | Window.prototype.statusbar= new BarProp(); 174 | Window.prototype.directories= new BarProp(); 175 | Window.prototype.scrollMaxX=0; 176 | Window.prototype.scrollMaxY=0; 177 | Window.prototype.fullScreen=""; 178 | Window.prototype.frameElement=""; 179 | /* End properites */ 180 | 181 | /** 182 | * function alert() 183 | * @param {String} message 184 | * @memberOf Window 185 | */ 186 | Window.prototype.alert = function(message){}; 187 | /** 188 | * function blur() 189 | * @memberOf Window 190 | */ 191 | Window.prototype.blur = function(){}; 192 | /** 193 | * function clearInterval(intervalID) 194 | * @param intervalID 195 | * @memberOf Window 196 | */ 197 | Window.prototype.clearInterval = function(intervalID){}; 198 | /** 199 | * function clearTimeout(intervalID) 200 | * @param intervalID 201 | * @memberOf Window 202 | */ 203 | Window.prototype.clearTimeout = function(intervalID){}; 204 | /** 205 | * function close() 206 | * @memberOf Window 207 | */ 208 | Window.prototype.close = function(){}; 209 | /** 210 | * function confirm() 211 | * @param {String} arg 212 | * @memberOf Window 213 | * @returns {Boolean} 214 | */ 215 | Window.prototype.confirm = function(arg){return false;}; 216 | /** 217 | * function focus() 218 | * @memberOf Window 219 | */ 220 | Window.prototype.focus = function(){}; 221 | /** 222 | * function getComputedStyle(element, pseudoElt ) 223 | * @param {Element} element 224 | * @param {String} pseudoElt 225 | * @memberOf Window 226 | * @returns {Object} 227 | */ 228 | Window.prototype.getComputedStyle = function(element,pseudoElt ){return new Object();}; 229 | /** 230 | * function moveTo(x, y) 231 | * @param {Number} x 232 | * @param {Number} y 233 | * @memberOf Window 234 | */ 235 | Window.prototype.moveTo = function(x,y){}; 236 | /** 237 | * function moveBy(deltaX, deltaY) 238 | * @param {Number} deltaX 239 | * @param {Number} deltaY 240 | * @memberOf Window 241 | */ 242 | Window.prototype.moveBy = function(deltaX,deltaY){}; 243 | /** 244 | * function open(optionalArg1, optionalArg2, optionalArg3, optionalArg4) 245 | * @param {String} url 246 | * @param {String} windowName 247 | * @param {String} windowFeatures 248 | * @param {Boolean} optionalArg4 249 | * @memberOf Window 250 | * @returns {Window} 251 | */ 252 | Window.prototype.open = function(url, windowName, windowFeatures, optionalArg4){return new Window();}; 253 | /** 254 | * function print() 255 | * @memberOf Window 256 | */ 257 | Window.prototype.print = function(){}; 258 | /** 259 | * function prompt(text, value) 260 | * @param {String} text 261 | * @param {String} value 262 | * @memberOf Window 263 | * @returns {String} 264 | */ 265 | Window.prototype.prompt = function(text, value){return "";}; 266 | /** 267 | * function resizeTo(newOuterWidth,newOuterHeight) 268 | * @param {Number} newOuterWidth 269 | * @param {Number} newOuterHeighr 270 | * @memberOf Window 271 | */ 272 | Window.prototype.resizeTo=function(newOuterWidth,newOuterHeight){}; 273 | /** 274 | * function resizeBy(deltaX, deltaY) 275 | * @param {Number} deltaX 276 | * @param {Number} deltaY 277 | * @memberOf Window 278 | */ 279 | Window.prototype.resizeBy=function(deltaX,deltaY){}; 280 | /** 281 | * function scrollTo(x,y) 282 | * @param {Number} x 283 | * @param {Number} y 284 | * @memberOf Window 285 | */ 286 | Window.prototype.scrollTo=function(x,y){}; 287 | /** 288 | * function scrollBy(pixelX,pixelY) 289 | * @param {Number} pixelX 290 | * @param {Number} pixelY 291 | * @memberOf Window 292 | */ 293 | Window.prototype.scrollBy=function(pixelX,pixelY){}; 294 | /** 295 | * function setInterval(arg1, arg2) 296 | * @param {Function} callback 297 | * @param {Number} delay 298 | * @memberOf Window 299 | * @returns {Number} 300 | */ 301 | Window.prototype.setInterval=function(callback, delay){return 0;}; 302 | /** 303 | * function setTimeout(callback, delay) 304 | * @param {Function} callback 305 | * @param {Number} delay 306 | * @memberOf Window 307 | * @returns {Number} 308 | */ 309 | Window.prototype.setTimeout=function(callback, delay){ return 0;}; 310 | /** 311 | * function atob(encodedData) 312 | * @param {String} encodedData 313 | * @memberOf Window 314 | * @returns {String} 315 | */ 316 | Window.prototype.atob=function(encodedData){return "";}; 317 | /** 318 | * function btoa(arg) 319 | * @param {String} stringToEncode 320 | * @memberOf Window 321 | * @returns {String} 322 | */ 323 | Window.prototype.btoa=function(stringToEncode){return "";}; 324 | /** 325 | * function setResizable(resizable) 326 | * @param {Boolean} resizable 327 | * @memberOf Window 328 | */ 329 | Window.prototype.setResizable=function(resizable){}; 330 | 331 | Window.prototype.captureEvents=function(eventType){}; 332 | Window.prototype.releaseEvents=function(eventType){}; 333 | Window.prototype.routeEvent=function(eventType){}; 334 | Window.prototype.enableExternalCapture=function(){}; 335 | Window.prototype.disableExternalCapture=function(){}; 336 | Window.prototype.find=function(){}; 337 | Window.prototype.back=function(){}; 338 | Window.prototype.forward=function(){}; 339 | Window.prototype.home=function(){}; 340 | Window.prototype.stop=function(){}; 341 | /** 342 | * @param {Number} pixelX 343 | * @param {Number} pixelY 344 | */ 345 | Window.prototype.scroll=function(pixelX,pixelY){}; 346 | /* End functions */ 347 | 348 | /** 349 | * Object History() 350 | * @super Object 351 | * @constructor 352 | * @since Common Usage, no standard 353 | */ 354 | function History(){}; 355 | History.prototype=new Object(); 356 | History.prototype.history = new History(); 357 | /** 358 | * Property length 359 | * @type Number 360 | * @memberOf History 361 | */ 362 | History.prototype.length = 0; 363 | /** 364 | * function back() 365 | * @memberOf History 366 | */ 367 | History.prototype.back = function(){}; 368 | /** 369 | * function forward() 370 | * @memberOf History 371 | */ 372 | History.prototype.forward = function(){}; 373 | /** 374 | * function back() 375 | * @param arg 376 | * @memberOf History 377 | */ 378 | History.prototype.go = function(arg){}; 379 | 380 | /** 381 | * Object Location() 382 | * @super Object 383 | * @constructor 384 | * @since Common Usage, no standard 385 | */ 386 | function Location(){}; 387 | Location.prototype = new Object(); 388 | Location.prototype.location = new Location(); 389 | /** 390 | * Property hash 391 | * @type String 392 | * @memberOf Location 393 | */ 394 | Location.prototype.hash = ""; 395 | /** 396 | * Property host 397 | * @type String 398 | * @memberOf Location 399 | */ 400 | Location.prototype.host = ""; 401 | /** 402 | * Property hostname 403 | * @type String 404 | * @memberOf Location 405 | */ 406 | Location.prototype.hostname = ""; 407 | /** 408 | * Property href 409 | * @type String 410 | * @memberOf Location 411 | */ 412 | Location.prototype.href = ""; 413 | /** 414 | * Property pathname 415 | * @type String 416 | * @memberOf Location 417 | */ 418 | Location.prototype.pathname = ""; 419 | /** 420 | * Property port 421 | * @type String 422 | * @memberOf Location 423 | */ 424 | Location.prototype.port = ""; 425 | /** 426 | * Property protocol 427 | * @type String 428 | * @memberOf Location 429 | */ 430 | Location.prototype.protocol = ""; 431 | /** 432 | * Property search 433 | * @type String 434 | * @memberOf Location 435 | */ 436 | Location.prototype.search = ""; 437 | /** 438 | * function assign(arg) 439 | * @param {String} arg 440 | * @memberOf Location 441 | */ 442 | Location.prototype.assign = function(arg){}; 443 | /** 444 | * function reload(optionalArg) 445 | * @param {Boolean} optionalArg 446 | * @memberOf Location 447 | */ 448 | Location.prototype.reload = function(optionalArg){}; 449 | /** 450 | * function replace(arg) 451 | * @param {String} arg 452 | * @memberOf Location 453 | */ 454 | Location.prototype.replace = function(arg){}; 455 | 456 | /** 457 | * Object Navigator() 458 | * @super Object 459 | * @constructor 460 | * @since Common Usage, no standard 461 | */ 462 | function Navigator(){}; 463 | Navigator.prototype = new Object(); 464 | Navigator.prototype.navigator = new Navigator(); 465 | /** 466 | * Property appCodeName 467 | * @type String 468 | * @memberOf Navigator 469 | */ 470 | Navigator.prototype.appCodeName = ""; 471 | /** 472 | * Property appName 473 | * @type String 474 | * @memberOf Navigator 475 | */ 476 | Navigator.prototype.appName = ""; 477 | /** 478 | * Property appVersion 479 | * @type String 480 | * @memberOf Navigator 481 | */ 482 | Navigator.prototype.appVersion = ""; 483 | /** 484 | * Property cookieEnabled 485 | * @type Boolean 486 | * @memberOf Navigator 487 | */ 488 | Navigator.prototype.cookieEnabled = new Boolean(); 489 | /** 490 | * Property mimeTypes 491 | * @type Array 492 | * @memberOf Navigator 493 | */ 494 | Navigator.prototype.mimeTypes = new Array(); 495 | /** 496 | * Property platform 497 | * @type String 498 | * @memberOf Navigator 499 | */ 500 | Navigator.prototype.platform = ""; 501 | /** 502 | * Property plugins 503 | * @type Array 504 | * @memberOf Navigator 505 | */ 506 | Navigator.prototype.plugins = new Array(); 507 | /** 508 | * Property userAgent 509 | * @type String 510 | * @memberOf Navigator 511 | */ 512 | Navigator.prototype.userAgent = ""; 513 | /** 514 | * function javaEnabled() 515 | * @returns {Boolean} 516 | * @memberOf Navigator 517 | */ 518 | Navigator.prototype.javaEnabled = function(){return false;}; 519 | 520 | /** 521 | * Object Screen() 522 | * @super Object 523 | * @constructor 524 | * @since Common Usage, no standard 525 | */ 526 | function Screen(){}; 527 | Screen.prototype = new Object(); 528 | Screen.prototype.screen = new Screen(); 529 | /** 530 | * Property availHeight 531 | * @type Number 532 | * @memberOf Screen 533 | */ 534 | Navigator.prototype.availHeight = 0; 535 | /** 536 | * Property availWidth 537 | * @type Number 538 | * @memberOf Screen 539 | */ 540 | Navigator.prototype.availWidth = 0; 541 | /** 542 | * Property colorDepth 543 | * @type Number 544 | * @memberOf Screen 545 | */ 546 | Navigator.prototype.colorDepth = 0; 547 | /** 548 | * Property height 549 | * @type Number 550 | * @memberOf Screen 551 | */ 552 | Navigator.prototype.height = 0; 553 | /** 554 | * Property width 555 | * @type Number 556 | * @memberOf Screen 557 | */ 558 | Navigator.prototype.width = 0; 559 | 560 | Event.prototype=new Object(); 561 | // PhaseType 562 | Event.prototype.CAPTURING_PHASE = 1; 563 | Event.prototype.AT_TARGET = 2; 564 | Event.prototype.BUBBLING_PHASE = 3; 565 | 566 | Event.prototype.type=""; 567 | Event.prototype.target=new EventTarget(); 568 | Event.prototype.currentTarget=new EventTarget(); 569 | Event.prototype.eventPhase=0; 570 | Event.prototype.bubbles=false; 571 | Event.prototype.cancelable=false; 572 | Event.prototype.timeStamp=0; 573 | Event.prototype.stopPropagation=function(){}; 574 | Event.prototype.preventDefault=function(){}; 575 | /** 576 | * @param {String} eventTypeArg 577 | * @param {Boolean} canBubbleArg 578 | * @param {Boolean} cancelableArg 579 | */ 580 | Event.prototype.initEvent=function(eventTypeArg, 581 | canBubbleArg, 582 | cancelableArg){}; 583 | function EventListener(){}; 584 | EventListener.prototype=new Object(); 585 | /** 586 | * @param {Event} event 587 | * @memberOf EventListener 588 | */ 589 | EventListener.prototype.handleEvent=function(event){}; 590 | 591 | function EventTarget(){}; 592 | EventTarget.prototype=new Object(); 593 | /* 594 | * These functions may need to be moved into a browser specific library. 595 | */ 596 | /** 597 | * @memberOf Window 598 | * @param event {Event} 599 | * @throws {EventException} 600 | */ 601 | EventTarget.prototype.dispatchEvent=function(event){}; 602 | 603 | // https://developer.mozilla.org/en-US/docs/DOM/element.addEventListener 604 | /** 605 | * @memberOf Window 606 | * @param {String} type 607 | * @param {EventListener} listener 608 | * @param {Boolean} useCapture 609 | */ 610 | EventTarget.prototype.addEventListener=function(type, listener, useCapture){}; 611 | // https://developer.mozilla.org/en-US/docs/DOM/element.removeEventListener 612 | /** 613 | * @memberOf Window 614 | * @param {String} type 615 | * @param {EventListener} listener 616 | * @param {Boolean} useCapture 617 | */ 618 | EventTarget.prototype.removeEventListener=function(type, listener, useCapture){}; 619 | -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/dom5.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2013 IBM Corporation and others. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * IBM Corporation - initial API and implementation 10 | ******************************************************************************/ 11 | 12 | /** 13 | * function querySelector(selectors) 14 | * http://www.w3.org/TR/2012/PR-selectors-api-20121213 15 | * @param {String} selectors 16 | * @memberOf Document 17 | * @returns {Element} 18 | */ 19 | Document.prototype.querySelector=function(selectors){return new Element();}; 20 | 21 | /** 22 | * function querySelectorAll(selectors) 23 | * http://www.w3.org/TR/2012/PR-selectors-api-20121213 24 | * @param {String} selectors 25 | * @memberOf Document 26 | * @returns {NodeList} 27 | */ 28 | Document.prototype.querySelectorAll=function(selectors){return new NodeList();}; 29 | 30 | /** 31 | * function querySelector(selectors) 32 | * http://www.w3.org/TR/2012/PR-selectors-api-20121213 33 | * @param {String} selectors 34 | * @memberOf DocumentFragment 35 | * @returns {Element} 36 | */ 37 | DocumentFragment.prototype.querySelector=function(selectors){return new Element();}; 38 | 39 | /** 40 | * function querySelectorAll(selectors) 41 | * http://www.w3.org/TR/2012/PR-selectors-api-20121213 42 | * @param {String} selectors 43 | * @memberOf DocumentFragment 44 | * @returns {NodeList} 45 | */ 46 | DocumentFragment.prototype.querySelectorAll=function(selectors){return new NodeList();}; 47 | 48 | /** 49 | * function querySelector(selectors) 50 | * http://www.w3.org/TR/2012/PR-selectors-api-20121213 51 | * @param {String} selectors 52 | * @memberOf Element 53 | * @returns {Element} 54 | */ 55 | Element.prototype.querySelector=function(selectors){return new Element();}; 56 | 57 | /** 58 | * function querySelectorAll(selectors) 59 | * http://www.w3.org/TR/2012/PR-selectors-api-20121213 60 | * @param {String} selectors 61 | * @memberOf Element 62 | * @returns {NodeList} 63 | */ 64 | Element.prototype.querySelectorAll=function(selectors){return new NodeList();}; 65 | 66 | /** 67 | * Property state 68 | * @type Object 69 | * @memberOf History 70 | */ 71 | History.prototype.state=new Object(); 72 | 73 | /** 74 | * function pushState(data,title,url) 75 | * http://www.w3.org/TR/2012/CR-html5-20121217/browsers.html#history 76 | * @param {Object} data 77 | * @param {String} title 78 | * @param {String} url - optional 79 | * @memberOf History 80 | */ 81 | History.prototype.pushState=function(data,title,url){}; 82 | 83 | /** 84 | * function replaceState(data,title,url) 85 | * http://www.w3.org/TR/2012/CR-html5-20121217/browsers.html#history 86 | * @param {Object} data 87 | * @param {String} title 88 | * @param {String} url - optional 89 | * @memberOf History 90 | */ 91 | History.prototype.replaceState=function(data,title,url){}; 92 | 93 | /** 94 | * Property sessionStorage 95 | * http://www.w3.org/TR/2011/CR-webstorage-20111208 96 | * @type Storage 97 | * @memberOf Window 98 | */ 99 | Window.prototype.sessionStorage=new Storage(); 100 | 101 | /** 102 | * Property localStorage 103 | * http://www.w3.org/TR/2011/CR-webstorage-20111208 104 | * @type Storage 105 | * @memberOf Window 106 | */ 107 | Window.prototype.localStorage=new Storage(); 108 | 109 | /** 110 | * Object Storage 111 | * http://www.w3.org/TR/2011/CR-webstorage-20111208 112 | */ 113 | function Storage(){}; 114 | Storage.prototype=new Object(); 115 | 116 | /** 117 | * Property length 118 | * http://www.w3.org/TR/2011/CR-webstorage-20111208 119 | * @type Number 120 | * @memberOf Storage 121 | */ 122 | Storage.prototype.length=new Number(); 123 | 124 | /** 125 | * function key(index) 126 | * http://www.w3.org/TR/2011/CR-webstorage-20111208 127 | * @param {Number} index 128 | * @memberOf Storage 129 | * @returns String 130 | */ 131 | Storage.prototype.key=function(index){return new String();}; 132 | 133 | /** 134 | * function getItem(key) 135 | * http://www.w3.org/TR/2011/CR-webstorage-20111208 136 | * @param {String} key 137 | * @memberOf Storage 138 | * @returns String 139 | */ 140 | Storage.prototype.getItem=function(key){return new String();}; 141 | 142 | /** 143 | * function setItem(key,value) 144 | * http://www.w3.org/TR/2011/CR-webstorage-20111208 145 | * @param {String} key 146 | * @param {String} value 147 | * @memberOf Storage 148 | */ 149 | Storage.prototype.setItem=function(key,value){}; 150 | 151 | /** 152 | * function removeItem(key) 153 | * http://www.w3.org/TR/2011/CR-webstorage-20111208 154 | * @param {String} key 155 | * @memberOf Storage 156 | */ 157 | Storage.prototype.removeItem=function(key){}; 158 | 159 | /** 160 | * function clear() 161 | * http://www.w3.org/TR/2011/CR-webstorage-20111208 162 | * @memberOf Storage 163 | */ 164 | Storage.prototype.clear=function(){}; 165 | 166 | /** 167 | * Object WebSocket 168 | * http://www.w3.org/TR/2012/CR-websockets-20120920 169 | * @constructor 170 | * @param {String} url 171 | */ 172 | function WebSocket(url){}; 173 | WebSocket.prototype=new Object(); 174 | 175 | /** 176 | * Constant WebSocket.CONNECTING=0 177 | * http://www.w3.org/TR/2012/CR-websockets-20120920 178 | * @constant 179 | * @type Number 180 | */ 181 | WebSocket.prototype.CONNECTING=0; 182 | 183 | /** 184 | * Constant WebSocket.OPEN=1 185 | * http://www.w3.org/TR/2012/CR-websockets-20120920 186 | * @constant 187 | * @type Number 188 | */ 189 | WebSocket.prototype.OPEN=1; 190 | 191 | /** 192 | * Constant WebSocket.CLOSING=2 193 | * http://www.w3.org/TR/2012/CR-websockets-20120920 194 | * @constant 195 | * @type Number 196 | */ 197 | WebSocket.prototype.CLOSING=2; 198 | 199 | /** 200 | * Constant WebSocket.CLOSED=3 201 | * http://www.w3.org/TR/2012/CR-websockets-20120920 202 | * @constant 203 | * @type Number 204 | */ 205 | WebSocket.prototype.CLOSED=3; 206 | 207 | /** 208 | * Property url 209 | * http://www.w3.org/TR/2012/CR-websockets-20120920 210 | * @type String 211 | * @memberOf WebSocket 212 | */ 213 | WebSocket.prototype.url=new String(); 214 | 215 | /** 216 | * Property readyState 217 | * http://www.w3.org/TR/2012/CR-websockets-20120920 218 | * @type Number 219 | * @memberOf WebSocket 220 | */ 221 | WebSocket.prototype.readyState=new Number(); 222 | 223 | /** 224 | * Property bufferedAmount 225 | * http://www.w3.org/TR/2012/CR-websockets-20120920 226 | * @type Number 227 | * @memberOf WebSocket 228 | */ 229 | WebSocket.prototype.bufferedAmount=new Number(); 230 | 231 | /** 232 | * Property extensions 233 | * http://www.w3.org/TR/2012/CR-websockets-20120920 234 | * @type String 235 | * @memberOf WebSocket 236 | */ 237 | WebSocket.prototype.extensions=new String(); 238 | 239 | /** 240 | * Property protocol 241 | * http://www.w3.org/TR/2012/CR-websockets-20120920 242 | * @type String 243 | * @memberOf WebSocket 244 | */ 245 | WebSocket.prototype.protocol=new String(); 246 | 247 | /** 248 | * Property binaryType 249 | * http://www.w3.org/TR/2012/CR-websockets-20120920 250 | * @type String 251 | * @memberOf WebSocket 252 | */ 253 | WebSocket.prototype.binaryType=new String(); 254 | 255 | /** 256 | * function close(code,reason) 257 | * http://www.w3.org/TR/2012/CR-websockets-20120920 258 | * @param {Number} code - optional 259 | * @param {String} reason - optional 260 | * @memberOf WebSocket 261 | */ 262 | WebSocket.prototype.close=function(code,reason){}; 263 | 264 | /** 265 | * function send(data) 266 | * http://www.w3.org/TR/2012/CR-websockets-20120920 267 | * @param {Object} data - may be a String, Blob, ArrayBuffer, or ArrayBufferView 268 | * @memberOf WebSocket 269 | */ 270 | WebSocket.prototype.send=function(data){}; 271 | 272 | /** 273 | * Property geolocation 274 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 275 | * @type Geolocation 276 | * @memberOf Navigator 277 | */ 278 | Navigator.prototype.geolocation=new Geolocation(); 279 | 280 | /** 281 | * Object Geolocation 282 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 283 | */ 284 | function Geolocation(){}; 285 | Geolocation.prototype=new Object(); 286 | 287 | /** 288 | * function getCurrentPosition(successCallback,errorCallback,options) 289 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510/ 290 | * @param {Function} successCallback (Position pos) 291 | * @param {Function} errorCallback (PositionError error) - optional 292 | * @param {PositionOptions} options - optional 293 | * @memberOf Geolocation 294 | */ 295 | Geolocation.prototype.getCurrentPosition=function(successCallback,errorCallback,options){}; 296 | 297 | /** 298 | * function watchPosition(successCallback,errorCallback,options) 299 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510/ 300 | * @param {Function} successCallback (Position pos) 301 | * @param {Function} errorCallback (PositionError error) - optional 302 | * @param {PositionOptions} options - optional 303 | * @memberOf Geolocation 304 | * @returns {Number} 305 | */ 306 | Geolocation.prototype.watchPosition=function(successCallback,errorCallback,options){return new Number();}; 307 | 308 | /** 309 | * function clearWatch(watchId) 310 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 311 | * @param {Number} watchId 312 | * @memberOf Geolocation 313 | */ 314 | Geolocation.prototype.clearWatch=function(watchId){}; 315 | 316 | /** 317 | * Object Coordinates 318 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 319 | */ 320 | function Coordinates(){}; 321 | Coordinates.prototype=new Object(); 322 | 323 | /** 324 | * Property latitude 325 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 326 | * @type Number 327 | * @memberOf Coordinates 328 | */ 329 | Coordinates.prototype.latitude=new Number();; 330 | 331 | /** 332 | * Property longitude 333 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 334 | * @type Number 335 | * @memberOf Coordinates 336 | */ 337 | Coordinates.prototype.longitude=new Number();; 338 | 339 | /** 340 | * Property altitude 341 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 342 | * @type Number 343 | * @memberOf Coordinates 344 | */ 345 | Coordinates.prototype.altitude=new Number();; 346 | 347 | /** 348 | * Property accuracy 349 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 350 | * @type Number 351 | * @memberOf Coordinates 352 | */ 353 | Coordinates.prototype.accuracy=new Number();; 354 | 355 | /** 356 | * Property altitudeAccuracy 357 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 358 | * @type Number 359 | * @memberOf Coordinates 360 | */ 361 | Coordinates.prototype.altitudeAccuracy=new Number();; 362 | 363 | /** 364 | * Property heading 365 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 366 | * @type Number 367 | * @memberOf Coordinates 368 | */ 369 | Coordinates.prototype.heading=new Number();; 370 | 371 | /** 372 | * Property speed 373 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 374 | * @type Number 375 | * @memberOf Coordinates 376 | */ 377 | Coordinates.prototype.speed=new Number(); 378 | 379 | /** 380 | * Object Position 381 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 382 | */ 383 | function Position(){}; 384 | Position.prototype=new Object(); 385 | 386 | /** 387 | * Property coords 388 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 389 | * @type Coordinates 390 | * @memberOf Position 391 | */ 392 | Position.prototype.coords=new Coordinates(); 393 | 394 | /** 395 | * Property timestamp 396 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 397 | * @type Number 398 | * @memberOf Position 399 | */ 400 | Position.prototype.timestamp=new Number; 401 | 402 | /** 403 | * Object PositionError 404 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 405 | */ 406 | function PositionError(){}; 407 | PositionError.prototype=new Object(); 408 | 409 | /** 410 | * Constant PositionError.PERMISSION_DENIED=1 411 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 412 | * @constant 413 | * @type Number 414 | */ 415 | PositionError.prototype.PERMISSION_DENIED=1; 416 | 417 | /** 418 | * Constant PositionError.POSITION_UNAVAILABLE=2 419 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 420 | * @constant 421 | * @type Number 422 | */ 423 | PositionError.prototype.POSITION_UNAVAILABLE=2; 424 | 425 | /** 426 | * Constant PositionError.TIMEOUT=3 427 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 428 | * @constant 429 | * @type Number 430 | */ 431 | PositionError.prototype.TIMEOUT=3; 432 | 433 | /** 434 | * Property code 435 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 436 | * @type Number 437 | * @memberOf PositionError 438 | */ 439 | PositionError.prototype.code=new Number(); 440 | 441 | /** 442 | * Property message 443 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 444 | * @type String 445 | * @memberOf PositionError 446 | */ 447 | PositionError.prototype.message=new String(); 448 | 449 | /** 450 | * Object PositionOptions 451 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 452 | */ 453 | function PositionOptions(){}; 454 | PositionOptions.prototype=new Object(); 455 | 456 | /** 457 | * Property enableHighAccuracy 458 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 459 | * @type Boolean 460 | * @memberOf PositionOptions 461 | */ 462 | PositionOptions.prototype.enableHighAccuracy=new Boolean(); 463 | 464 | /** 465 | * Property timeout 466 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 467 | * @type Number 468 | * @memberOf PositionOptions 469 | */ 470 | PositionOptions.prototype.timeout=new Number(); 471 | 472 | /** 473 | * Property maximumAge 474 | * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 475 | * @type Number 476 | * @memberOf PositionOptions 477 | */ 478 | PositionOptions.prototype.maximumAge=new Number(); 479 | 480 | /** 481 | * Object TimeRanges 482 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 483 | */ 484 | function TimeRanges(){}; 485 | TimeRanges.prototype=new Object(); 486 | 487 | /** 488 | * Property length 489 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 490 | * @type Number 491 | * @memberOf TimeRanges 492 | */ 493 | TimeRanges.prototype.length=new Number(); 494 | 495 | /** 496 | * function start(index) 497 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 498 | * @param {Number} index 499 | * @memberOf TimeRanges 500 | * @returns {Number} 501 | */ 502 | function start(index) {return new Number();}; 503 | 504 | /** 505 | * function end(index) 506 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 507 | * @param {Number} index 508 | * @memberOf TimeRanges 509 | * @returns {Number} 510 | */ 511 | function end(index) {return new Number();}; 512 | 513 | /** 514 | * Object MediaError 515 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 516 | */ 517 | function MediaError(){}; 518 | MediaError.prototype=new Object(); 519 | 520 | /** 521 | * Constant MediaError.MEDIA_ERR_ABORTED=1 522 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 523 | * @constant 524 | * @type Number 525 | */ 526 | MediaError.prototype.MEDIA_ERR_ABORTED=1; 527 | 528 | /** 529 | * Constant MediaError.MEDIA_ERR_NETWORK=2 530 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 531 | * @constant 532 | * @type Number 533 | */ 534 | MediaError.prototype.MEDIA_ERR_NETWORK=2; 535 | 536 | /** 537 | * Constant MediaError.MEDIA_ERR_DECODED=3 538 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 539 | * @constant 540 | * @type Number 541 | */ 542 | MediaError.prototype.MEDIA_ERR_DECODE=3; 543 | 544 | /** 545 | * Constant MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED=4 546 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 547 | * @constant 548 | * @type Number 549 | */ 550 | MediaError.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4; 551 | 552 | /** 553 | * Property code 554 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 555 | * @type Number 556 | * @memberOf MediaError 557 | */ 558 | MediaError.prototype.code=new Number(); 559 | 560 | /** 561 | * Object HTMLMediaElement 562 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 563 | * @augments HTMLElement 564 | * @see HTMLElement 565 | */ 566 | function HTMLMediaElement(){}; 567 | HTMLMediaElement.prototype = new HTMLElement(); 568 | 569 | /** 570 | * Property src 571 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 572 | * @type String 573 | * @memberOf HTMLMediaElement 574 | */ 575 | HTMLMediaElement.prototype.src=new String(); 576 | 577 | /** 578 | * Property currentSrc 579 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 580 | * @type String 581 | * @memberOf HTMLMediaElement 582 | */ 583 | HTMLMediaElement.prototype.currentSrc=new String(); 584 | 585 | /** 586 | * Property crossOrigin 587 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 588 | * @type String 589 | * @memberOf HTMLMediaElement 590 | */ 591 | HTMLMediaElement.prototype.crossOrigin=new String(); 592 | 593 | /** 594 | * Constant HTMLMediaElement.NETWORK_EMPTY=0 595 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 596 | * @constant 597 | * @type Number 598 | */ 599 | HTMLMediaElement.prototype.NETWORK_EMPTY=0; 600 | 601 | /** 602 | * Constant HTMLMediaElement.NETWORK_IDLE=1 603 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 604 | * @constant 605 | * @type Number 606 | */ 607 | HTMLMediaElement.prototype.NETWORK_IDLE=1; 608 | 609 | /** 610 | * Constant HTMLMediaElement.NETWORK_LOADING=2 611 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 612 | * @constant 613 | * @type Number 614 | */ 615 | HTMLMediaElement.prototype.NETWORK_LOADING=2; 616 | 617 | /** 618 | * Constant HTMLMediaElement.NETWORK_NO_SOURCE=3 619 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 620 | * @constant 621 | * @type Number 622 | */ 623 | HTMLMediaElement.prototype.NETWORK_NO_SOURCE=3; 624 | 625 | /** 626 | * Property networkState 627 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 628 | * @type Number 629 | * @memberOf HTMLMediaElement 630 | */ 631 | HTMLMediaElement.prototype.networkState=new Number(); 632 | 633 | /** 634 | * Property preload 635 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 636 | * @type String 637 | * @memberOf HTMLMediaElement 638 | */ 639 | HTMLMediaElement.prototype.preload=new String(); 640 | 641 | /** 642 | * Property buffered 643 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 644 | * @type TimeRanges 645 | * @memberOf HTMLMediaElement 646 | */ 647 | HTMLMediaElement.prototype.buffered=new TimeRanges(); 648 | 649 | /** 650 | * function load() 651 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 652 | * @memberOf HTMLMediaElement 653 | */ 654 | HTMLMediaElement.prototype.load=function(){}; 655 | 656 | /** 657 | * function canPlayType(type) 658 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 659 | * @param {String} type 660 | * @memberOf HTMLMediaElement 661 | * @returns {String} 662 | */ 663 | HTMLMediaElement.prototype.canPlayType=function(type){new String();}; 664 | 665 | /** 666 | * Constant HTMLMediaElement.HAVE_NOTHING=0 667 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 668 | * @constant 669 | * @type Number 670 | */ 671 | HTMLMediaElement.prototype.HAVE_NOTHING=0; 672 | 673 | /** 674 | * Constant HTMLMediaElement.HAVE_METADATA=1 675 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 676 | * @constant 677 | * @type Number 678 | */ 679 | HTMLMediaElement.prototype.HAVE_METADATA=1; 680 | 681 | /** 682 | * Constant HTMLMediaElement.HAVE_CURRENT_DATA=2 683 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 684 | * @constant 685 | * @type Number 686 | */ 687 | HTMLMediaElement.prototype.HAVE_CURRENT_DATA=2; 688 | 689 | /** 690 | * Constant HTMLMediaElement.HAVE_FUTURE_DATA=3 691 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 692 | * @constant 693 | * @type Number 694 | */ 695 | HTMLMediaElement.prototype.HAVE_FUTURE_DATA=3; 696 | 697 | /** 698 | * Constant HTMLMediaElement.HAVE_ENOUGH_DATA=4 699 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 700 | * @constant 701 | * @type Number 702 | */ 703 | HTMLMediaElement.prototype.HAVE_ENOUGH_DATA=4; 704 | 705 | /** 706 | * Property readyState 707 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 708 | * @type Number 709 | * @memberOf HTMLMediaElement 710 | */ 711 | HTMLMediaElement.prototype.readyState=new Number(); 712 | 713 | /** 714 | * Property seeking 715 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 716 | * @type Boolean 717 | * @memberOf HTMLMediaElement 718 | */ 719 | HTMLMediaElement.prototype.seeking=new Boolean(); 720 | 721 | /** 722 | * Property currentTime 723 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 724 | * @type Number 725 | * @memberOf HTMLMediaElement 726 | */ 727 | HTMLMediaElement.prototype.currentTime=new Number(); 728 | 729 | /** 730 | * Property initialTime 731 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 732 | * @type Number 733 | * @memberOf HTMLMediaElement 734 | */ 735 | HTMLMediaElement.prototype.initialTime=new Number(); 736 | 737 | /** 738 | * Property duration 739 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 740 | * @type Number 741 | * @memberOf HTMLMediaElement 742 | */ 743 | HTMLMediaElement.prototype.duration=new Number(); 744 | 745 | /** 746 | * Property startOffsetTime 747 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 748 | * @type Date 749 | * @memberOf HTMLMediaElement 750 | */ 751 | HTMLMediaElement.prototype.startOffsetTime=new Date(); 752 | 753 | /** 754 | * Property paused 755 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 756 | * @type Boolean 757 | * @memberOf HTMLMediaElement 758 | */ 759 | HTMLMediaElement.prototype.paused=new Boolean(); 760 | 761 | /** 762 | * Property defaultPlaybackRate 763 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 764 | * @type Number 765 | * @memberOf HTMLMediaElement 766 | */ 767 | HTMLMediaElement.prototype.defaultPlaybackRate=new Number(); 768 | 769 | /** 770 | * Property playbackRate 771 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 772 | * @type Number 773 | * @memberOf HTMLMediaElement 774 | */ 775 | HTMLMediaElement.prototype.playbackRate=new Number(); 776 | 777 | /** 778 | * Property played 779 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 780 | * @type TimeRanges 781 | * @memberOf HTMLMediaElement 782 | */ 783 | HTMLMediaElement.prototype.played=new TimeRanges(); 784 | 785 | /** 786 | * Property seekable 787 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 788 | * @type TimeRanges 789 | * @memberOf HTMLMediaElement 790 | */ 791 | HTMLMediaElement.prototype.seekable=new TimeRanges(); 792 | 793 | /** 794 | * Property ended 795 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 796 | * @type Boolean 797 | * @memberOf HTMLMediaElement 798 | */ 799 | HTMLMediaElement.prototype.ended=new Boolean(); 800 | 801 | /** 802 | * Property autoplay 803 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 804 | * @type Boolean 805 | * @memberOf HTMLMediaElement 806 | */ 807 | HTMLMediaElement.prototype.autoplay=new Boolean(); 808 | 809 | /** 810 | * Property loop 811 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 812 | * @type Boolean 813 | * @memberOf HTMLMediaElement 814 | */ 815 | HTMLMediaElement.prototype.loop=new Boolean(); 816 | 817 | /** 818 | * function play() 819 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 820 | * @memberOf HTMLMediaElement 821 | */ 822 | HTMLMediaElement.prototype.play=function(){}; 823 | 824 | /** 825 | * function pause() 826 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 827 | * @memberOf HTMLMediaElement 828 | */ 829 | HTMLMediaElement.prototype.pause=function(){}; 830 | 831 | /** 832 | * Property controls 833 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 834 | * @type Boolean 835 | * @memberOf HTMLMediaElement 836 | */ 837 | HTMLMediaElement.prototype.controls=new Boolean(); 838 | 839 | /** 840 | * Property volume 841 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 842 | * @type Number 843 | * @memberOf HTMLMediaElement 844 | */ 845 | HTMLMediaElement.prototype.volume=new Number(); 846 | 847 | /** 848 | * Property muted 849 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 850 | * @type Boolean 851 | * @memberOf HTMLMediaElement 852 | */ 853 | HTMLMediaElement.prototype.muted=new Boolean(); 854 | 855 | /** 856 | * Property defaultMuted 857 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 858 | * @type Boolean 859 | * @memberOf HTMLMediaElement 860 | */ 861 | HTMLMediaElement.prototype.defaultMuted=new Boolean(); 862 | 863 | /** 864 | * Object HTMLAudioElement 865 | * http://www.w3.org/TR/2012/WD-html5-20120329/the-audio-element.html 866 | * @augments HTMLMediaElement 867 | * @constructor 868 | * @param {String} src 869 | * @see HTMLMediaElement 870 | */ 871 | function HTMLAudioElement(src){}; 872 | HTMLAudioElement.prototype = new HTMLMediaElement(); 873 | 874 | /** 875 | * Object HTMLVideoElement 876 | * http://www.w3.org/TR/2012/WD-html5-20120329/the-audio-element.html 877 | * @augments HTMLMediaElement 878 | * @see HTMLMediaElement 879 | */ 880 | function HTMLVideoElement(){}; 881 | HTMLVideoElement.prototype = new HTMLMediaElement(); 882 | 883 | /** 884 | * Property width 885 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 886 | * @type Number 887 | * @memberOf HTMLVideoElement 888 | */ 889 | HTMLVideoElement.prototype.width=new Number(); 890 | 891 | /** 892 | * Property height 893 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 894 | * @type Number 895 | * @memberOf HTMLVideoElement 896 | */ 897 | HTMLVideoElement.prototype.height=new Number(); 898 | 899 | /** 900 | * Property videoWidth 901 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 902 | * @type Number 903 | * @memberOf HTMLVideoElement 904 | */ 905 | HTMLVideoElement.prototype.videoWidth=new Number(); 906 | 907 | /** 908 | * Property videoHeight 909 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 910 | * @type Number 911 | * @memberOf HTMLVideoElement 912 | */ 913 | HTMLVideoElement.prototype.videoHeight=new Number(); 914 | 915 | /** 916 | * Property poster 917 | * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html 918 | * @type String 919 | * @memberOf HTMLVideoElement 920 | */ 921 | HTMLVideoElement.prototype.poster=new String(); 922 | 923 | -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/xhr.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2009, 2011 IBM Corporation and others. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * http://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * IBM Corporation - initial API and implementation 10 | ****************************************************************************** 11 | * 12 | * Based on information from https://developer.mozilla.org/En/XMLHttpRequest 13 | * and http://msdn2.microsoft.com/en-us/library/ms533062.aspx 14 | **/ 15 | 16 | /** 17 | * function createRequest 18 | * @type XMLHttpRequest 19 | * @memberOf Window 20 | */ 21 | Window.prototype.createRequest= function(){return new XMLHttpRequest();}; 22 | /** 23 | * Object XMLHttpRequest 24 | * @type constructor 25 | */ 26 | XMLHttpRequest.prototype=new Object(); 27 | function XMLHttpRequest(){}; 28 | 29 | /** 30 | * function onreadystatechange 31 | * @memberOf XMLHttpRequest 32 | */ 33 | XMLHttpRequest.prototype.onreadystatechange=function(){}; 34 | /** 35 | * property readyState 36 | * @type Number 37 | * @memberOf XMLHttpRequest 38 | */ 39 | XMLHttpRequest.prototype.readyState=0; 40 | /** 41 | * property responseText 42 | * @type String 43 | * @memberOf XMLHttpRequest 44 | */ 45 | XMLHttpRequest.prototype.responseText=""; 46 | /** 47 | * property responseXML 48 | * @type Document 49 | * @memberOf XMLHttpRequest 50 | */ 51 | XMLHttpRequest.prototype.responseXML=new Document(); 52 | /** 53 | * property status 54 | * @type Number 55 | * @memberOf XMLHttpRequest 56 | */ 57 | XMLHttpRequest.prototype.status=0; 58 | /** 59 | * property statusText 60 | * @type String 61 | * @memberOf XMLHttpRequest 62 | */ 63 | XMLHttpRequest.prototype.statusText=""; 64 | /** 65 | * function abort() 66 | * @memberOf XMLHttpRequest 67 | */ 68 | XMLHttpRequest.prototype.abort=function(){}; 69 | /** 70 | * function getAllResponseHeaders() 71 | * @type String 72 | * @memberOf XMLHttpRequest 73 | */ 74 | XMLHttpRequest.prototype.getAllResponseHeaders=function(){return "";}; 75 | /** 76 | * function open(method, url, async, username, password) 77 | * @param {String} method 78 | * @param {String} url 79 | * @param {Boolean} optional async 80 | * @param {String} optional username 81 | * @param {String} optional password 82 | * @memberOf XMLHttpRequest 83 | */ 84 | XMLHttpRequest.prototype.open=function(method, url, async, username, password){}; 85 | /** 86 | * function send(body) 87 | * @param {Object} body 88 | * @memberOf XMLHttpRequest 89 | */ 90 | XMLHttpRequest.prototype.send=function(body){}; 91 | /** 92 | * function setRequestHeader(header,value) 93 | * @param {String} header 94 | * @param {String} value 95 | * @memberOf XMLHttpRequest 96 | */ 97 | XMLHttpRequest.prototype.setRequestHeader=function(header,value){}; 98 | /** 99 | * function getAllResponseHeaders() 100 | * @param {String} header 101 | * @type String 102 | * @memberOf XMLHttpRequest 103 | */ 104 | XMLHttpRequest.prototype.getResponseHeader=function(header){return "";}; 105 | -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.wst.jsdt.core/variablesAndContainers.dat: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.wst.jsdt.ui/OpenTypeHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /api-gateway/.metadata/.plugins/org.eclipse.wst.jsdt.ui/QualifiedTypeNameHistory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /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/.metadata/.plugins/org.tigris.subversion.subclipse.ui/dialog_settings.xml: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | -------------------------------------------------------------------------------- /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/README.markdown: -------------------------------------------------------------------------------- 1 | # 配置 2 | 1.application.properties 3 | 4 | 1.1 内嵌 server 启动端口 5 | 1.2 调用 后台聚合服务的 协调器 zookeeper 地址 6 | 1.3 日志信息 7 | 8 | 2.routeRule.properties 9 | 主要放置 uri 对应 后台聚合服务的 映射文件 10 | 唯一确定前端请求: interface_version + uri + requestMethod 11 | 唯一确定后台聚合服务: group + interface + method + version 12 | 13 | 入参 多基本类型参数支持 在配置文件配置 serviceEnumInput: 14 | e.g: 15 | { 16 | "uri":"dashboard.test", 17 | "requestMethod":"get", 18 | "serviceInterfaceName": "com.niwodai.fortune.endpoint.MockAggregationServiceApi", 19 | "serviceMethod":"testNormalType", 20 | "serviceVersion":"v1.0", 21 | "serviceEnumInput":"id,address" 22 | } 23 | 24 | 入参 inputDto 配置: 25 | e.g: 26 | { 27 | "uri":"dashboard.login", 28 | "requestMethod":"get", 29 | "serviceInterfaceName": "com.niwodai.fortune.endpoint.MockAggregationServiceApi2", 30 | "serviceMethod":"acquireData2", 31 | "serviceVersion":"v1.0", 32 | "serviceInputDto":"com.niwodai.fortune.endpoint.impl.Product" 33 | } 34 | 35 | 入参 无参或者map 结构的配置 入参啥都不用配置后台自动识别: 36 | e.g: 37 | { 38 | "uri":"dashboard.login", 39 | "requestMethod":"get", 40 | "serviceInterfaceName": "com.niwodai.fortune.endpoint.MockAggregationServiceApi2", 41 | "serviceMethod":"acquireData2", 42 | "serviceVersion":"v1.0" 43 | } 44 | 45 | 46 | 47 | 例子 url:http://localhost:8089/dashboard/product?name=yin&age=18 48 | 这里uri资源配资成 dashboard.product 用"."做分割 49 | 后面 uri 和 requestMethod 做联合key 也是用的"."做连接 50 | 比如这里就是 dashboard.product.get 作为前台唯一key 对应后台唯一聚合服务 51 | 52 | 3. spring-metrics.xml 放置的是api接口度量配置-主要使用了metrics-spring (目前这种自动配置度量方式放弃) 53 | 可以查看metries 入口: RestApiTimerManager.java 54 | 目前策略是打印到目录 /opt/metrics 下会生成对应 csv文件 以10分钟一次的频率做写入 55 | 56 | 4.exception 可以做自定义扩展 57 | 加一类自定义异常,只要添加2个文件 参考 : 58 | BusinessException.java 59 | BusinessExceptionResponseBuilder.java 60 | 同时在 OpenApiHandlerExceptionResolver 类里添加 注册 61 | 参考:L42 add(new BusinessExceptionResponseBuilder()); 62 | 63 | 64 | 5.目前业务验签 做成了chain handler 随业务变化可随意扩展 65 | 参考 入口:Validator.java 66 | 必填参数:"app_version","version", "interface_version", "channel", "current_time", "sign" 67 | 68 | -------------------------------------------------------------------------------- /api-gateway/api-gateway.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /api-gateway/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.fly.app 6 | api-gateway 7 | 0.0.1-SNAPSHOT 8 | jar 9 | 10 | nwd-api-gateway 11 | http://maven.apache.org 12 | 13 | 14 | 15 | fly 16 | http://www.fly.com/ 17 | 18 | 19 | 20 | 21 | tim.yin 22 | 尹伟 23 | yinwei19850707@gmail.com 24 | 25 | 26 | 27 | 28 | UTF-8 29 | 30 | com.fly.app.gateway.ApplicationBootstrap 31 | 3.1 32 | 18.0 33 | 1.6.6 34 | 4.12 35 | 1.2.6.RELEASE 36 | 2.8.4 37 | 3.4.6 38 | 2.5.0 39 | 3.1.2 40 | 1.1.0.Final 41 | 1.7 42 | 1.0.0 43 | 1.2.3 44 | 45 | 46 | 47 | 48 | org.springframework.boot 49 | spring-boot-starter-parent 50 | 1.2.5.RELEASE 51 | 52 | 53 | 54 | 55 | 56 | org.springframework.boot 57 | spring-boot-starter-web 58 | 59 | 60 | 61 | 62 | org.springframework.boot 63 | spring-boot-starter-logging 64 | 65 | 66 | 67 | org.springframework.boot 68 | spring-boot-starter-jdbc 69 | 70 | 71 | 72 | 73 | com.alibaba 74 | dubbo 75 | ${dubbox.version} 76 | 77 | 78 | org.springframework 79 | spring 80 | 81 | 82 | commons-logging 83 | commons-logging 84 | 85 | 86 | 87 | org.freemarker 88 | freemarker 89 | 90 | 91 | 92 | 93 | log4j 94 | log4j 95 | 96 | 97 | slf4j-log4j12 98 | org.slf4j 99 | 100 | 101 | slf4j-api 102 | org.slf4j 103 | 104 | 105 | 106 | 107 | 108 | 109 | org.apache.zookeeper 110 | zookeeper 111 | ${zookeeper.version} 112 | 113 | 114 | org.slf4j 115 | slf4j-log4j12 116 | 117 | 118 | 119 | 120 | 121 | 122 | org.apache.curator 123 | curator-framework 124 | ${curator.framework.version} 125 | runtime 126 | 127 | 128 | 129 | 130 | org.apache.commons 131 | commons-lang3 132 | ${org.apache.commons} 133 | 134 | 135 | 136 | 137 | 138 | com.google.guava 139 | guava 140 | ${guava.version} 141 | 142 | 143 | 144 | 145 | javax.validation 146 | validation-api 147 | ${validation.api.version} 148 | 149 | 150 | 151 | com.ryantenney.metrics 152 | metrics-spring 153 | ${metrics.version} 154 | 155 | 156 | 157 | 158 | org.apache.oltu.oauth2 159 | org.apache.oltu.oauth2.authzserver 160 | ${oltu.version} 161 | 162 | 163 | 164 | 165 | org.apache.shiro 166 | shiro-core 167 | ${shiro.version} 168 | 169 | 170 | org.apache.shiro 171 | shiro-web 172 | ${shiro.version} 173 | 174 | 175 | org.apache.shiro 176 | shiro-spring 177 | ${shiro.version} 178 | 179 | 180 | mysql 181 | mysql-connector-java 182 | 5.1.25 183 | 184 | 185 | com.alibaba 186 | druid 187 | 0.2.23 188 | 189 | 190 | 191 | 192 | com.sdicons.jsontools 193 | jsontools-core 194 | ${com.sdicons.jsontools.version} 195 | 196 | 197 | 198 | 199 | 200 | 201 | org.springframework.boot 202 | spring-boot-maven-plugin 203 | 204 | 205 | 206 | -------------------------------------------------------------------------------- /api-gateway/src/main/java/com/fly/app/gateway/ApplicationBootstrap.java: -------------------------------------------------------------------------------- 1 | package com.fly.app.gateway; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 6 | import org.springframework.context.annotation.ComponentScan; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.springframework.context.annotation.ImportResource; 9 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 10 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 11 | 12 | import com.fly.app.gateway.security.common_validator.ValidatorInterceptor; 13 | 14 | /** 15 | * @author tim.yin 16 | * @date 2015年11月28日 下午4:28:03 17 | * @version 1.0 18 | * @Description:app-gateway 启动类. 19 | */ 20 | 21 | @Configuration 22 | @ComponentScan(basePackages = "com.fly.app.gateway") 23 | @EnableAutoConfiguration 24 | // 加入spring的bean的xml文件 25 | @ImportResource({ "classpath*:/spring/*.xml" }) 26 | public class ApplicationBootstrap extends WebMvcConfigurerAdapter { 27 | 28 | @Autowired 29 | ValidatorInterceptor validatorInterceptor; 30 | 31 | public static void main(String[] args) throws Exception { 32 | SpringApplication.run(ApplicationBootstrap.class, args); 33 | } 34 | 35 | /** 36 | * 配置数据验签拦截器 37 | */ 38 | public void addInterceptors(InterceptorRegistry registry) { 39 | registry.addInterceptor(validatorInterceptor).addPathPatterns("/**"); 40 | } 41 | 42 | /* 43 | * 过滤 pojo 属性里面的null 属性 44 | * 45 | * @Bean public HttpMessageConverters customConverters() { ObjectMapper 46 | * jsonNullConvertToEmpty = new JsonNullConvertToEmpty(); 47 | * HttpMessageConverter additional = new 48 | * MappingJackson2HttpMessageConverter( jsonNullConvertToEmpty); return new 49 | * HttpMessageConverters(additional); } 50 | */ 51 | 52 | /* 53 | * @Override public void addResourceHandlers(ResourceHandlerRegistry 54 | * registry) { super.addResourceHandlers(registry); 55 | * registry.addResourceHandler("/**").addResourceLocations( 56 | * "classpath:/spring/routeRule.properties"); } 57 | */ 58 | } -------------------------------------------------------------------------------- /api-gateway/src/main/java/com/fly/app/gateway/controller/RestEndpoint.java: -------------------------------------------------------------------------------- 1 | package com.fly.app.gateway.controller; 2 | 3 | import java.util.Map; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpServletResponse; 7 | 8 | import org.apache.commons.lang3.StringUtils; 9 | import org.slf4j.Logger; 10 | import org.slf4j.LoggerFactory; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.http.MediaType; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | import org.springframework.web.bind.annotation.RestController; 15 | 16 | import com.fly.app.gateway.metrics.RestApiTimerManager; 17 | import com.fly.app.gateway.remote.call.DubboRemoteCall; 18 | import com.fly.app.gateway.reqest.parse.RequestParse; 19 | import com.fly.app.gateway.reqest.parse.utils.StringToEnumConverterFactory; 20 | import com.fly.app.gateway.route.RegisterService; 21 | import com.fly.app.gateway.route.dto.UniqueServiceDefined; 22 | import com.sdicons.json.mapper.JSONMapper; 23 | import com.sdicons.json.mapper.MapperException; 24 | 25 | /** 26 | * @author tim.yin 27 | * @date 2015年11月28日 下午4:32:52 28 | * @version 1.0 29 | * @Description:open api gateway 的Restful 触点 30 | */ 31 | 32 | @RestController 33 | public class RestEndpoint { 34 | 35 | private static Logger logger = LoggerFactory.getLogger(RestEndpoint.class); 36 | 37 | @Autowired 38 | private RequestParse requestParse; 39 | 40 | @Autowired 41 | StringToEnumConverterFactory stringToEnumConverterFactory; 42 | 43 | @Autowired 44 | private RegisterService registerService; 45 | 46 | @Autowired 47 | private DubboRemoteCall dubboRemoteCall; 48 | 49 | @RequestMapping(value = "/register") 50 | public void register(HttpServletRequest request, 51 | HttpServletResponse response) { 52 | 53 | try { 54 | registerService 55 | .register( 56 | "dashboard.create.get", 57 | new UniqueServiceDefined( 58 | "", 59 | "com.fly.fortune.endpoint.MockAggregationServiceApi", 60 | "1.0", 61 | "createRecord", 62 | "com.fly.fortune.endpoint.impl.Product", 63 | "")); 64 | } catch (ClassNotFoundException e) { 65 | // TODO Auto-generated catch block 66 | e.printStackTrace(); 67 | } 68 | 69 | } 70 | 71 | @SuppressWarnings({ "unchecked", "rawtypes" }) 72 | @RequestMapping(produces = { MediaType.APPLICATION_JSON_VALUE }) 73 | public Object entry(HttpServletRequest request, HttpServletResponse response) 74 | throws Exception { 75 | 76 | Object result = new Object(); 77 | 78 | Map params = requestParse.convertRequestParam(request); 79 | 80 | try { 81 | String inputParamValue = JSONMapper.toJSON(params).render(true); 82 | logger.info("前端输入:" + inputParamValue); 83 | } catch (MapperException e) { 84 | // TODO Auto-generated catch block 85 | e.printStackTrace(); 86 | } 87 | 88 | // XXX 这里对 请求参数的加工 需要抽取出去 89 | String uniqueUri = (String) params.get("interface_version") 90 | + StringUtils.replace(request.getRequestURI(), "/", ".") + "." 91 | + request.getMethod().toLowerCase(); 92 | 93 | // uniqueUri = uniqueUri.substring(1, uniqueUri.length()); 94 | 95 | logger.info(("前端唯一标识:" + uniqueUri)); 96 | 97 | UniqueServiceDefined uniqueServiceDefined = new UniqueServiceDefined(); 98 | try { 99 | 100 | uniqueServiceDefined = registerService 101 | .getRegisterService(uniqueUri); 102 | 103 | RestApiTimerManager restApiTimerManager = new RestApiTimerManager( 104 | dubboRemoteCall); 105 | 106 | result = restApiTimerManager.process(uniqueServiceDefined, params); 107 | 108 | } catch (Exception e) { 109 | throw e; 110 | } 111 | 112 | return result; 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /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/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/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/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/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/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/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/main/java/com/fly/app/gateway/exception/OpenApiHandlerExceptionResolver.java: -------------------------------------------------------------------------------- 1 | package com.fly.app.gateway.exception; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | 9 | import org.slf4j.Logger; 10 | import org.slf4j.LoggerFactory; 11 | import org.springframework.stereotype.Component; 12 | import org.springframework.web.method.HandlerMethod; 13 | import org.springframework.web.servlet.ModelAndView; 14 | import org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver; 15 | 16 | import com.sdicons.json.mapper.JSONMapper; 17 | import com.sdicons.json.model.JSONValue; 18 | 19 | /** 20 | * @author tim.yin 21 | * @date 2015年12月10日 下午12:41:49 22 | * @version 1.0 23 | * @Description:TODO 24 | */ 25 | 26 | @Component 27 | public class OpenApiHandlerExceptionResolver extends 28 | ExceptionHandlerExceptionResolver { 29 | 30 | private static Logger logger = LoggerFactory 31 | .getLogger(OpenApiHandlerExceptionResolver.class); 32 | 33 | private final List exceptionResponseBuilders = new ArrayList() { 34 | /** 35 | * 自定义的异常都需要定义在这里。后面会根据异常类型进行检测 构建相应的异常返回 36 | * 37 | */ 38 | private static final long serialVersionUID = 1L; 39 | 40 | { 41 | 42 | add(new BusinessExceptionResponseBuilder()); 43 | add(new NoSuchRouteServiceExceptionResponseBuilder()); 44 | add(new RequestValidatorExceptionResponseBuilder()); 45 | 46 | } 47 | }; 48 | private final ExceptionResponseBuilder defaultExceptionResponse = new UnknowExceptionReponseBuilder(); 49 | 50 | private ExceptionResponseBuilder buildExceptionResponse( 51 | final Exception exception) { 52 | for (final ExceptionResponseBuilder e : exceptionResponseBuilders) { 53 | if (e.support(exception)) { 54 | return e; 55 | } 56 | } 57 | return defaultExceptionResponse; 58 | } 59 | 60 | @Override 61 | protected ModelAndView doResolveHandlerMethodException( 62 | HttpServletRequest request, HttpServletResponse response, 63 | HandlerMethod handlerMethod, Exception exception) { 64 | if (!(exception instanceof BusinessException)) { 65 | exception.printStackTrace(); 66 | } 67 | ExceptionResponseBuilder exceptionResponseBuilder = buildExceptionResponse(exception); 68 | try { 69 | response.setContentType("text/html;charset=utf-8"); 70 | JSONValue jsonValue = JSONMapper.toJSON(exceptionResponseBuilder 71 | .buildExceptionResponse(exception)); 72 | 73 | response.getWriter().write(jsonValue.render(true)); 74 | } catch (Exception e) { 75 | logger.info("输出返回错误:", e); 76 | } finally { 77 | if (!(exception instanceof BusinessException)) { 78 | logger.error(exception.getMessage()); 79 | } else { 80 | // log.info(exception); 81 | } 82 | } 83 | 84 | return new ModelAndView(); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /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/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/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/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/exception/enums/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | /** 5 | * @author yinwei 6 | * 7 | */ 8 | package com.fly.app.gateway.exception.enums; -------------------------------------------------------------------------------- /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/filter/HttpServletRequestReplacedFilter.java: -------------------------------------------------------------------------------- 1 | package com.fly.app.gateway.filter; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.Filter; 6 | import javax.servlet.FilterChain; 7 | import javax.servlet.FilterConfig; 8 | import javax.servlet.ServletException; 9 | import javax.servlet.ServletRequest; 10 | import javax.servlet.ServletResponse; 11 | import javax.servlet.http.HttpServletRequest; 12 | 13 | import org.apache.commons.lang3.ArrayUtils; 14 | import org.apache.commons.lang3.StringUtils; 15 | import org.springframework.stereotype.Component; 16 | 17 | /** 18 | * @author tim.yin 19 | * @date 2015年12月7日 上午10:39:42 20 | * @version 1.0 21 | * @Description:处理 request getReader 缓冲流不能重复读取的问题 22 | */ 23 | @Component 24 | public class HttpServletRequestReplacedFilter implements Filter { 25 | 26 | private String[] exclusiveURIs; 27 | 28 | @Override 29 | public void init(FilterConfig filterConfig) throws ServletException { 30 | String exclusiveURI = filterConfig.getInitParameter("exclusive"); 31 | if (StringUtils.isNotEmpty(exclusiveURI)) { 32 | exclusiveURIs = exclusiveURI.split(","); 33 | } 34 | } 35 | 36 | @Override 37 | public void doFilter(ServletRequest request, ServletResponse response, 38 | FilterChain chain) throws IOException, ServletException { 39 | ServletRequest requestWrapper = null; 40 | if (request instanceof HttpServletRequest) { 41 | if (ArrayUtils.isNotEmpty(exclusiveURIs)) { 42 | String requestURI = ((HttpServletRequest) request) 43 | .getRequestURI(); 44 | for (String uri : exclusiveURIs) { 45 | if (requestURI.contains(uri)) 46 | break; 47 | requestWrapper = doWrapper((HttpServletRequest) request); 48 | } 49 | } else { 50 | requestWrapper = doWrapper((HttpServletRequest) request); 51 | } 52 | } 53 | if (null == requestWrapper) { 54 | chain.doFilter(request, response); 55 | } else { 56 | chain.doFilter(requestWrapper, response); 57 | } 58 | } 59 | 60 | private WrappedRequest doWrapper(HttpServletRequest request) 61 | throws IOException { 62 | return new WrappedRequest(request); 63 | } 64 | 65 | @Override 66 | public void destroy() { 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /api-gateway/src/main/java/com/fly/app/gateway/filter/WrappedRequest.java: -------------------------------------------------------------------------------- 1 | package com.fly.app.gateway.filter; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.ByteArrayInputStream; 5 | import java.io.IOException; 6 | import java.io.InputStreamReader; 7 | 8 | import javax.servlet.ReadListener; 9 | import javax.servlet.ServletInputStream; 10 | import javax.servlet.http.HttpServletRequest; 11 | import javax.servlet.http.HttpServletRequestWrapper; 12 | 13 | /** 14 | * @author tim.yin 15 | * @date 2015年12月7日 上午10:41:13 16 | * @version 1.0 17 | * @Description:TODO 18 | */ 19 | 20 | public class WrappedRequest extends HttpServletRequestWrapper { 21 | private String _body; 22 | 23 | public WrappedRequest(HttpServletRequest request) throws IOException { 24 | super(request); 25 | 26 | _body = ""; 27 | try { 28 | BufferedReader bufferedReader = request.getReader(); 29 | String line; 30 | while ((line = bufferedReader.readLine()) != null) 31 | _body += line; 32 | } catch (IOException e) { 33 | throw e; 34 | } 35 | } 36 | 37 | @Override 38 | public ServletInputStream getInputStream() throws IOException { 39 | final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream( 40 | _body.getBytes()); 41 | return new ServletInputStream() { 42 | @Override 43 | public boolean isReady() { 44 | // TODO Auto-generated method stub 45 | return false; 46 | } 47 | 48 | @Override 49 | public boolean isFinished() { 50 | // TODO Auto-generated method stub 51 | return false; 52 | } 53 | 54 | @Override 55 | public int read() throws IOException { 56 | return byteArrayInputStream.read(); 57 | } 58 | 59 | @Override 60 | public void setReadListener(ReadListener readListener) { 61 | // TODO Auto-generated method stub 62 | 63 | } 64 | }; 65 | } 66 | 67 | @Override 68 | public BufferedReader getReader() throws IOException { 69 | return new BufferedReader(new InputStreamReader(this.getInputStream())); 70 | } 71 | } -------------------------------------------------------------------------------- /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/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/main/EmbeddedTomcatConfig.java: -------------------------------------------------------------------------------- 1 | package com.fly.app.gateway.main; 2 | 3 | import org.apache.catalina.connector.Connector; 4 | import org.springframework.beans.factory.annotation.Value; 5 | import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer; 6 | import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer; 7 | import org.springframework.boot.context.embedded.tomcat.TomcatConnectorCustomizer; 8 | import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; 9 | import org.springframework.stereotype.Component; 10 | 11 | /** 12 | * @author tim.yin 13 | * @date 2015年12月1日 下午2:15:51 14 | * @version 1.0 15 | * @Description:TODO 16 | */ 17 | @Component 18 | public class EmbeddedTomcatConfig implements EmbeddedServletContainerCustomizer{ 19 | 20 | @Value("${server.port}") 21 | int serverPort; 22 | 23 | @Value("${servlet.container.maxThreads}") 24 | String maxThreads; 25 | 26 | @Value("${servlet.container.minSpareThreads}") 27 | String minSpareThreads; 28 | 29 | @Value("${servlet.container.connectionTimeout}") 30 | String connectionTimeout; 31 | 32 | @Override 33 | public void customize(ConfigurableEmbeddedServletContainer container) { 34 | container.setPort(serverPort); 35 | TomcatEmbeddedServletContainerFactory tomcatEmbeddedServletContainerFactory = (TomcatEmbeddedServletContainerFactory) container; 36 | tomcatEmbeddedServletContainerFactory.addConnectorCustomizers(new TomcatConnectorCustomizer() { 37 | @Override 38 | public void customize(Connector connector) { 39 | //connector.setProperty("maxKeepAliveRequests", "1"); 40 | connector.setProperty("connectionTimeout", connectionTimeout); 41 | connector.setEnableLookups(false); 42 | //connector.setProperty("keepAliveTimeout", "1"); 43 | connector.setProperty("maxThreads", maxThreads); 44 | connector.setProperty("minSpareThreads", minSpareThreads); 45 | connector.setProtocol("org.apache.coyote.http11.Http11NioProtocol"); 46 | connector.setProperty("compression", "on"); 47 | connector.setProperty("compressionMinSize", "2048"); 48 | connector.setURIEncoding("UTF-8"); 49 | connector.setProperty("noCompressionUserAgents", "gozilla,traviata"); 50 | connector.setProperty("compressableMimeType", "text/html,text/xml,text/javascript,application/javascript,text/css,text/plain"); 51 | } 52 | }); 53 | 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /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/metrics/RestApiTimerManager.java: -------------------------------------------------------------------------------- 1 | package com.fly.app.gateway.metrics; 2 | 3 | import java.io.File; 4 | import java.util.Locale; 5 | import java.util.Map; 6 | import java.util.concurrent.ConcurrentHashMap; 7 | import java.util.concurrent.TimeUnit; 8 | 9 | import com.fly.app.gateway.remote.call.DubboRemoteCall; 10 | import com.fly.app.gateway.route.dto.UniqueServiceDefined; 11 | import org.slf4j.Logger; 12 | import org.slf4j.LoggerFactory; 13 | 14 | import com.codahale.metrics.CsvReporter; 15 | import com.codahale.metrics.MetricRegistry; 16 | import com.codahale.metrics.Timer; 17 | 18 | /** 19 | * @author tim.yin 20 | * @date 2015年12月2日 上午10:16:40 21 | * @version 1.0 22 | * @Description:这里做一个度量的模板方法,具体度量主体留给子类回调实现 23 | */ 24 | 25 | public class RestApiTimerManager { 26 | 27 | private static Logger logger = LoggerFactory 28 | .getLogger(RestApiTimerManager.class); 29 | 30 | static final MetricRegistry metrics = new MetricRegistry(); 31 | 32 | private final Map metersMaps = new ConcurrentHashMap(); 33 | 34 | private DubboRemoteCall processCallback; 35 | 36 | static { 37 | // 打印到 csv 文件中 每15分钟打印一次 38 | String csvReportPath = "/opt/metrics"; 39 | final CsvReporter reporter = CsvReporter.forRegistry(metrics) 40 | .formatFor(Locale.CHINESE).convertRatesTo(TimeUnit.SECONDS) 41 | .convertDurationsTo(TimeUnit.MILLISECONDS) 42 | .build(new File(csvReportPath)); 43 | 44 | // TODO 自己设置度量间隔 45 | reporter.start(15, TimeUnit.MINUTES); 46 | } 47 | 48 | public RestApiTimerManager(DubboRemoteCall callback) { 49 | this.processCallback = callback; 50 | } 51 | 52 | private Timer fetchTimer(String interfaceConcatMethod) { 53 | logger.info("metrics 度量开始..........."); 54 | 55 | if (!metersMaps.containsKey(interfaceConcatMethod)) { 56 | metersMaps.put(interfaceConcatMethod, 57 | metrics.timer(interfaceConcatMethod)); 58 | } 59 | 60 | return metersMaps.get(interfaceConcatMethod); 61 | } 62 | 63 | static void stopReport(Timer.Context context) { 64 | logger.info("metrics 度量结束..........."); 65 | context.stop(); 66 | } 67 | 68 | /** 69 | * 主体留给子类回调实现 70 | */ 71 | public Object process(UniqueServiceDefined uniqueServiceDefined, 72 | Map params) throws Exception { 73 | Object obj = new Object(); 74 | 75 | // set reportconfig move to static method 76 | 77 | Timer timer = fetchTimer(uniqueServiceDefined.getServiceInterfaceName() 78 | .concat(uniqueServiceDefined.getServiceMethod())); 79 | 80 | final Timer.Context context = timer.time(); 81 | 82 | try { 83 | obj = processCallback.call(uniqueServiceDefined, params); 84 | } catch (Exception e) { 85 | throw e; 86 | } finally { 87 | stopReport(context); 88 | } 89 | 90 | return obj; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /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/java/com/fly/app/gateway/remote/call/impl/RemoteDubboCallComposite.java: -------------------------------------------------------------------------------- 1 | package com.fly.app.gateway.remote.call.impl; 2 | 3 | import java.lang.reflect.Method; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import com.fly.app.gateway.remote.call.util.DubboResultHelper; 8 | import org.apache.commons.lang3.StringUtils; 9 | import org.slf4j.Logger; 10 | import org.slf4j.LoggerFactory; 11 | import org.springframework.beans.factory.annotation.Value; 12 | import org.springframework.stereotype.Component; 13 | 14 | import com.alibaba.dubbo.config.ApplicationConfig; 15 | import com.alibaba.dubbo.config.ReferenceConfig; 16 | import com.alibaba.dubbo.config.RegistryConfig; 17 | import com.alibaba.dubbo.config.utils.ReferenceConfigCache; 18 | import com.alibaba.dubbo.rpc.service.GenericException; 19 | import com.alibaba.dubbo.rpc.service.GenericService; 20 | import com.google.common.collect.Lists; 21 | import com.fly.app.gateway.exception.BusinessException; 22 | import com.fly.app.gateway.remote.call.DubboRemoteCall; 23 | import com.fly.app.gateway.route.dto.UniqueServiceDefined; 24 | import com.sdicons.json.mapper.JSONMapper; 25 | import com.sdicons.json.mapper.MapperException; 26 | 27 | /** 28 | * @author tim.yin 29 | * @date 2015年12月2日 下午2:55:32 30 | * @version 1.0 31 | * @Description:TODO 32 | */ 33 | @Component 34 | public class RemoteDubboCallComposite implements DubboRemoteCall { 35 | 36 | private static Logger logger = LoggerFactory 37 | .getLogger(RemoteDubboCallComposite.class); 38 | 39 | @Value("${api.gateway.dubbo.application.name}") 40 | String applicationName; 41 | 42 | @Value("${api.gateway.dubbo.registry.protocol}") 43 | String registryProtocol; 44 | 45 | @Value("${api.gateway.dubbo.registry.address}") 46 | String registryAddress; 47 | 48 | @Value("${api.gateway.dubbo.registry.client}") 49 | String registryClient; 50 | 51 | @Value("${api.gateway.dubbo.registry.timeout}") 52 | Integer registryTimeout; 53 | 54 | public Object call(UniqueServiceDefined uniqueServiceDefined, 55 | Map params) throws ClassNotFoundException, 56 | BusinessException { 57 | 58 | ApplicationConfig application = new ApplicationConfig(); 59 | application.setName(applicationName); 60 | 61 | RegistryConfig registry = new RegistryConfig(); 62 | registry.setProtocol(registryProtocol); 63 | registry.setAddress(registryAddress); 64 | registry.setClient(registryClient); 65 | registry.setTimeout(registryTimeout); 66 | 67 | ReferenceConfig reference = new ReferenceConfig(); 68 | reference.setApplication(application); 69 | reference.setRegistry(registry); 70 | reference.setInterface(uniqueServiceDefined.getServiceInterfaceName()); 71 | reference.setGeneric(true); 72 | reference.setCheck(false); 73 | reference.setVersion(uniqueServiceDefined.getServiceVersion()); 74 | ReferenceConfigCache cache = ReferenceConfigCache.getCache(); 75 | 76 | long beforeTime = System.currentTimeMillis(); 77 | GenericService genericService = cache.get(reference); 78 | long endTime = System.currentTimeMillis(); 79 | logger.info("代理接口{},获取Reference代理对象耗时{}", new Object[] { 80 | uniqueServiceDefined.getServiceInterfaceName(), 81 | endTime - beforeTime }); 82 | 83 | // 参数类型 84 | String[] targetParamType = {}; 85 | Object[] targetParamValue = {}; 86 | 87 | List paramTypeList = Lists.newArrayList(); 88 | List paramValueList = Lists.newArrayList(); 89 | 90 | // 输入input 类型 91 | if (!StringUtils.isEmpty(uniqueServiceDefined.getServiceInputDto())) { 92 | paramTypeList.add(uniqueServiceDefined.getServiceInputDto()); 93 | params.put("class", uniqueServiceDefined.getServiceInputDto()); 94 | paramValueList.add(params); 95 | 96 | } 97 | // 输入普通多参 input 类型 98 | else if (!StringUtils.isEmpty(uniqueServiceDefined 99 | .getServiceEnumInput())) { 100 | 101 | Method[] methods = Class.forName( 102 | uniqueServiceDefined.getServiceInterfaceName()) 103 | .getDeclaredMethods(); 104 | for (Method m : methods) { 105 | if (m.getName().equals(uniqueServiceDefined.getServiceMethod())) { 106 | 107 | Class[] type = m.getParameterTypes(); 108 | for (int i = 0; i < m.getParameterTypes().length; i++) { 109 | paramTypeList.add(type[i].getName()); 110 | } 111 | break; 112 | } 113 | 114 | } 115 | 116 | for (String str : uniqueServiceDefined.getServiceEnumInput().split( 117 | ",")) { 118 | paramValueList.add(params.get(str)); 119 | } 120 | 121 | } 122 | // 输入map类型 123 | else { 124 | Method[] methods = Class.forName( 125 | uniqueServiceDefined.getServiceInterfaceName()) 126 | .getDeclaredMethods(); 127 | for (Method m : methods) { 128 | if (m.getName().equals(uniqueServiceDefined.getServiceMethod())) { 129 | 130 | Class[] type = m.getParameterTypes(); 131 | if (type.length > 0) { 132 | paramTypeList.add("java.util.Map"); 133 | paramValueList.add(params); 134 | } 135 | // 否则无参调用,不用做任何处理! 136 | } 137 | } 138 | } 139 | 140 | targetParamType = (String[]) paramTypeList 141 | .toArray(new String[paramTypeList.size()]); 142 | targetParamValue = (Object[]) paramValueList 143 | .toArray(new Object[paramValueList.size()]); 144 | 145 | Object remoteDataSet = new Object(); 146 | try { 147 | logger.info("method name:" 148 | + uniqueServiceDefined.getServiceMethod()); 149 | // 目前支持 输入类型 包括 1.java.util.Map 2.多参 3.inputDTO 三者是互斥的! 150 | remoteDataSet = genericService.$invoke( 151 | uniqueServiceDefined.getServiceMethod(), targetParamType, 152 | targetParamValue); 153 | } catch (GenericException e) { 154 | throw new BusinessException("rpc 远程调用异常!"); 155 | } 156 | Object targetDataSet = DubboResultHelper 157 | .handlerResultSet(remoteDataSet); 158 | try { 159 | String resultValue = JSONMapper.toJSON(targetDataSet).render(true); 160 | logger.info("最终输出json字符串:" + resultValue); 161 | } catch (MapperException e) { 162 | logger.error("转换json数据格式出现异常!"); 163 | } 164 | return targetDataSet; 165 | } 166 | } 167 | -------------------------------------------------------------------------------- /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/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/remote/call/util/DubboResultHelper.java: -------------------------------------------------------------------------------- 1 | package com.fly.app.gateway.remote.call.util; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | /** 7 | * @author tim.yin 8 | * @date 2015年12月2日 下午3:07:37 9 | * @version 1.0 10 | * @Description:聚合服务返回结果帮助类 11 | */ 12 | 13 | public final class DubboResultHelper { 14 | 15 | // 工具类全部不能实例化 16 | private DubboResultHelper() { 17 | 18 | } 19 | 20 | @SuppressWarnings("unchecked") 21 | public static Object handlerResultSet(Object sourceDataSet) { 22 | 23 | if (sourceDataSet instanceof Map) { 24 | 25 | if (judgeRemoteReturnPojoClass(sourceDataSet)) { 26 | return remotePojoClassFilter(sourceDataSet); 27 | } 28 | 29 | } 30 | return ((Map) sourceDataSet); 31 | 32 | } 33 | 34 | // @SuppressWarnings("unchecked") 35 | private static boolean judgeRemoteReturnPojoClass(Object result) { 36 | Object obj = ((Map) result).get("result"); 37 | 38 | if (obj instanceof Map) { 39 | return (((Map) obj).containsKey("class")); 40 | } else if (obj instanceof List) { 41 | List oj = (List) obj; 42 | // 防止list 里面嵌套list 结构 43 | if (oj.get(0) instanceof Map) 44 | return (((Map) (oj.get(0))) 45 | .containsKey("class")); 46 | } 47 | return false; 48 | 49 | } 50 | 51 | // 聚合服务返回pojo 最终我们拿到的结果也会转换为map e.g:{name=tim.yin, age=30, 52 | // class=com.fly.fortune.endpoint.impl.MockAggregationServiceApiImpl$pojo} 53 | @SuppressWarnings("unchecked") 54 | private static Object remotePojoClassFilter(Object object) { 55 | Object obj = ((Map) object).get("result"); 56 | 57 | if (obj instanceof Map) { 58 | ((Map) obj).remove("class"); 59 | return object; 60 | } else if (obj instanceof List) { 61 | List ojs = (List) obj; 62 | if (ojs.get(0) instanceof Map) { 63 | for (Object oj : ojs) { 64 | ((Map) oj).remove("class"); 65 | } 66 | return object; 67 | } 68 | } 69 | 70 | return object; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /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 { 42 | public void serialize(Object value, JsonGenerator jgen, 43 | SerializerProvider provider) throws IOException, 44 | JsonProcessingException { 45 | 46 | jgen.writeString(""); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /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/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/reqest/parse/impl/RequestParseHandler.java: -------------------------------------------------------------------------------- 1 | package com.fly.app.gateway.reqest.parse.impl; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | import java.io.UnsupportedEncodingException; 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | import java.util.Map.Entry; 9 | 10 | import javax.servlet.http.HttpServletRequest; 11 | 12 | import org.apache.commons.io.IOUtils; 13 | import org.codehaus.jackson.map.ObjectMapper; 14 | import org.codehaus.jackson.type.TypeReference; 15 | import org.slf4j.Logger; 16 | import org.slf4j.LoggerFactory; 17 | import org.springframework.beans.factory.annotation.Autowired; 18 | import org.springframework.stereotype.Component; 19 | 20 | import com.google.common.collect.Maps; 21 | import com.fly.app.gateway.reqest.parse.RequestParse; 22 | import com.fly.app.gateway.reqest.parse.utils.StringToEnumConverterFactory; 23 | 24 | /** 25 | * @author tim.yin 26 | * @date 2015年12月4日 下午2:52:36 27 | * @version 1.0 28 | * @Description:TODO 29 | */ 30 | @Component 31 | public class RequestParseHandler implements RequestParse { 32 | 33 | private static Logger logger = LoggerFactory 34 | .getLogger(RequestParseHandler.class); 35 | 36 | @Autowired 37 | StringToEnumConverterFactory stringToEnumConverterFactory; 38 | 39 | @Override 40 | public Map convertRequestParam(HttpServletRequest request) 41 | throws UnsupportedEncodingException, IOException, 42 | ClassNotFoundException { 43 | Map map = Maps.newHashMap(); 44 | 45 | if ("GET".equals(request.getMethod()) 46 | || "DELETE".equals(request.getMethod())) { 47 | 48 | map = this.acquireGetMethodParameter(request); 49 | } 50 | if ("POST".equals(request.getMethod()) 51 | || "PUT".equals(request.getMethod())) { 52 | map = this.acquirePostMethodParameter(request); 53 | } 54 | 55 | return map; 56 | 57 | } 58 | 59 | /** 60 | * 获取get delete请求方式时的参数 中文查询参数已经做了转义。 61 | * 62 | * @throws UnsupportedEncodingException 63 | */ 64 | private Map acquireGetMethodParameter( 65 | HttpServletRequest request) throws UnsupportedEncodingException { 66 | 67 | Map map = Maps.newHashMap(); 68 | 69 | Map params = request.getParameterMap(); 70 | 71 | for (Entry e : params.entrySet()) { 72 | 73 | map.put(e.getKey(), e.getValue()[0]); 74 | } 75 | return map; 76 | } 77 | 78 | /** 79 | * 获取post put 请求方式时的body里的参数 80 | * 81 | * @param request 82 | * @param map 83 | * @throws Exception 84 | */ 85 | private Map acquirePostMethodParameter( 86 | HttpServletRequest request) throws IOException { 87 | 88 | Map map = Maps.newHashMap(); 89 | 90 | ObjectMapper mapper = new ObjectMapper(); 91 | 92 | try { 93 | String bodyStr = getBodyString(request); 94 | map = mapper.readValue(bodyStr, 95 | new TypeReference>() { 96 | }); 97 | } catch (IOException e) { 98 | logger.error("post请求获取body参数转json字符串的时候发生网络异常!"); 99 | e.printStackTrace(); 100 | } 101 | 102 | return map; 103 | } 104 | 105 | /** 106 | * 获取到的body参数 转成String 107 | * 108 | * @param br 109 | * @return 110 | */ 111 | public static String getBodyString(HttpServletRequest request) 112 | throws IOException { 113 | InputStream input = request.getInputStream(); 114 | String result = IOUtils.toString(input, "UTF-8"); 115 | return result; 116 | } 117 | 118 | } 119 | -------------------------------------------------------------------------------- /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/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | /** 5 | * @author yinwei 6 | * 7 | */ 8 | package com.fly.app.gateway.reqest.parse; -------------------------------------------------------------------------------- /api-gateway/src/main/java/com/fly/app/gateway/reqest/parse/utils/MethodUtil.java: -------------------------------------------------------------------------------- 1 | package com.fly.app.gateway.reqest.parse.utils; 2 | 3 | import java.lang.reflect.Method; 4 | 5 | import javassist.ClassPool; 6 | import javassist.CtClass; 7 | import javassist.CtMethod; 8 | import javassist.Modifier; 9 | import javassist.NotFoundException; 10 | import javassist.bytecode.CodeAttribute; 11 | import javassist.bytecode.LocalVariableAttribute; 12 | import javassist.bytecode.MethodInfo; 13 | 14 | /** 15 | * @author tim.yin 16 | * @date 2015年12月30日 下午4:04:32 17 | * @version 1.0 18 | * @Description:TODO 19 | */ 20 | 21 | public class MethodUtil { 22 | 23 | public static String[] getAllParamaterName(Method method) 24 | throws NotFoundException { 25 | Class clazz = method.getDeclaringClass(); 26 | ClassPool pool = ClassPool.getDefault(); 27 | CtClass clz = pool.get(clazz.getName()); 28 | CtClass[] params = new CtClass[method.getParameterTypes().length]; 29 | for (int i = 0; i < method.getParameterTypes().length; i++) { 30 | params[i] = pool 31 | .getCtClass(method.getParameterTypes()[i].getName()); 32 | } 33 | CtMethod cm = clz.getDeclaredMethod(method.getName(), params); 34 | MethodInfo methodInfo = cm.getMethodInfo(); 35 | CodeAttribute codeAttribute = methodInfo.getCodeAttribute(); 36 | LocalVariableAttribute attr = (LocalVariableAttribute) codeAttribute 37 | .getAttribute(LocalVariableAttribute.tag); 38 | int pos = Modifier.isStatic(cm.getModifiers()) ? 0 : 1; 39 | String[] paramNames = new String[cm.getParameterTypes().length]; 40 | for (int i = 0; i < paramNames.length; i++) { 41 | paramNames[i] = attr.variableName(i + pos); 42 | } 43 | return paramNames; 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /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/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/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/route/dto/UniqueServiceDefined.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月28日 下午8:56:36 8 | * @version 1.0 9 | * @Description:后台暴露的聚合服务定义 跟dubbo保持一致,确定唯一服务 由 group+interface name +version 确定 10 | */ 11 | public class UniqueServiceDefined { 12 | 13 | // service reference group 14 | private String serviceGroup; 15 | 16 | // service reference interface 17 | private String serviceInterfaceName; 18 | 19 | // service reference version 20 | private String serviceVersion; 21 | 22 | // call method 23 | private String serviceMethod; 24 | 25 | // input dto 26 | private String serviceInputDto; 27 | 28 | // enum input support normal param type sign "," such as linux IFS. 29 | private String serviceEnumInput; 30 | 31 | public String getServiceGroup() { 32 | return serviceGroup; 33 | } 34 | 35 | public void setServiceGroup(String serviceGroup) { 36 | this.serviceGroup = serviceGroup; 37 | } 38 | 39 | public String getServiceInterfaceName() { 40 | return serviceInterfaceName; 41 | } 42 | 43 | public void setServiceInterfaceName(String serviceInterfaceName) { 44 | this.serviceInterfaceName = serviceInterfaceName; 45 | } 46 | 47 | public String getServiceVersion() { 48 | return serviceVersion; 49 | } 50 | 51 | public void setServiceVersion(String serviceVersion) { 52 | this.serviceVersion = serviceVersion; 53 | } 54 | 55 | public String getServiceMethod() { 56 | return serviceMethod; 57 | } 58 | 59 | public void setServiceMethod(String serviceMethod) { 60 | this.serviceMethod = serviceMethod; 61 | } 62 | 63 | public String getServiceInputDto() { 64 | return serviceInputDto; 65 | } 66 | 67 | public void setServiceInputDto(String serviceInputDto) { 68 | this.serviceInputDto = serviceInputDto; 69 | } 70 | 71 | public String getServiceEnumInput() { 72 | return serviceEnumInput; 73 | } 74 | 75 | public void setServiceEnumInput(String serviceEnumInput) { 76 | this.serviceEnumInput = serviceEnumInput; 77 | } 78 | 79 | public UniqueServiceDefined() { 80 | super(); 81 | // TODO Auto-generated constructor stub 82 | } 83 | 84 | public UniqueServiceDefined(String serviceGroup, 85 | String serviceInterfaceName, String serviceVersion, 86 | String serviceMethod, String serviceInputDto, 87 | String serviceEnumInput) { 88 | super(); 89 | this.serviceGroup = serviceGroup; 90 | this.serviceInterfaceName = serviceInterfaceName; 91 | this.serviceVersion = serviceVersion; 92 | this.serviceMethod = serviceMethod; 93 | this.serviceInputDto = serviceInputDto; 94 | this.serviceEnumInput = serviceEnumInput; 95 | } 96 | 97 | public String toString() { 98 | return "后台暴露的聚合服务:" + new ReflectionToStringBuilder(this).toString(); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /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/main/java/com/fly/app/gateway/route/impl/RegisterServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.fly.app.gateway.route.impl; 2 | 3 | import java.io.File; 4 | import java.util.Arrays; 5 | import java.util.HashSet; 6 | import java.util.List; 7 | import java.util.Set; 8 | import java.util.concurrent.ConcurrentHashMap; 9 | 10 | import javax.annotation.PostConstruct; 11 | 12 | import com.fly.app.gateway.route.dto.UniqueServiceDefined; 13 | import com.fly.app.gateway.route.dto.UriServiceMapping; 14 | import org.slf4j.Logger; 15 | import org.slf4j.LoggerFactory; 16 | import org.springframework.beans.factory.annotation.Value; 17 | import org.springframework.context.annotation.Configuration; 18 | import org.springframework.stereotype.Component; 19 | import org.springframework.util.Assert; 20 | 21 | import com.alibaba.dubbo.config.ApplicationConfig; 22 | import com.alibaba.dubbo.config.ReferenceConfig; 23 | import com.alibaba.dubbo.config.RegistryConfig; 24 | import com.alibaba.dubbo.config.utils.ReferenceConfigCache; 25 | import com.alibaba.dubbo.rpc.service.GenericService; 26 | import com.fasterxml.jackson.databind.ObjectMapper; 27 | import com.google.common.collect.Lists; 28 | import com.fly.app.gateway.exception.NoSuchRouteServiceException; 29 | import com.fly.app.gateway.route.RegisterService; 30 | 31 | /** 32 | * @author tim.yin 33 | * @date 2016年1月4日 下午4:55:45 34 | * @version 1.0 35 | * @Description:TODO 36 | */ 37 | @Component 38 | @Configuration 39 | public class RegisterServiceImpl implements RegisterService { 40 | 41 | private static Logger logger = LoggerFactory 42 | .getLogger(RegisterServiceImpl.class); 43 | 44 | static ConcurrentHashMap mapping = new ConcurrentHashMap(); 45 | 46 | @Value("${api.gateway.dubbo.application.name}") 47 | String applicationName; 48 | 49 | @Value("${api.gateway.dubbo.registry.protocol}") 50 | String registryProtocol; 51 | 52 | @Value("${api.gateway.dubbo.registry.address}") 53 | String registryAddress; 54 | 55 | @Value("${api.gateway.dubbo.registry.client}") 56 | String registryClient; 57 | 58 | @Value("${api.gateway.dubbo.registry.timeout}") 59 | Integer registryTimeout; 60 | 61 | @PostConstruct 62 | public void init() throws Exception { 63 | logger.info("容器启动时加载文件[routeRule.json],构造对应映射map,开始加载....."); 64 | List serviceList = Lists.newArrayList(); 65 | Set initProxySet = new HashSet(); 66 | 67 | serviceList = loadAllExposeService(); 68 | 69 | for (UriServiceMapping u : serviceList) { 70 | mapping.putIfAbsent(u.getServiceVersion() + "." + u.getUri() + "." 71 | + u.getRequestMethod(), u); 72 | initProxySet.add(new UniqueServiceDefined(u.getServiceGroup(), u 73 | .getServiceInterfaceName(), u.getServiceVersion(), u 74 | .getServiceMethod(), u.getServiceInputDto(), u 75 | .getServiceEnumInput())); 76 | } 77 | 78 | logger.info("容器到注册中心订阅服务开始....."); 79 | initDubboSubscribe(initProxySet); 80 | logger.info("容器到注册中心订阅服务结束....."); 81 | 82 | } 83 | 84 | private List loadAllExposeService() throws Exception { 85 | logger.info("初始化开始加载所有暴露的服务....."); 86 | List serviceList = Lists.newArrayList(); 87 | 88 | try { 89 | serviceList = Arrays.asList(new ObjectMapper().readValue(new File( 90 | "/opt/routeRule.json"), UriServiceMapping[].class)); 91 | } catch (Exception e) { 92 | logger.info("转换发生异常:" + e.getMessage()); 93 | throw new Exception(e); 94 | } 95 | logger.info("初始化加载所有暴露的服务成功完成....."); 96 | return serviceList; 97 | } 98 | 99 | // 这里以后可能还需要扩展 目前阶段在容器启动的时候进行服务的订阅 api网关不涉及到服务的注册 100 | private void initDubboSubscribe(Set initProxySet) 101 | throws ClassNotFoundException { 102 | 103 | // 当前应用配置 104 | ApplicationConfig application = new ApplicationConfig(); 105 | application.setName(applicationName); 106 | 107 | RegistryConfig registry = new RegistryConfig(); 108 | registry.setProtocol(registryProtocol); 109 | registry.setAddress(registryAddress); 110 | registry.setClient(registryClient); 111 | registry.setTimeout(registryTimeout); 112 | 113 | for (UniqueServiceDefined uniqueServiceDefined : initProxySet) { 114 | ReferenceConfig reference = new ReferenceConfig(); 115 | 116 | reference.setApplication(application); 117 | reference.setRegistry(registry); 118 | // reference.setGroup(uniqueServiceDefined.getServiceGroup()); 119 | reference.setInterface(uniqueServiceDefined 120 | .getServiceInterfaceName()); 121 | reference.setGeneric(true); 122 | reference.setCheck(false); 123 | reference.setVersion(uniqueServiceDefined.getServiceVersion()); 124 | 125 | ReferenceConfigCache cache = ReferenceConfigCache.getCache(); 126 | cache.get(reference); 127 | } 128 | 129 | } 130 | 131 | @Override 132 | public void register(String requestSign, 133 | UniqueServiceDefined uniqueServiceDefined) 134 | throws ClassNotFoundException { 135 | Assert.hasText(requestSign, "前端唯一标识不为空!"); 136 | Assert.notNull(uniqueServiceDefined, "后台映射服务不能为空!"); 137 | 138 | uniqueServiceDefined = mapping.get(requestSign); 139 | 140 | Set initProxySet = new HashSet(); 141 | initProxySet.add(uniqueServiceDefined); 142 | if (!mapping.containsKey(requestSign)) { 143 | mapping.put(requestSign, uniqueServiceDefined); 144 | initDubboSubscribe(initProxySet); 145 | } 146 | 147 | } 148 | 149 | @Override 150 | public UniqueServiceDefined getRegisterService(String requestSign) 151 | throws NoSuchRouteServiceException { 152 | UniqueServiceDefined ud = mapping.get(requestSign); 153 | if (ud == null) { 154 | logger.info("前端唯一标识 named '" + requestSign + "' 没有映射的后台服务"); 155 | throw new NoSuchRouteServiceException(requestSign); 156 | } 157 | return ud; 158 | } 159 | 160 | } 161 | -------------------------------------------------------------------------------- /api-gateway/src/main/java/com/fly/app/gateway/security/common_validator/ValidatorInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.fly.app.gateway.security.common_validator; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | import java.io.UnsupportedEncodingException; 6 | import java.util.HashMap; 7 | import java.util.List; 8 | import java.util.Map; 9 | import java.util.Map.Entry; 10 | 11 | import javax.annotation.Resource; 12 | import javax.servlet.http.HttpServletRequest; 13 | import javax.servlet.http.HttpServletResponse; 14 | 15 | import com.fly.app.gateway.security.common_validator.chain.Validator; 16 | import org.apache.commons.io.IOUtils; 17 | import org.codehaus.jackson.map.ObjectMapper; 18 | import org.codehaus.jackson.type.TypeReference; 19 | import org.slf4j.Logger; 20 | import org.slf4j.LoggerFactory; 21 | import org.springframework.beans.factory.annotation.Autowired; 22 | import org.springframework.stereotype.Component; 23 | import org.springframework.web.servlet.HandlerInterceptor; 24 | import org.springframework.web.servlet.HandlerMapping; 25 | import org.springframework.web.servlet.ModelAndView; 26 | 27 | import com.google.common.collect.Maps; 28 | import com.fly.app.gateway.reqest.parse.RequestParse; 29 | 30 | /** 31 | * @author tim.yin 32 | * @date 2015年11月30日 上午11:06:36 33 | * @version 1.0 34 | * @Description:TODO 35 | */ 36 | 37 | @Component 38 | public class ValidatorInterceptor implements HandlerInterceptor { 39 | 40 | private static Logger logger = LoggerFactory 41 | .getLogger(ValidatorInterceptor.class); 42 | 43 | @Autowired 44 | RequestParse requestParse; 45 | 46 | @Resource(name = "freezeUserValidator") 47 | Validator freezeUserValidator; 48 | 49 | @Resource(name = "requestParameterValidator") 50 | Validator requestParameterValidator; 51 | 52 | @Resource(name = "checkSignValidator") 53 | Validator checkSignValidator; 54 | 55 | @Override 56 | public void afterCompletion(HttpServletRequest arg0, 57 | HttpServletResponse arg1, Object arg2, Exception arg3) 58 | throws Exception { 59 | // TODO Auto-generated method stub 60 | 61 | } 62 | 63 | @Override 64 | public void postHandle(HttpServletRequest request, 65 | HttpServletResponse response, Object arg2, ModelAndView arg3) 66 | throws Exception { 67 | // TODO Auto-generated method stub 68 | 69 | } 70 | 71 | @Override 72 | public boolean preHandle(HttpServletRequest request, 73 | HttpServletResponse response, Object arg2) throws Exception { 74 | 75 | // XXX this need refactor see:RequestParse 76 | Map map = Maps.newHashMap(); 77 | 78 | if ("GET".equals(request.getMethod()) 79 | || "DELETE".equals(request.getMethod())) { 80 | this.acquireGetMethodParameter(request, map); 81 | } 82 | if ("POST".equals(request.getMethod()) 83 | || "PUT".equals(request.getMethod())) { 84 | this.acquirePostMethodParameter(request, map); 85 | } 86 | 87 | // XXX 目前用 patch 请求方法很少,待扩展 88 | // 处理路径带的参数 89 | @SuppressWarnings("unchecked") 90 | Map PathVariableMap = (Map) request 91 | .getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE); 92 | for (Entry e : PathVariableMap.entrySet()) { 93 | map.put(e.getKey(), e.getValue()); 94 | } 95 | 96 | // 构建责任链验证规则,1.验证用户是不是冻结账户 2.先验证参数非空完整性 3.验签 97 | freezeUserValidator.setSuccessor(requestParameterValidator); 98 | requestParameterValidator.setSuccessor(checkSignValidator); 99 | freezeUserValidator.requestHandler(map); 100 | return true; 101 | } 102 | 103 | /** 104 | * 获取get delete请求方式时的参数 中文查询参数已经做了转义。 105 | * 106 | * @throws UnsupportedEncodingException 107 | */ 108 | private void acquireGetMethodParameter(HttpServletRequest request, 109 | final Map map) throws UnsupportedEncodingException { 110 | Map params = request.getParameterMap(); 111 | for (Entry e : params.entrySet()) { 112 | map.put(e.getKey(), e.getValue()[0]); 113 | } 114 | } 115 | 116 | /** 117 | * 获取post put 请求方式时的body里的参数 118 | * 119 | * @param request 120 | * @param map 121 | * @throws Exception 122 | */ 123 | private void acquirePostMethodParameter(HttpServletRequest request, 124 | final Map map) throws IOException { 125 | Map tempMap = Maps.newHashMap(); 126 | ObjectMapper mapper = new ObjectMapper(); 127 | try { 128 | String bodyStr = getBodyString(request); 129 | // log.info("request body string:" + bodyStr); 130 | // convert JSON string to Map 131 | tempMap = mapper.readValue(bodyStr, 132 | new TypeReference>() { 133 | }); 134 | for (Entry e : tempMap.entrySet()) { 135 | // 如果对象是复杂对象比如 map 和 list 就丢弃 不参与验签 136 | if (e.getValue() == null || e.getValue() instanceof List 137 | || e.getValue() instanceof Map) { 138 | continue; 139 | } 140 | map.put(e.getKey(), e.getValue().toString()); 141 | } 142 | 143 | } catch (IOException e) { 144 | logger.error("post请求获取body参数转json字符串的时候发生网络异常!"); 145 | e.printStackTrace(); 146 | } 147 | } 148 | 149 | /** 150 | * 获取到的body参数 转成String 151 | * 152 | * @param br 153 | * @return 154 | */ 155 | public static String getBodyString(HttpServletRequest request) 156 | throws IOException { 157 | InputStream input = request.getInputStream(); 158 | String result = IOUtils.toString(input, "UTF-8"); 159 | return result; 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /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/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/security/common_validator/chain/RequestParameterValidator.java: -------------------------------------------------------------------------------- 1 | package com.fly.app.gateway.security.common_validator.chain; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | import java.util.Map.Entry; 6 | 7 | import org.apache.commons.collections.CollectionUtils; 8 | import org.apache.commons.lang3.StringUtils; 9 | import org.slf4j.Logger; 10 | import org.slf4j.LoggerFactory; 11 | import org.springframework.stereotype.Component; 12 | 13 | import com.google.common.collect.Lists; 14 | import com.fly.app.gateway.exception.RequestValidatorException; 15 | 16 | /** 17 | * @author tim.yin 18 | * @date 2015年11月30日 上午11:53:52 19 | * @version 1.0 20 | * @Description:TODO 21 | */ 22 | @Component 23 | public class RequestParameterValidator extends Validator { 24 | 25 | private static Logger logger = LoggerFactory 26 | .getLogger(RequestParameterValidator.class); 27 | 28 | // 校验的非空白名单属性 29 | private static List whiteList = Lists.newArrayList("app_version", 30 | "version", "interface_version", "channel", "current_time", "sign"); 31 | 32 | @Override 33 | public boolean requestHandler(Map params) throws Exception { 34 | // log.info("参数完整性校验开始............"); 35 | List paramList = Lists.newArrayList(); 36 | for (Entry entry : params.entrySet()) { 37 | String name = (String) entry.getKey(); 38 | String value = entry.getValue(); 39 | if (whiteList.contains(name)) { 40 | if (StringUtils.isEmpty(value)) { 41 | String errorMsg = "验证必填字段:" + name + "对应值为空,不能通过拦截器验证!"; 42 | logger.info(errorMsg); 43 | throw new RequestValidatorException(errorMsg); 44 | } 45 | } 46 | paramList.add(name); 47 | } 48 | 49 | @SuppressWarnings("unchecked") 50 | List c = (List) CollectionUtils.subtract(whiteList, 51 | paramList); 52 | if (0 != c.size()) { 53 | String errorMsg = "客户端缺失如下必填字段:" 54 | + java.util.Arrays.deepToString(c.toArray()) 55 | + ",不能通过拦截器验证!"; 56 | logger.info(errorMsg); 57 | throw new RequestValidatorException(errorMsg); 58 | } 59 | 60 | if (getSuccessor() != null) { 61 | getSuccessor().requestHandler(params); 62 | } 63 | return true; 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /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/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/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/src/main/java/com/fly/app/gateway/security/csrf_protect/impl/ProtectionCSRFImpl.java: -------------------------------------------------------------------------------- 1 | package com.fly.app.gateway.security.csrf_protect.impl; 2 | 3 | /*import java.security.NoSuchAlgorithmException; 4 | import java.security.NoSuchProviderException; 5 | import java.security.SecureRandom;*/ 6 | 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | 10 | import com.fly.app.gateway.security.csrf_protect.ProtectionCSRF; 11 | 12 | 13 | /** 14 | * @author tim.yin 15 | * @date 2015年11月30日 上午12:31:30 16 | * @version 1.0 17 | * @Description:TODO 18 | */ 19 | 20 | public class ProtectionCSRFImpl implements ProtectionCSRF { 21 | 22 | private static Logger logger = LoggerFactory 23 | .getLogger(ProtectionCSRFImpl.class); 24 | 25 | 26 | @Override 27 | public String generatorRandomToken() throws Exception{ 28 | 29 | 30 | /*SecureRandom sr; 31 | 32 | try 33 | { 34 | sr = SecureRandom.getInstance("SHA1PRNG", "SUN"); 35 | } 36 | catch (NoSuchAlgorithmException e) 37 | { 38 | String err = "Failed to generate CSRFToken using SecureRandom" 39 | + ", exceptionMessage=" + e.getMessage(); 40 | logger.error(err); 41 | throw new Exception(err + ", exceptionMessage=" 42 | + e.getMessage()); 43 | 44 | } 45 | catch (NoSuchProviderException e) 46 | { 47 | try 48 | { 49 | sr = SecureRandom.getInstance("SHA1PRNG"); 50 | } 51 | catch (NoSuchAlgorithmException e1) { 52 | String err = "Failed to generate CSRFToken using SecureRandom" 53 | + ", exceptionMessage=" + e1.getMessage(); 54 | logger.error(err); 55 | throw new Exception(err + ", exceptionMessage=" 56 | + e1.getMessage()); 57 | } 58 | } 59 | 60 | byte[] randomBytes = new byte[32]; 61 | sr.nextBytes(randomBytes); */ 62 | return null; 63 | //return Base64.encode(randomBytes); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /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/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | api-gateway 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | error-apiGateway-LogFile.%d{yyyy-MM-dd}.log 24 | 30 25 | 26 | 27 | 28 | %date %level [%thread] %logger{35} - %msg%n 29 | 30 | 31 | 32 | ERROR 33 | ACCEPT 34 | DENY 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | normal-apiGateway-LogFile.%d{yyyy-MM-dd}.log 43 | 30 44 | 45 | 46 | 47 | %date %level [%thread] %logger{35} - %msg%n 48 | 49 | 50 | 51 | INFO 52 | ACCEPT 53 | DENY 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /api-gateway/src/main/resources/routeRule.properties: -------------------------------------------------------------------------------- 1 | [{ 2 | "uri":"member", 3 | "requestMethod":"post", 4 | "serviceInterfaceName":"com.jiayin.tech.member.api.regist.service.RegistService", 5 | "serviceMethod":"registVerifyOne", 6 | "serviceInputDto":"com.jiayin.tech.member.api.enums.BizSign" 7 | },{ 8 | "uri":"member.regist.registVerifySecond", 9 | "requestMethod":"post", 10 | "serviceInterfaceName":"com.jiayin.tech.member.api.regist.service.RegistService", 11 | "serviceMethod":"registVerifySecond", 12 | "serviceInputDto":"com.jiayin.tech.member.api.regist.dto.RegistInputDTO" 13 | },{ 14 | "uri":"member.login", 15 | "requestMethod":"post", 16 | "serviceInterfaceName":"com.jiayin.tech.member.api.login.service.LoginService", 17 | "serviceMethod":"login", 18 | "serviceInputDto":"com.jiayin.tech.member.api.login.dto.LoginInputDTO" 19 | },{ 20 | "uri":"member.is_realname_authenticate", 21 | "requestMethod":"get", 22 | "serviceInterfaceName":"com.jiayin.tech.member.api.realnameauth.service.RealNameAuthApiService", 23 | "serviceMethod":"isRealNameAuthenticate" 24 | },{ 25 | "uri":"member.phone", 26 | "requestMethod":"put", 27 | "serviceInterfaceName":"com.jiayin.tech.member.api.changephone.service.ChangePhoneService", 28 | "serviceMethod":"changePhone", 29 | "serviceInputDto":"com.jiayin.tech.member.api.changephone.dto.ChangePhoneInputDTO" 30 | },{ 31 | "uri":"member.is_loginpwd_changed", 32 | "requestMethod":"get", 33 | "serviceInterfaceName":"com.jiayin.tech.member.api.security.service.SecurityApiService", 34 | "serviceMethod":"isLoginPwdChanged" 35 | },{ 36 | "uri":"member.loginpwd", 37 | "requestMethod":"put", 38 | "serviceInterfaceName":"com.jiayin.tech.member.api.changeLoginpwd.service.ChangeLoginPwdService", 39 | "serviceMethod":"changeLoginPwd", 40 | "serviceInputDto":"com.jiayin.tech.member.api.changeLoginpwd.dto.ChangeLoginPwdInputDTO" 41 | },{ 42 | "uri":"member.tradepwd", 43 | "requestMethod":"put", 44 | "serviceInterfaceName":"com.jiayin.tech.member.api.changetradepwd.service", 45 | "serviceMethod":"changeTradePwd", 46 | "serviceInputDto":"com.jiayin.tech.member.api.changetradepwd.dto.ChangeTradePwdInputDTO" 47 | },{ 48 | "uri":"member.realname_athenticate", 49 | "requestMethod":"get", 50 | "serviceInterfaceName":"com.jiayin.tech.member.api.realnameauth.service.RealNameAuthApiService", 51 | "serviceMethod":"realnameAuthenticate" 52 | }] 53 | -------------------------------------------------------------------------------- /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/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/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/src/test/java/com/fly/app/api_gateway/ParamMappingTest.java: -------------------------------------------------------------------------------- 1 | package com.fly.app.api_gateway; 2 | 3 | import java.lang.reflect.Method; 4 | import java.lang.reflect.Type; 5 | 6 | /** 7 | * @author tim.yin 8 | * @date 2015年12月30日 下午1:14:06 9 | * @version 1.0 10 | * @Description:TODO 11 | */ 12 | 13 | public class ParamMappingTest { 14 | 15 | public static Class[] getMethodParamTypes(Object classInstance, 16 | String methodName) throws ClassNotFoundException { 17 | Class[] paramTypes = null; 18 | Method[] methods = classInstance.getClass().getMethods();// 全部方法 19 | for (int i = 0; i < methods.length; i++) { 20 | if (methodName.equals(methods[i].getName())) {// 和传入方法名匹配 21 | Class[] params = methods[i].getParameterTypes(); 22 | Type[] type = methods[i].getGenericParameterTypes(); 23 | // paramTypes = new Class[params.length]; 24 | System.out.println(params[i].getName()); 25 | System.out.println(type[i].getClass().getName()); 26 | for (int j = 0; j < params.length; j++) { 27 | // paramTypes[j] = Class.forName(params[j].getName()); 28 | } 29 | break; 30 | } 31 | } 32 | return paramTypes; 33 | } 34 | 35 | public void acquire(Long id, int age) { 36 | System.out.println(id); 37 | } 38 | 39 | public static void main(String[] args) { 40 | 41 | try { 42 | getMethodParamTypes(ParamMappingTest.class.newInstance(), "acquire"); 43 | } catch (ClassNotFoundException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } catch (InstantiationException e) { 47 | // TODO Auto-generated catch block 48 | e.printStackTrace(); 49 | } catch (IllegalAccessException e) { 50 | // TODO Auto-generated catch block 51 | e.printStackTrace(); 52 | } 53 | 54 | /* 55 | * ParamMappingTest.class .newInstance() .getClass() .getDeclaredMethod( 56 | * "方法名称", getMethodParamTypes( ParamMappingTest.class.newInstance(), 57 | * "方法名称")); 58 | */ 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /api-gateway/src/test/java/com/fly/app/api_gateway/ShiroTest.java: -------------------------------------------------------------------------------- 1 | package com.fly.app.api_gateway; 2 | 3 | import junit.framework.Assert; 4 | 5 | import org.apache.shiro.SecurityUtils; 6 | import org.apache.shiro.authc.AuthenticationException; 7 | import org.apache.shiro.authc.UsernamePasswordToken; 8 | import org.apache.shiro.config.IniSecurityManagerFactory; 9 | import org.apache.shiro.subject.Subject; 10 | import org.apache.shiro.util.Factory; 11 | import org.junit.Test; 12 | 13 | /** 14 | * @author tim.yin 15 | * @date 2015年11月30日 下午8:41:16 16 | * @version 1.0 17 | * @Description:shiro Authenticator unit test 18 | * Subject -> SecurityManager ->Authenticator ->jdbc realm 19 | */ 20 | 21 | public class ShiroTest { 22 | 23 | @SuppressWarnings("deprecation") 24 | @Test 25 | public void testJDBCRealm() { 26 | //1、获取SecurityManager工厂,此处使用Ini配置文件初始化SecurityManager 27 | Factory factory = 28 | new IniSecurityManagerFactory("classpath:shiro-jdbc-realm.ini"); 29 | 30 | //2、得到SecurityManager实例 并绑定给SecurityUtils 31 | org.apache.shiro.mgt.SecurityManager securityManager = factory.getInstance(); 32 | SecurityUtils.setSecurityManager(securityManager); 33 | 34 | //3、得到Subject及创建用户名/密码身份验证Token(即用户身份/凭证) 35 | Subject subject = SecurityUtils.getSubject(); 36 | UsernamePasswordToken token = new UsernamePasswordToken("yin", "yin"); 37 | 38 | try { 39 | //4、登录,即身份验证 40 | subject.login(token); 41 | } catch (AuthenticationException e) { 42 | //5、身份验证失败 43 | e.printStackTrace(); 44 | } 45 | 46 | Assert.assertEquals(true, subject.isAuthenticated()); //断言用户已经登录 47 | 48 | //6、退出 49 | subject.logout(); 50 | } 51 | 52 | 53 | } 54 | -------------------------------------------------------------------------------- /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/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'); --------------------------------------------------------------------------------