├── LICENSE ├── README.md ├── native-cloud-app-1 ├── .gitignore ├── CHANGELOG.md ├── docker-compose.yml ├── pom.xml ├── src │ ├── main │ │ ├── docker │ │ │ └── Dockerfile │ │ ├── java │ │ │ └── com │ │ │ │ └── bingohuang │ │ │ │ ├── NativeCloudApplication.java │ │ │ │ ├── api │ │ │ │ └── GitHubApiController.java │ │ │ │ └── info │ │ │ │ ├── GitHubService.java │ │ │ │ ├── GitHubServiceImpl.java │ │ │ │ ├── User.java │ │ │ │ └── UserRepository.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── application.yml │ │ │ └── static │ │ │ ├── assets │ │ │ ├── css │ │ │ │ └── ie10-viewport-bug-workaround.css │ │ │ └── js │ │ │ │ ├── ie-emulation-modes-warning.js │ │ │ │ ├── ie10-viewport-bug-workaround.js │ │ │ │ └── vendor │ │ │ │ ├── holder.min.js │ │ │ │ └── jquery.min.js │ │ │ ├── css │ │ │ ├── bootstrap.min.css │ │ │ ├── dashboard.css │ │ │ └── main.css │ │ │ ├── dist │ │ │ ├── css │ │ │ │ └── bootstrap.min.css │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.eot? │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ └── js │ │ │ │ └── bootstrap.min.js │ │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.eot? │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ ├── index.html │ │ │ └── js │ │ │ ├── bootstrap.min.js │ │ │ └── main.js │ └── test │ │ └── java │ │ └── com │ │ └── bingohuang │ │ └── api │ │ └── GitHubApiControllerTest.java └── start.sh └── native-cloud-app-2 ├── .gitignore ├── CHANGELOG.md ├── README.md ├── app-crawler └── pom.xml ├── app-web └── pom.xml ├── docker-compose.yml ├── pom.xml ├── src ├── main │ ├── docker │ │ └── Dockerfile │ ├── java │ │ └── com │ │ │ └── bingohuang │ │ │ ├── NativeCloudApplication.java │ │ │ ├── api │ │ │ └── GitHubApiController.java │ │ │ └── info │ │ │ ├── GitHubService.java │ │ │ ├── GitHubServiceImpl.java │ │ │ ├── User.java │ │ │ └── UserRepository.java │ └── resources │ │ ├── application.properties │ │ ├── application.yml │ │ └── static │ │ ├── assets │ │ ├── css │ │ │ └── ie10-viewport-bug-workaround.css │ │ └── js │ │ │ ├── ie-emulation-modes-warning.js │ │ │ ├── ie10-viewport-bug-workaround.js │ │ │ └── vendor │ │ │ ├── holder.min.js │ │ │ └── jquery.min.js │ │ ├── css │ │ ├── bootstrap.min.css │ │ ├── dashboard.css │ │ └── main.css │ │ ├── dist │ │ ├── css │ │ │ └── bootstrap.min.css │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.eot? │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ └── js │ │ │ └── bootstrap.min.js │ │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.eot? │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── index.html │ │ └── js │ │ ├── bootstrap.min.js │ │ └── main.js └── test │ └── java │ └── com │ └── bingohuang │ └── api │ └── GitHubApiControllerTest.java └── start.sh /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cloud-cookbook-sample 2 | 云计算书籍全书示例 3 | -------------------------------------------------------------------------------- /native-cloud-app-1/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | 3 | # IntelliJ project files 4 | .idea 5 | *.iml 6 | out 7 | gen### OSX template 8 | *.DS_Store 9 | .AppleDouble 10 | .LSOverride 11 | 12 | # Icon must end with two \r 13 | Icon 14 | 15 | # Thumbnails 16 | ._* 17 | 18 | # Files that might appear in the root of a volume 19 | .DocumentRevisions-V100 20 | .fseventsd 21 | .Spotlight-V100 22 | .TemporaryItems 23 | .Trashes 24 | .VolumeIcon.icns 25 | .com.apple.timemachine.donotpresent 26 | 27 | # Directories potentially created on remote AFP share 28 | .AppleDB 29 | .AppleDesktop 30 | Network Trash Folder 31 | Temporary Items 32 | .apdisk 33 | ### Java template 34 | *.class 35 | 36 | # Mobile Tools for Java (J2ME) 37 | .mtj.tmp/ 38 | 39 | # Package Files # 40 | *.jar 41 | *.war 42 | *.ear 43 | 44 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 45 | hs_err_pid* 46 | ### Maven template 47 | target/ 48 | pom.xml.tag 49 | pom.xml.releaseBackup 50 | pom.xml.versionsBackup 51 | pom.xml.next 52 | release.properties 53 | dependency-reduced-pom.xml 54 | buildNumber.properties 55 | .mvn/timing.properties 56 | 57 | -------------------------------------------------------------------------------- /native-cloud-app-1/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 0.0.7(2016-12-08) 4 | 5 | * add docker compose 6 | 7 | ## 0.0.6(2016-12-07) 8 | 9 | * add static assets 10 | 11 | ## 0.0.5(2016-12-07) 12 | 13 | * add test 14 | 15 | ## 0.0.4(2016-12-07) 16 | 17 | * add GitHub api 18 | 19 | ## 0.0.3(2016-12-07) 20 | 21 | * add neo4j 22 | 23 | ## 0.0.2 (2016-12-07) 24 | 25 | * init project 26 | 27 | ## 0.0.1 (2016-12-07) 28 | 29 | * init commit -------------------------------------------------------------------------------- /native-cloud-app-1/docker-compose.yml: -------------------------------------------------------------------------------- 1 | neo4j: 2 | container_name: neo4j 3 | image: hub.c.163.com/bingohuang/neo4j:2.3 4 | ports: 5 | - "7474:7474" 6 | volumes: 7 | - ~/neo4j/2.3/data:/data 8 | 9 | native-cloud-app: 10 | container_name: native-cloud-app 11 | image: hub.c.163.com/bingohuang/native-cloud-app:latest 12 | ports: 13 | - "8080:8080" 14 | links: 15 | - neo4j 16 | environment: 17 | - GITHUB_OAUTH=8cf7b1ad3206c41e385226947648e332aa87c679 18 | - GITHUB_ENDPOINT=https://api.github.com 19 | - SPRING_PROFILES_ACTIVE=pro -------------------------------------------------------------------------------- /native-cloud-app-1/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.bingohuang 8 | native-cloud-app 9 | 0.0.7-SNAPSHOT 10 | 11 | 12 | org.springframework.boot 13 | spring-boot-starter-parent 14 | 1.4.2.RELEASE 15 | 16 | 17 | 18 | UTF-8 19 | 1.8 20 | 0.4.13 21 | hub.c.163.com/bingohuang 22 | 23 | 24 | 25 | 26 | org.springframework.boot 27 | spring-boot-starter-web 28 | 29 | 30 | org.springframework.boot 31 | spring-boot-starter-actuator 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-starter-test 36 | 37 | 38 | 39 | org.springframework.boot 40 | spring-boot-starter-data-rest 41 | 42 | 43 | org.springframework.data 44 | spring-data-neo4j 45 | 4.1.1.RELEASE 46 | 47 | 48 | 49 | org.kohsuke 50 | github-api 51 | 1.80 52 | 53 | 54 | com.google.guava 55 | guava 56 | 18.0 57 | 58 | 59 | 60 | 61 | 62 | 63 | org.springframework.boot 64 | spring-boot-maven-plugin 65 | 66 | 67 | 68 | repackage 69 | 70 | 71 | 72 | 73 | 74 | 75 | com.spotify 76 | docker-maven-plugin 77 | ${docker.plugin.version} 78 | 79 | 80 | install 81 | 82 | build 83 | 84 | 85 | 86 | 87 | ${docker.image.prefix}/${project.artifactId} 88 | ${project.basedir}/src/main/docker 89 | 90 | ${project.version} 91 | 92 | true 93 | 94 | 95 | / 96 | ${project.build.directory} 97 | ${project.build.finalName}.jar 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | spring-snapshots 108 | Spring Snapshots 109 | https://repo.spring.io/libs-snapshot 110 | 111 | true 112 | 113 | 114 | 115 | spring-milestones 116 | Spring Milestones 117 | https://repo.spring.io/libs-milestone 118 | 119 | false 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | VOLUME /tmp 3 | COPY native-cloud-app-*.jar app.jar 4 | RUN bash -c 'touch /app.jar' 5 | EXPOSE 8080 6 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/java/com/bingohuang/NativeCloudApplication.java: -------------------------------------------------------------------------------- 1 | package com.bingohuang; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.autoconfigure.domain.EntityScan; 6 | import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories; 7 | import org.springframework.transaction.annotation.EnableTransactionManagement; 8 | 9 | /** 10 | * Author: bingohuang 11 | * Date: 07/12/2016 12 | * Time: 13:48 13 | */ 14 | @SpringBootApplication 15 | @EnableNeo4jRepositories(basePackages = {"com.bingohuang.info"}) 16 | @EnableTransactionManagement 17 | @EntityScan({ "com.bingohuang.info", "BOOT-INF.classes.com.bingohuang.info" }) 18 | public class NativeCloudApplication { 19 | public static void main(String[] args) { 20 | SpringApplication.run(NativeCloudApplication.class, args); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/java/com/bingohuang/api/GitHubApiController.java: -------------------------------------------------------------------------------- 1 | package com.bingohuang.api; 2 | 3 | import com.bingohuang.info.GitHubService; 4 | import com.bingohuang.info.User; 5 | import com.google.common.base.Optional; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.http.HttpStatus; 8 | import org.springframework.http.ResponseEntity; 9 | import org.springframework.web.bind.annotation.*; 10 | 11 | import java.util.concurrent.atomic.AtomicLong; 12 | 13 | /** 14 | * GitHub API 接口 15 | * 16 | * @author bingohuang 17 | */ 18 | @RestController 19 | @RequestMapping("v1") 20 | public class GitHubApiController { 21 | 22 | private final GitHubService gitHubService; 23 | 24 | private static final String template = "Hello, %s!"; 25 | private final AtomicLong counter = new AtomicLong(); 26 | 27 | @Autowired 28 | public GitHubApiController(GitHubService gitHubService) { 29 | this.gitHubService = gitHubService; 30 | } 31 | 32 | @GetMapping("user/{screenName}") 33 | public ResponseEntity discoverUserByScreenName(@PathVariable("screenName") String screenName) { 34 | return Optional.of(ResponseEntity.ok(gitHubService.discoverUserByScreenName(screenName))) 35 | .or(new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR)); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/java/com/bingohuang/info/GitHubService.java: -------------------------------------------------------------------------------- 1 | package com.bingohuang.info; 2 | 3 | /** 4 | * Author: bingohuang 5 | * Date: 06/12/2016 6 | * Time: 11:46 7 | */ 8 | public interface GitHubService { 9 | 10 | User discoverUserByScreenName(String name); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/java/com/bingohuang/info/GitHubServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.bingohuang.info; 2 | 3 | import org.apache.commons.logging.Log; 4 | import org.apache.commons.logging.LogFactory; 5 | import org.kohsuke.github.GitHub; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.io.IOException; 10 | import java.text.SimpleDateFormat; 11 | import java.util.Optional; 12 | 13 | /** 14 | * Author: bingohuang 15 | * Date: 06/12/2016 16 | * Time: 11:48 17 | */ 18 | @Service 19 | public class GitHubServiceImpl implements GitHubService { 20 | private final Log log = LogFactory.getLog(GitHubService.class); 21 | private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss"); 22 | 23 | private final GitHub github; 24 | private final UserRepository userRepository; 25 | 26 | @Autowired 27 | public GitHubServiceImpl(UserRepository userRepository) throws IOException { 28 | this.github = GitHub.connect(); 29 | this.userRepository = userRepository; 30 | } 31 | 32 | @Override 33 | public User discoverUserByScreenName(String screenName) { 34 | User user = null; 35 | 36 | try { 37 | user = Optional.of(github.getUser(screenName)) 38 | .map(User::new) 39 | .get(); 40 | 41 | userRepository.save(user); 42 | log.info(String.format("Discover user: %s", user.getScreenName())); 43 | } catch (IOException e) { 44 | e.printStackTrace(); 45 | } 46 | 47 | return user; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/java/com/bingohuang/info/User.java: -------------------------------------------------------------------------------- 1 | package com.bingohuang.info; 2 | 3 | import org.kohsuke.github.GHUser; 4 | import org.neo4j.ogm.annotation.GraphId; 5 | import org.neo4j.ogm.annotation.NodeEntity; 6 | 7 | import java.io.IOException; 8 | import java.io.Serializable; 9 | import java.util.Date; 10 | 11 | /** 12 | * Author: bingohuang 13 | * Date: 06/12/2016 14 | * Time: 11:33 15 | */ 16 | @NodeEntity 17 | public class User implements Serializable { 18 | @GraphId 19 | private Long id; 20 | 21 | private String profileId; 22 | 23 | private String screenName; 24 | private String name; 25 | private String url; 26 | private String profileImageUrl; 27 | private String description; 28 | private String location; 29 | private Date createdDate; 30 | private Integer followerCount; 31 | private Integer followsCount; 32 | 33 | public User() { 34 | } 35 | 36 | public User(Long id, String profileId) { 37 | this.id = id; 38 | this.profileId = profileId; 39 | } 40 | 41 | public User(GHUser ghUser) { 42 | this.profileId = String.valueOf(ghUser.getId()); 43 | this.screenName = ghUser.getLogin(); 44 | this.url = ghUser.getHtmlUrl().toString(); 45 | this.profileImageUrl = ghUser.getAvatarUrl(); 46 | try { 47 | this.name = ghUser.getName(); 48 | this.location = ghUser.getLocation(); 49 | this.followerCount = ghUser.getFollowersCount(); 50 | this.followsCount = ghUser.getFollowingCount(); 51 | } catch (IOException e) { 52 | e.printStackTrace(); 53 | } 54 | } 55 | 56 | public Long getId() { 57 | return id; 58 | } 59 | 60 | public void setId(Long id) { 61 | this.id = id; 62 | } 63 | 64 | public String getProfileId() { 65 | return profileId; 66 | } 67 | 68 | public void setProfileId(String profileId) { 69 | this.profileId = profileId; 70 | } 71 | 72 | public String getScreenName() { 73 | return screenName; 74 | } 75 | 76 | public void setScreenName(String screenName) { 77 | this.screenName = screenName; 78 | } 79 | 80 | public String getName() { 81 | return name; 82 | } 83 | 84 | public void setName(String name) { 85 | this.name = name; 86 | } 87 | 88 | public String getUrl() { 89 | return url; 90 | } 91 | 92 | public void setUrl(String url) { 93 | this.url = url; 94 | } 95 | 96 | public String getProfileImageUrl() { 97 | return profileImageUrl; 98 | } 99 | 100 | public void setProfileImageUrl(String profileImageUrl) { 101 | this.profileImageUrl = profileImageUrl; 102 | } 103 | 104 | public String getDescription() { 105 | return description; 106 | } 107 | 108 | public void setDescription(String description) { 109 | this.description = description; 110 | } 111 | 112 | public String getLocation() { 113 | return location; 114 | } 115 | 116 | public void setLocation(String location) { 117 | this.location = location; 118 | } 119 | 120 | public Date getCreatedDate() { 121 | return createdDate; 122 | } 123 | 124 | public void setCreatedDate(Date createdDate) { 125 | this.createdDate = createdDate; 126 | } 127 | 128 | public Integer getFollowerCount() { 129 | return followerCount; 130 | } 131 | 132 | public void setFollowerCount(Integer followerCount) { 133 | this.followerCount = followerCount; 134 | } 135 | 136 | public Integer getFollowsCount() { 137 | return followsCount; 138 | } 139 | 140 | public void setFollowsCount(Integer followsCount) { 141 | this.followsCount = followsCount; 142 | } 143 | 144 | @Override 145 | public String toString() { 146 | return "User{" + 147 | "id=" + id + 148 | ", profileId=" + profileId + 149 | ", screenName='" + screenName + '\'' + 150 | ", name='" + name + '\'' + 151 | ", url='" + url + '\'' + 152 | ", profileImageUrl='" + profileImageUrl + '\'' + 153 | ", description='" + description + '\'' + 154 | ", location='" + location + '\'' + 155 | ", createdDate=" + createdDate + 156 | ", followerCount=" + followerCount + 157 | ", followsCount=" + followsCount + 158 | '}'; 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/java/com/bingohuang/info/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.bingohuang.info; 2 | 3 | import org.springframework.data.neo4j.annotation.Query; 4 | import org.springframework.data.neo4j.repository.GraphRepository; 5 | import org.springframework.data.repository.query.Param; 6 | 7 | import java.util.List; 8 | import java.util.Set; 9 | 10 | /** 11 | * Author: bingohuang 12 | * Date: 06/12/2016 13 | * Time: 11:37 14 | */ 15 | public interface UserRepository extends GraphRepository { 16 | @Query("MATCH (user:User) WHERE has(user.screenName)\n" + 17 | "WITH user\n" + 18 | "ORDER BY user.screenName ASC\n" + 19 | "SKIP {skip}\n" + 20 | "LIMIT {limit}\n" + 21 | "RETURN user") 22 | Set findAllUsers(@Param("skip") Integer skip, @Param("limit") Integer limit); 23 | } 24 | -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=native-cloud-app 2 | 3 | #server.port=1989 4 | #spring.data.neo4j.username=neo4j 5 | #spring.data.neo4j.password=bingo -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring.profiles.active: 'dev' 2 | --- 3 | server: 4 | port: 1989 5 | spring: 6 | data: 7 | neo4j: 8 | uri: 'http://localhost:7474' 9 | username: 'neo4j' 10 | password: 'bingo' 11 | profiles: 'dev' 12 | --- 13 | server: 14 | port: 8080 15 | spring: 16 | data: 17 | neo4j: 18 | uri: 'http://neo4j:7474' 19 | username: 'neo4j' 20 | password: 'bingo' 21 | profiles: 'pro' -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/resources/static/assets/css/ie10-viewport-bug-workaround.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * IE10 viewport hack for Surface/desktop Windows 8 bug 3 | * Copyright 2014-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | /* 8 | * See the Getting Started docs for more information: 9 | * http://getbootstrap.com/getting-started/#support-ie10-width 10 | */ 11 | @-webkit-viewport { width: device-width; } 12 | @-moz-viewport { width: device-width; } 13 | @-ms-viewport { width: device-width; } 14 | @-o-viewport { width: device-width; } 15 | @viewport { width: device-width; } 16 | -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/resources/static/assets/js/ie-emulation-modes-warning.js: -------------------------------------------------------------------------------- 1 | // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT 2 | // IT'S JUST JUNK FOR OUR DOCS! 3 | // ++++++++++++++++++++++++++++++++++++++++++ 4 | /*! 5 | * Copyright 2014-2015 Twitter, Inc. 6 | * 7 | * Licensed under the Creative Commons Attribution 3.0 Unported License. For 8 | * details, see https://creativecommons.org/licenses/by/3.0/. 9 | */ 10 | // Intended to prevent false-positive bug reports about Bootstrap not working properly in old versions of IE due to folks testing using IE's unreliable emulation modes. 11 | (function () { 12 | 'use strict'; 13 | 14 | function emulatedIEMajorVersion() { 15 | var groups = /MSIE ([0-9.]+)/.exec(window.navigator.userAgent) 16 | if (groups === null) { 17 | return null 18 | } 19 | var ieVersionNum = parseInt(groups[1], 10) 20 | var ieMajorVersion = Math.floor(ieVersionNum) 21 | return ieMajorVersion 22 | } 23 | 24 | function actualNonEmulatedIEMajorVersion() { 25 | // Detects the actual version of IE in use, even if it's in an older-IE emulation mode. 26 | // IE JavaScript conditional compilation docs: https://msdn.microsoft.com/library/121hztk3%28v=vs.94%29.aspx 27 | // @cc_on docs: https://msdn.microsoft.com/library/8ka90k2e%28v=vs.94%29.aspx 28 | var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')() // jshint ignore:line 29 | if (jscriptVersion === undefined) { 30 | return 11 // IE11+ not in emulation mode 31 | } 32 | if (jscriptVersion < 9) { 33 | return 8 // IE8 (or lower; haven't tested on IE<8) 34 | } 35 | return jscriptVersion // IE9 or IE10 in any mode, or IE11 in non-IE11 mode 36 | } 37 | 38 | var ua = window.navigator.userAgent 39 | if (ua.indexOf('Opera') > -1 || ua.indexOf('Presto') > -1) { 40 | return // Opera, which might pretend to be IE 41 | } 42 | var emulated = emulatedIEMajorVersion() 43 | if (emulated === null) { 44 | return // Not IE 45 | } 46 | var nonEmulated = actualNonEmulatedIEMajorVersion() 47 | 48 | if (emulated !== nonEmulated) { 49 | window.alert('WARNING: You appear to be using IE' + nonEmulated + ' in IE' + emulated + ' emulation mode.\nIE emulation modes can behave significantly differently from ACTUAL older versions of IE.\nPLEASE DON\'T FILE BOOTSTRAP BUGS based on testing in IE emulation modes!') 50 | } 51 | })(); 52 | -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/resources/static/assets/js/ie10-viewport-bug-workaround.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * IE10 viewport hack for Surface/desktop Windows 8 bug 3 | * Copyright 2014-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | // See the Getting Started docs for more information: 8 | // http://getbootstrap.com/getting-started/#support-ie10-width 9 | 10 | (function () { 11 | 'use strict'; 12 | 13 | if (navigator.userAgent.match(/IEMobile\/10\.0/)) { 14 | var msViewportStyle = document.createElement('style') 15 | msViewportStyle.appendChild( 16 | document.createTextNode( 17 | '@-ms-viewport{width:auto!important}' 18 | ) 19 | ) 20 | document.querySelector('head').appendChild(msViewportStyle) 21 | } 22 | 23 | })(); 24 | -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/resources/static/assets/js/vendor/holder.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | Holder - client side image placeholders 4 | Version 2.6.0+51ebp 5 | © 2015 Ivan Malopinsky - http://imsky.co 6 | 7 | Site: http://holderjs.com 8 | Issues: https://github.com/imsky/holder/issues 9 | License: http://opensource.org/licenses/MIT 10 | 11 | */ 12 | !function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):"object"==typeof exports?exports.Holder=b():a.Holder=b()}(this,function(){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){(function(b){function d(a,b,c,d){var g=e(c.substr(c.lastIndexOf(a.domain)),a);g&&f({mode:null,el:d,flags:g,engineSettings:b})}function e(a,b){for(var c={theme:y(K.settings.themes.gray,null),stylesheets:b.stylesheets,holderURL:[]},d=!1,e=String.fromCharCode(11),f=a.replace(/([^\\])\//g,"$1"+e).split(e),g=/%[0-9a-f]{2}/gi,h=f.length,i=0;h>i;i++){var j=f[i];if(j.match(g))try{j=decodeURIComponent(j)}catch(k){j=f[i]}var l=!1;if(K.flags.dimensions.match(j))d=!0,c.dimensions=K.flags.dimensions.output(j),l=!0;else if(K.flags.fluid.match(j))d=!0,c.dimensions=K.flags.fluid.output(j),c.fluid=!0,l=!0;else if(K.flags.textmode.match(j))c.textmode=K.flags.textmode.output(j),l=!0;else if(K.flags.colors.match(j)){var m=K.flags.colors.output(j);c.theme=y(c.theme,m),l=!0}else if(b.themes[j])b.themes.hasOwnProperty(j)&&(c.theme=y(b.themes[j],null)),l=!0;else if(K.flags.font.match(j))c.font=K.flags.font.output(j),l=!0;else if(K.flags.auto.match(j))c.auto=!0,l=!0;else if(K.flags.text.match(j))c.text=K.flags.text.output(j),l=!0;else if(K.flags.size.match(j))c.size=K.flags.size.output(j),l=!0;else if(K.flags.random.match(j)){null==K.vars.cache.themeKeys&&(K.vars.cache.themeKeys=Object.keys(b.themes));var n=K.vars.cache.themeKeys[0|Math.random()*K.vars.cache.themeKeys.length];c.theme=y(b.themes[n],null),l=!0}l&&c.holderURL.push(j)}return c.holderURL.unshift(b.domain),c.holderURL=c.holderURL.join("/"),d?c:!1}function f(a){var b=a.mode,c=a.el,d=a.flags,e=a.engineSettings,f=d.dimensions,h=d.theme,i=f.width+"x"+f.height;if(b=null==b?d.fluid?"fluid":"image":b,null!=d.text&&(h.text=d.text,"object"===c.nodeName.toLowerCase())){for(var l=h.text.split("\\n"),m=0;m1){var l=0,m=0,n=a.width*K.setup.lineWrapRatio,o=0;k=new e.Group("line"+o);for(var p=0;p=n||r===!0)&&(b(g,k,l,g.properties.leading),l=0,m+=g.properties.leading,o+=1,k=new e.Group("line"+o),k.y=m),r!==!0&&(j.moveTo(l,0),l+=h.spaceWidth+q.width,k.add(j))}b(g,k,l,g.properties.leading);for(var s in g.children)k=g.children[s],k.moveTo((g.width-k.width)/2,null,null);g.moveTo((a.width-g.width)/2,(a.height-g.height)/2,null),(a.height-g.height)/2<0&&g.moveTo(null,0,null)}else j=new e.Text(a.text),k=new e.Group("line0"),k.add(j),g.add(k),g.moveTo((a.width-h.boundingBox.width)/2,(a.height-h.boundingBox.height)/2,null);return d}function i(a,b,c){var d=parseInt(a,10),e=parseInt(b,10),f=Math.max(d,e),g=Math.min(d,e),h=.8*Math.min(g,f*K.defaults.scale);return Math.round(Math.max(c,h))}function j(a){var b;b=null==a||null==a.nodeType?K.vars.resizableImages:[a];for(var c=0,d=b.length;d>c;c++){var e=b[c];if(e.holderData){var f=e.holderData.flags,h=E(e);if(h){if(!e.holderData.resizeUpdate)continue;if(f.fluid&&f.auto){var i=e.holderData.fluidConfig;switch(i.mode){case"width":h.height=h.width/i.ratio;break;case"height":h.width=h.height*i.ratio}}var j={mode:"image",holderSettings:{dimensions:h,theme:f.theme,flags:f},el:e,engineSettings:e.holderData.engineSettings};"exact"==f.textmode&&(f.exactDimensions=h,j.holderSettings.dimensions=f.dimensions),g(j)}else n(e)}}}function k(a){if(a.holderData){var b=E(a);if(b){var c=a.holderData.flags,d={fluidHeight:"%"==c.dimensions.height.slice(-1),fluidWidth:"%"==c.dimensions.width.slice(-1),mode:null,initialDimensions:b};d.fluidWidth&&!d.fluidHeight?(d.mode="width",d.ratio=d.initialDimensions.width/parseFloat(c.dimensions.height)):!d.fluidWidth&&d.fluidHeight&&(d.mode="height",d.ratio=parseFloat(c.dimensions.width)/d.initialDimensions.height),a.holderData.fluidConfig=d}else n(a)}}function l(){for(var a,c=[],d=Object.keys(K.vars.invisibleImages),e=0,f=d.length;f>e;e++)a=K.vars.invisibleImages[d[e]],E(a)&&"img"==a.nodeName.toLowerCase()&&(c.push(a),delete K.vars.invisibleImages[d[e]]);c.length&&J.run({images:c}),b.requestAnimationFrame(l)}function m(){K.vars.visibilityCheckStarted||(b.requestAnimationFrame(l),K.vars.visibilityCheckStarted=!0)}function n(a){a.holderData.invisibleId||(K.vars.invisibleId+=1,K.vars.invisibleImages["i"+K.vars.invisibleId]=a,a.holderData.invisibleId=K.vars.invisibleId)}function o(a,b){return null==b?document.createElement(a):document.createElementNS(b,a)}function p(a,b){for(var c in b)a.setAttribute(c,b[c])}function q(a,b,c){var d,e;null==a?(a=o("svg",F),d=o("defs",F),e=o("style",F),p(e,{type:"text/css"}),d.appendChild(e),a.appendChild(d)):e=a.querySelector("style"),a.webkitMatchesSelector&&a.setAttribute("xmlns",F);for(var f=0;f=0;h--){var i=g.createProcessingInstruction("xml-stylesheet",'href="'+f[h]+'" rel="stylesheet"');g.insertBefore(i,g.firstChild)}var j=g.createProcessingInstruction("xml",'version="1.0" encoding="UTF-8" standalone="yes"');g.insertBefore(j,g.firstChild),g.removeChild(g.documentElement),e=d.serializeToString(g)}var k=d.serializeToString(a);return k=k.replace(/\&(\#[0-9]{2,}\;)/g,"&$1"),e+k}}function s(){return b.DOMParser?(new DOMParser).parseFromString("","application/xml"):void 0}function t(a){K.vars.debounceTimer||a.call(this),K.vars.debounceTimer&&b.clearTimeout(K.vars.debounceTimer),K.vars.debounceTimer=b.setTimeout(function(){K.vars.debounceTimer=null,a.call(this)},K.setup.debounce)}function u(){t(function(){j(null)})}var v=c(1),w=c(2),x=c(3),y=x.extend,z=x.cssProps,A=x.encodeHtmlEntity,B=x.decodeHtmlEntity,C=x.imageExists,D=x.getNodeArray,E=x.dimensionCheck,F="http://www.w3.org/2000/svg",G=8,H="2.6.0",I="\nCreated with Holder.js "+H+".\nLearn more at http://holderjs.com\n(c) 2012-2015 Ivan Malopinsky - http://imsky.co\n",J={version:H,addTheme:function(a,b){return null!=a&&null!=b&&(K.settings.themes[a]=b),delete K.vars.cache.themeKeys,this},addImage:function(a,b){var c=document.querySelectorAll(b);if(c.length)for(var d=0,e=c.length;e>d;d++){var f=o("img"),g={};g[K.vars.dataAttr]=a,p(f,g),c[d].appendChild(f)}return this},setResizeUpdate:function(a,b){a.holderData&&(a.holderData.resizeUpdate=!!b,a.holderData.resizeUpdate&&j(a))},run:function(a){a=a||{};var c={},g=y(K.settings,a);K.vars.preempted=!0,K.vars.dataAttr=g.dataAttr||K.vars.dataAttr,c.renderer=g.renderer?g.renderer:K.setup.renderer,-1===K.setup.renderers.join(",").indexOf(c.renderer)&&(c.renderer=K.setup.supportsSVG?"svg":K.setup.supportsCanvas?"canvas":"html");var h=D(g.images),i=D(g.bgnodes),j=D(g.stylenodes),k=D(g.objects);c.stylesheets=[],c.svgXMLStylesheet=!0,c.noFontFallback=g.noFontFallback?g.noFontFallback:!1;for(var l=0;l1){c.nodeValue="";for(var u=0;u=0?b:1)}function f(a){v?e(a):w.push(a)}null==document.readyState&&document.addEventListener&&(document.addEventListener("DOMContentLoaded",function y(){document.removeEventListener("DOMContentLoaded",y,!1),document.readyState="complete"},!1),document.readyState="loading");var g=a.document,h=g.documentElement,i="load",j=!1,k="on"+i,l="complete",m="readyState",n="attachEvent",o="detachEvent",p="addEventListener",q="DOMContentLoaded",r="onreadystatechange",s="removeEventListener",t=p in g,u=j,v=j,w=[];if(g[m]===l)e(b);else if(t)g[p](q,c,j),a[p](i,c,j);else{g[n](r,c),a[n](k,c);try{u=null==a.frameElement&&h}catch(x){}u&&u.doScroll&&!function z(){if(!v){try{u.doScroll("left")}catch(a){return e(z,50)}d(),b()}}()}return f.version="1.4.0",f.isReady=function(){return v},f}a.exports="undefined"!=typeof window&&b(window)},function(a,b,c){var d=c(4),e=function(a){function b(a,b){for(var c in b)a[c]=b[c];return a}var c=1,e=d.defclass({constructor:function(a){c++,this.parent=null,this.children={},this.id=c,this.name="n"+c,null!=a&&(this.name=a),this.x=0,this.y=0,this.z=0,this.width=0,this.height=0},resize:function(a,b){null!=a&&(this.width=a),null!=b&&(this.height=b)},moveTo:function(a,b,c){this.x=null!=a?a:this.x,this.y=null!=b?b:this.y,this.z=null!=c?c:this.z},add:function(a){var b=a.name;if(null!=this.children[b])throw"SceneGraph: child with that name already exists: "+b;this.children[b]=a,a.parent=this}}),f=d(e,function(b){this.constructor=function(){b.constructor.call(this,"root"),this.properties=a}}),g=d(e,function(a){function c(c,d){if(a.constructor.call(this,c),this.properties={fill:"#000"},null!=d)b(this.properties,d);else if(null!=c&&"string"!=typeof c)throw"SceneGraph: invalid node name"}this.Group=d.extend(this,{constructor:c,type:"group"}),this.Rect=d.extend(this,{constructor:c,type:"rect"}),this.Text=d.extend(this,{constructor:function(a){c.call(this),this.properties.text=a},type:"text"})}),h=new f;return this.Shape=g,this.root=h,this};a.exports=e},function(a,b){(function(a){b.extend=function(a,b){var c={};for(var d in a)a.hasOwnProperty(d)&&(c[d]=a[d]);if(null!=b)for(var e in b)b.hasOwnProperty(e)&&(c[e]=b[e]);return c},b.cssProps=function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c+":"+a[c]);return b.join(";")},b.encodeHtmlEntity=function(a){for(var b=[],c=0,d=a.length-1;d>=0;d--)c=a.charCodeAt(d),b.unshift(c>128?["",c,";"].join(""):a[d]);return b.join("")},b.getNodeArray=function(b){var c=null;return"string"==typeof b?c=document.querySelectorAll(b):a.NodeList&&b instanceof a.NodeList?c=b:a.Node&&b instanceof a.Node?c=[b]:a.HTMLCollection&&b instanceof a.HTMLCollection?c=b:b instanceof Array?c=b:null===b&&(c=[]),c},b.imageExists=function(a,b){var c=new Image;c.onerror=function(){b.call(this,!1)},c.onload=function(){b.call(this,!0)},c.src=a},b.decodeHtmlEntity=function(a){return a.replace(/(\d+);/g,function(a,b){return String.fromCharCode(b)})},b.dimensionCheck=function(a){var b={height:a.clientHeight,width:a.clientWidth};return b.height&&b.width?b:!1}}).call(b,function(){return this}())},function(a){var b=function(){},c=Array.prototype.slice,d=function(a,d){var e=b.prototype="function"==typeof a?a.prototype:a,f=new b,g=d.apply(f,c.call(arguments,2).concat(e));if("object"==typeof g)for(var h in g)f[h]=g[h];if(!f.hasOwnProperty("constructor"))return f;var i=f.constructor;return i.prototype=f,i};d.defclass=function(a){var b=a.constructor;return b.prototype=a,b},d.extend=function(a,b){return d(a,function(a){return this.uber=a,b})},a.exports=d}])}); -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/resources/static/css/dashboard.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Base structure 3 | */ 4 | 5 | /* Move down content because we have a fixed navbar that is 50px tall */ 6 | body { 7 | padding-top: 50px; 8 | } 9 | 10 | /* 11 | * Global add-ons 12 | */ 13 | 14 | .sub-header { 15 | padding-bottom: 10px; 16 | border-bottom: 1px solid #eee; 17 | } 18 | 19 | /* 20 | * Top navigation 21 | * Hide default border to remove 1px line. 22 | */ 23 | .navbar-fixed-top { 24 | border: 0; 25 | } 26 | 27 | /* 28 | * Sidebar 29 | */ 30 | 31 | /* Hide for mobile, show later */ 32 | .sidebar { 33 | display: none; 34 | } 35 | 36 | @media (min-width: 768px) { 37 | .sidebar { 38 | position: fixed; 39 | top: 51px; 40 | bottom: 0; 41 | left: 0; 42 | z-index: 1000; 43 | display: block; 44 | padding: 20px; 45 | overflow-x: hidden; 46 | overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */ 47 | background-color: #f5f5f5; 48 | border-right: 1px solid #eee; 49 | } 50 | } 51 | 52 | /* Sidebar navigation */ 53 | .nav-sidebar { 54 | margin-right: -21px; /* 20px padding + 1px border */ 55 | margin-bottom: 20px; 56 | margin-left: -20px; 57 | } 58 | 59 | .nav-sidebar > li > a { 60 | padding-right: 20px; 61 | padding-left: 20px; 62 | } 63 | 64 | .nav-sidebar > .active > a, 65 | .nav-sidebar > .active > a:hover, 66 | .nav-sidebar > .active > a:focus { 67 | color: #fff; 68 | background-color: #428bca; 69 | } 70 | 71 | /* 72 | * Main content 73 | */ 74 | 75 | .main { 76 | padding: 20px; 77 | } 78 | 79 | @media (min-width: 768px) { 80 | .main { 81 | padding-right: 40px; 82 | padding-left: 40px; 83 | } 84 | } 85 | 86 | .main .page-header { 87 | margin-top: 0; 88 | } 89 | 90 | /* 91 | * Placeholder dashboard ideas 92 | */ 93 | 94 | .placeholders { 95 | text-align: center; 96 | } 97 | 98 | .placeholders h4 { 99 | margin-bottom: 0; 100 | } 101 | 102 | .placeholder { 103 | margin-top: 1em; 104 | } 105 | 106 | .placeholder img { 107 | display: inline-block; 108 | border-radius: 50%; 109 | } 110 | 111 | .placeholder .img-profile-dashboard { 112 | max-height: 6em; 113 | width: auto; 114 | } 115 | 116 | .placeholder .img-profile-row { 117 | max-height: 200px; 118 | width: auto; 119 | } 120 | -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/resources/static/css/main.css: -------------------------------------------------------------------------------- 1 | .fa-caret-up { 2 | color: green; 3 | text-shadow: 1px 1px 1px #ccc; 4 | font-size: 1.75em !important; 5 | } 6 | 7 | .fa-caret-down { 8 | color: red; 9 | text-shadow: 1px 1px 1px #ccc; 10 | font-size: 1.75em !important; 11 | } 12 | 13 | .fa-minus { 14 | color: #999; 15 | text-shadow: 1px 1px 1px #ccc; 16 | font-size: 1em !important; 17 | } 18 | 19 | .fa-plus { 20 | font-size: 1em !important; 21 | color: green; 22 | text-shadow: 1px 1px 1px #ccc; 23 | } 24 | 25 | .h1, h1 { 26 | font-size: 26px; 27 | } 28 | 29 | .h2, h2 { 30 | font-size: 24px; 31 | } 32 | 33 | .table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td, .table > tfoot > tr > th, .table > thead > tr > td, .table > thead > tr > th { 34 | vertical-align: middle; 35 | } 36 | 37 | .rank-col { 38 | text-align: center; 39 | font-weight: 400; 40 | } 41 | 42 | .add-profile { 43 | padding: 1em; 44 | } 45 | 46 | .loader { 47 | background: rgba(50, 50, 50, 0.9) none repeat scroll 0 0; 48 | height: 100%; 49 | margin-bottom: 0; 50 | position: fixed; 51 | top: 0; 52 | vertical-align: middle; 53 | width: 100%; 54 | z-index: 1040; 55 | } 56 | 57 | .glyphicon-exclamation-sign { 58 | font-size: 2.5em; 59 | color: white; 60 | top: 50%; 61 | position: fixed; 62 | text-shadow: 1px 1px 1px #555; 63 | } 64 | 65 | .glyphicon-refresh-animate { 66 | -animation: spin .7s infinite linear; 67 | -ms-animation: spin .7s infinite linear; 68 | -webkit-animation: spinw .7s infinite linear; 69 | -moz-animation: spinm .7s infinite linear; 70 | font-size: 2.5em; 71 | color: black; 72 | top: 50%; 73 | position: fixed; 74 | } 75 | 76 | @keyframes spin { 77 | from { 78 | transform: scale(1) rotate(0deg); 79 | } 80 | to { 81 | transform: scale(1) rotate(360deg); 82 | } 83 | } 84 | 85 | @-webkit-keyframes spinw { 86 | from { 87 | -webkit-transform: rotate(0deg); 88 | } 89 | to { 90 | -webkit-transform: rotate(360deg); 91 | } 92 | } 93 | 94 | @-moz-keyframes spinm { 95 | from { 96 | -moz-transform: rotate(0deg); 97 | } 98 | to { 99 | -moz-transform: rotate(360deg); 100 | } 101 | } 102 | 103 | @media (max-width: 768px) { 104 | body { 105 | font-size: 12px; 106 | } 107 | 108 | .h1, h1 { 109 | font-size: 24px; 110 | } 111 | 112 | .h4, h4 { 113 | font-size: 14px; 114 | } 115 | 116 | .h2, h2 { 117 | font-size: 20px; 118 | } 119 | } 120 | 121 | @media (max-width: 320px) { 122 | body { 123 | font-size: 14px; 124 | } 125 | } -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/resources/static/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/163yun/cloud-native-app-sample/49657fa1039d6c2fa5886f31387953008ae76d41/native-cloud-app-1/src/main/resources/static/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/resources/static/dist/fonts/glyphicons-halflings-regular.eot?: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/163yun/cloud-native-app-sample/49657fa1039d6c2fa5886f31387953008ae76d41/native-cloud-app-1/src/main/resources/static/dist/fonts/glyphicons-halflings-regular.eot? -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/resources/static/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/163yun/cloud-native-app-sample/49657fa1039d6c2fa5886f31387953008ae76d41/native-cloud-app-1/src/main/resources/static/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/resources/static/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/163yun/cloud-native-app-sample/49657fa1039d6c2fa5886f31387953008ae76d41/native-cloud-app-1/src/main/resources/static/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/resources/static/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/163yun/cloud-native-app-sample/49657fa1039d6c2fa5886f31387953008ae76d41/native-cloud-app-1/src/main/resources/static/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/163yun/cloud-native-app-sample/49657fa1039d6c2fa5886f31387953008ae76d41/native-cloud-app-1/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/resources/static/fonts/glyphicons-halflings-regular.eot?: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/163yun/cloud-native-app-sample/49657fa1039d6c2fa5886f31387953008ae76d41/native-cloud-app-1/src/main/resources/static/fonts/glyphicons-halflings-regular.eot? -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/163yun/cloud-native-app-sample/49657fa1039d6c2fa5886f31387953008ae76d41/native-cloud-app-1/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/163yun/cloud-native-app-sample/49657fa1039d6c2fa5886f31387953008ae76d41/native-cloud-app-1/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/163yun/cloud-native-app-sample/49657fa1039d6c2fa5886f31387953008ae76d41/native-cloud-app-1/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/resources/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Spring Boot - GitHub Discovery 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 45 | Toggle navigation 46 | 47 | 48 | 49 | 50 | 云计算书籍示例-GitHub用户爬虫 51 | 52 | 53 | 54 | 书籍 55 | GitHub 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 面板 66 | 67 | 68 | 注:完善爬虫功能后,后台将自动抓取用户的好友信息 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | Add GitHub Profile 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | × 89 | 添加 GitHub 用户 90 | 91 | 92 | 93 | 94 | GitHub 用户名 95 | 96 | @ 97 | 99 | 100 | 101 | 102 | 103 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 抓取的用户配置 116 | 排名靠前的几位用户 117 | 118 | 119 | 120 | 121 | Rank 122 | 头像 123 | 姓名 124 | Profile 125 | Following 126 | Followers 127 | PageRank 128 | Change 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/resources/static/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.6 (http://getbootstrap.com) 3 | * Copyright 2011-2015 Twitter, Inc. 4 | * Licensed under the MIT license 5 | */ 6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>2)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.6",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.6",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.6",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.6",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.6",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.6",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.6",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); -------------------------------------------------------------------------------- /native-cloud-app-1/src/main/resources/static/js/main.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | 3 | $('#myModal').on('shown.bs.modal', function () { 4 | $('#myInput').focus() 5 | $('#add-profile-form').bootstrapValidator('resetForm', true); 6 | }) 7 | 8 | $('#add-profile-form').bootstrapValidator({ 9 | feedbackIcons: { 10 | valid: 'glyphicon glyphicon-ok', 11 | invalid: 'glyphicon glyphicon-remove', 12 | validating: 'glyphicon glyphicon-refresh' 13 | }, 14 | submitHandler: function (validator, form, submitButton) { 15 | var screenName = $("#gitHubHandle").val(); 16 | $(".loader").show(); 17 | 18 | $.ajax({ 19 | url: '/v1/user/' + screenName, 20 | type: "get", 21 | dataType: "json", 22 | success: function (data) { 23 | $(".loader").hide(); 24 | $('#myModal').modal("hide"); 25 | $("#dashboard-header").html(""); 26 | location.reload(); 27 | }, 28 | error: function (xhr, status) { 29 | $(".loader").hide(); 30 | $("#add-profile-form").data('bootstrapValidator').updateStatus("gitHubHandle", "INVALID", "callback") 31 | } 32 | }); 33 | }, 34 | fields: { 35 | gitHubHandle: { 36 | validators: { 37 | notEmpty: { 38 | message: 'A valid GitHub profile handle is required' 39 | }, 40 | callback: { 41 | message: 'An error occurred', 42 | callback: function (value, validator) { 43 | return true; 44 | } 45 | } 46 | } 47 | } 48 | } 49 | }); 50 | 51 | $.ajax({ 52 | url: '/users/search/findAllUsers?skip=0&limit=100', 53 | type: "get", 54 | dataType: "json", 55 | success: function (data) { 56 | $(".loader").hide(); 57 | drawTable(data._embedded.users); 58 | drawDashboardHeader(data._embedded.users) 59 | }, 60 | error: function (xhr, status) { 61 | $(".glyphicon-refresh") 62 | .removeClass("glyphicon-refresh") 63 | .removeClass("glyphicon-refresh-animate") 64 | .addClass("glyphicon-exclamation-sign") 65 | } 66 | }); 67 | 68 | function drawTable(data) { 69 | for (var i = 0; i < data.length; i++) { 70 | drawRow(data[i]); 71 | } 72 | } 73 | 74 | function drawDashboardHeader(data) { 75 | 76 | data.sort(function (a, b) { 77 | return a.discoveredRank - b.discoveredRank; 78 | }); 79 | 80 | for (var i = 0; i < Math.min(data.length, 3); i++) { 81 | drawSpotlight(data[i]); 82 | } 83 | } 84 | 85 | function drawSpotlight(rowData) { 86 | var row = $('@' + rowData.screenName + ' ' + rowData.name + '') 87 | $("#dashboard-header").append(row); 88 | } 89 | 90 | function drawRow(rowData) { 91 | var row = $("") 92 | $("#personDataTable").append(row); 93 | 94 | var currentRank = rowData.currentRank == null ? "" : rowData.currentRank + "."; 95 | 96 | row.append($("" + currentRank + "")); 97 | row.append($("")); 98 | row.append($("" + rowData.name + "")); 99 | row.append($("@" + rowData.screenName + "")); 100 | row.append($("" + rowData.followsCount + "")); 101 | row.append($("" + rowData.followerCount + "")); 102 | row.append($("" + rowData.pagerank + "")); 103 | 104 | var change = (((rowData.previousRank == 0) ? rowData.currentRank : rowData.previousRank) - rowData.currentRank); 105 | var arrowChange = change > 0 ? "fa fa-caret-up" : change < 0 ? "fa fa-caret-down" : (rowData.previousRank == 0) ? "fa fa-caret-up" : "fa fa-minus"; 106 | 107 | row.append($("")); 108 | } 109 | }); -------------------------------------------------------------------------------- /native-cloud-app-1/src/test/java/com/bingohuang/api/GitHubApiControllerTest.java: -------------------------------------------------------------------------------- 1 | package com.bingohuang.api; 2 | 3 | import com.bingohuang.info.User; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.boot.context.embedded.LocalServerPort; 8 | import org.springframework.boot.test.context.SpringBootTest; 9 | import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; 10 | import org.springframework.boot.test.web.client.TestRestTemplate; 11 | import org.springframework.http.HttpStatus; 12 | import org.springframework.http.ResponseEntity; 13 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 14 | 15 | import static org.junit.Assert.assertEquals; 16 | 17 | /** 18 | * Author: bingohuang 19 | * Date: 07/12/2016 20 | * Time: 16:28 21 | */ 22 | @RunWith(SpringJUnit4ClassRunner.class) 23 | @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) 24 | public class GitHubApiControllerTest { 25 | 26 | @LocalServerPort 27 | private int port; 28 | 29 | @Autowired 30 | private TestRestTemplate restTemplate; 31 | 32 | @Test 33 | public void testDiscoverUserByScreenName() throws Exception { 34 | ResponseEntity user1 = restTemplate.getForEntity("http://localhost:" + port + "/v1/user/bingohuang", User.class); 35 | assertEquals(HttpStatus.OK, user1.getStatusCode()); 36 | 37 | ResponseEntity user2 = restTemplate.getForEntity("http://localhost:" + port + "/v1/user/163yun", User.class); 38 | assertEquals(HttpStatus.OK, user2.getStatusCode()); 39 | 40 | ResponseEntity user3 = restTemplate.getForEntity("http://localhost:" + port + "/v1/user/huangqingbing", User.class); 41 | assertEquals(HttpStatus.OK, user3.getStatusCode()); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /native-cloud-app-1/start.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # start neo4j docker container 4 | function neo4j-docker() { 5 | docker run -d \ 6 | --publish=7474:7474 \ 7 | --volume=$HOME/neo4j/2.3/data:/data \ 8 | --name=neo4j-2.3 \ 9 | hub.c.163.com/bingohuang/neo4j:2.3 10 | 11 | 12 | } 13 | 14 | # change neo4j password 15 | function neo4j-password() { 16 | curl -v -u neo4j:neo4j -X POST localhost:7474/user/neo4j/password -H 'Content-type:application/json' -d '{"password":"bingo"}' 17 | } 18 | 19 | 20 | function help() { 21 | echo "$0 neo4j|app" 22 | } 23 | 24 | if [ "$1" == "" ]; then 25 | help 26 | elif [ "$1" == "neo4j-docker" ];then 27 | neo4j-docker 28 | elif [ "$1" == "neo4j-password" ];then 29 | neo4j-password 30 | elif [ "$1" == "app" ];then 31 | app 32 | else 33 | help 34 | fi -------------------------------------------------------------------------------- /native-cloud-app-2/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | 3 | # IntelliJ project files 4 | .idea 5 | *.iml 6 | out 7 | gen### OSX template 8 | *.DS_Store 9 | .AppleDouble 10 | .LSOverride 11 | 12 | # Icon must end with two \r 13 | Icon 14 | 15 | # Thumbnails 16 | ._* 17 | 18 | # Files that might appear in the root of a volume 19 | .DocumentRevisions-V100 20 | .fseventsd 21 | .Spotlight-V100 22 | .TemporaryItems 23 | .Trashes 24 | .VolumeIcon.icns 25 | .com.apple.timemachine.donotpresent 26 | 27 | # Directories potentially created on remote AFP share 28 | .AppleDB 29 | .AppleDesktop 30 | Network Trash Folder 31 | Temporary Items 32 | .apdisk 33 | ### Java template 34 | *.class 35 | 36 | # Mobile Tools for Java (J2ME) 37 | .mtj.tmp/ 38 | 39 | # Package Files # 40 | *.jar 41 | *.war 42 | *.ear 43 | 44 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 45 | hs_err_pid* 46 | ### Maven template 47 | target/ 48 | pom.xml.tag 49 | pom.xml.releaseBackup 50 | pom.xml.versionsBackup 51 | pom.xml.next 52 | release.properties 53 | dependency-reduced-pom.xml 54 | buildNumber.properties 55 | .mvn/timing.properties 56 | 57 | -------------------------------------------------------------------------------- /native-cloud-app-2/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 0.2.0 (2016-12-08) 4 | 5 | * add two modules: app-crawler and app-web 6 | 7 | ## 0.1.0 (2016-12-08) 8 | 9 | * init commit -------------------------------------------------------------------------------- /native-cloud-app-2/README.md: -------------------------------------------------------------------------------- 1 | # native-cloud-app-2 2 | -------------------------------------------------------------------------------- /native-cloud-app-2/app-crawler/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | native-cloud-app-parent 9 | com.bingohuang 10 | 0.1.0-SNAPSHOT 11 | 12 | 13 | app-crawler 14 | 15 | app-crawler 16 | 数据抓取模块 17 | 18 | 19 | 20 | org.springframework.boot 21 | spring-boot-starter-web 22 | 23 | 24 | org.springframework.boot 25 | spring-boot-starter-actuator 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-test 30 | 31 | 32 | 33 | org.springframework.boot 34 | spring-boot-starter-data-rest 35 | 36 | 37 | org.springframework.data 38 | spring-data-neo4j 39 | 4.1.1.RELEASE 40 | 41 | 42 | 43 | org.kohsuke 44 | github-api 45 | 1.80 46 | 47 | 48 | com.google.guava 49 | guava 50 | 18.0 51 | 52 | 53 | 54 | 55 | 56 | 57 | org.springframework.boot 58 | spring-boot-maven-plugin 59 | 60 | 61 | 62 | repackage 63 | 64 | 65 | 66 | 67 | 68 | 69 | com.spotify 70 | docker-maven-plugin 71 | ${docker.plugin.version} 72 | 73 | 74 | install 75 | 76 | build 77 | 78 | 79 | 80 | 81 | ${docker.image.prefix}/${project.artifactId} 82 | ${project.basedir}/src/main/docker 83 | 84 | ${project.version} 85 | 86 | true 87 | 88 | 89 | / 90 | ${project.build.directory} 91 | ${project.build.finalName}.jar 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /native-cloud-app-2/app-web/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | native-cloud-app-parent 9 | com.bingohuang 10 | 0.1.0-SNAPSHOT 11 | 12 | 13 | app-web 14 | 15 | app-web 16 | 界面展示模块 17 | 18 | 19 | 20 | org.springframework.boot 21 | spring-boot-starter-web 22 | 23 | 24 | org.springframework.boot 25 | spring-boot-starter-actuator 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-test 30 | test 31 | 32 | 33 | 34 | 35 | 36 | 37 | org.springframework.boot 38 | spring-boot-maven-plugin 39 | 40 | 41 | 42 | repackage 43 | 44 | 45 | 46 | 47 | 48 | com.spotify 49 | docker-maven-plugin 50 | ${docker.plugin.version} 51 | 52 | 53 | package 54 | 55 | build 56 | 57 | 58 | 59 | 60 | ${docker.image.prefix}/${project.artifactId} 61 | ${project.basedir}/src/main/docker 62 | 63 | ${project.version} 64 | 65 | true 66 | 67 | 68 | / 69 | ${project.build.directory} 70 | ${project.build.finalName}.jar 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /native-cloud-app-2/docker-compose.yml: -------------------------------------------------------------------------------- 1 | neo4j: 2 | container_name: neo4j 3 | image: hub.c.163.com/bingohuang/neo4j:2.3 4 | ports: 5 | - "7474:7474" 6 | volumes: 7 | - ~/neo4j/2.3/data:/data 8 | 9 | native-cloud-app: 10 | container_name: native-cloud-app 11 | image: hub.c.163.com/bingohuang/native-cloud-app:latest 12 | ports: 13 | - "8080:8080" 14 | links: 15 | - neo4j 16 | environment: 17 | - GITHUB_OAUTH=8cf7b1ad3206c41e385226947648e332aa87c679 18 | - GITHUB_ENDPOINT=https://api.github.com 19 | - SPRING_PROFILES_ACTIVE=pro -------------------------------------------------------------------------------- /native-cloud-app-2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.bingohuang 8 | native-cloud-app-parent 9 | pom 10 | 0.1.0-SNAPSHOT 11 | 12 | app-crawler 13 | app-web 14 | 15 | 16 | 17 | org.springframework.boot 18 | spring-boot-starter-parent 19 | 1.4.2.RELEASE 20 | 21 | 22 | 23 | UTF-8 24 | 1.8 25 | 0.4.13 26 | hub.c.163.com/bingohuang 27 | 28 | 29 | 30 | 31 | spring-snapshots 32 | Spring Snapshots 33 | https://repo.spring.io/libs-snapshot 34 | 35 | true 36 | 37 | 38 | 39 | spring-milestones 40 | Spring Milestones 41 | https://repo.spring.io/libs-milestone 42 | 43 | false 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | VOLUME /tmp 3 | COPY native-cloud-app-*.jar app.jar 4 | RUN bash -c 'touch /app.jar' 5 | EXPOSE 8080 6 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/java/com/bingohuang/NativeCloudApplication.java: -------------------------------------------------------------------------------- 1 | package com.bingohuang; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.autoconfigure.domain.EntityScan; 6 | import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories; 7 | import org.springframework.transaction.annotation.EnableTransactionManagement; 8 | 9 | /** 10 | * Author: bingohuang 11 | * Date: 07/12/2016 12 | * Time: 13:48 13 | */ 14 | @SpringBootApplication 15 | @EnableNeo4jRepositories(basePackages = {"com.bingohuang.info"}) 16 | @EnableTransactionManagement 17 | @EntityScan({ "com.bingohuang.info", "BOOT-INF.classes.com.bingohuang.info" }) 18 | public class NativeCloudApplication { 19 | public static void main(String[] args) { 20 | SpringApplication.run(NativeCloudApplication.class, args); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/java/com/bingohuang/api/GitHubApiController.java: -------------------------------------------------------------------------------- 1 | package com.bingohuang.api; 2 | 3 | import com.bingohuang.info.GitHubService; 4 | import com.bingohuang.info.User; 5 | import com.google.common.base.Optional; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.http.HttpStatus; 8 | import org.springframework.http.ResponseEntity; 9 | import org.springframework.web.bind.annotation.*; 10 | 11 | import java.util.concurrent.atomic.AtomicLong; 12 | 13 | /** 14 | * GitHub API 接口 15 | * 16 | * @author bingohuang 17 | */ 18 | @RestController 19 | @RequestMapping("v1") 20 | public class GitHubApiController { 21 | 22 | private final GitHubService gitHubService; 23 | 24 | private static final String template = "Hello, %s!"; 25 | private final AtomicLong counter = new AtomicLong(); 26 | 27 | @Autowired 28 | public GitHubApiController(GitHubService gitHubService) { 29 | this.gitHubService = gitHubService; 30 | } 31 | 32 | @GetMapping("user/{screenName}") 33 | public ResponseEntity discoverUserByScreenName(@PathVariable("screenName") String screenName) { 34 | return Optional.of(ResponseEntity.ok(gitHubService.discoverUserByScreenName(screenName))) 35 | .or(new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR)); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/java/com/bingohuang/info/GitHubService.java: -------------------------------------------------------------------------------- 1 | package com.bingohuang.info; 2 | 3 | /** 4 | * Author: bingohuang 5 | * Date: 06/12/2016 6 | * Time: 11:46 7 | */ 8 | public interface GitHubService { 9 | 10 | User discoverUserByScreenName(String name); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/java/com/bingohuang/info/GitHubServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.bingohuang.info; 2 | 3 | import org.apache.commons.logging.Log; 4 | import org.apache.commons.logging.LogFactory; 5 | import org.kohsuke.github.GitHub; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.io.IOException; 10 | import java.text.SimpleDateFormat; 11 | import java.util.Optional; 12 | 13 | /** 14 | * Author: bingohuang 15 | * Date: 06/12/2016 16 | * Time: 11:48 17 | */ 18 | @Service 19 | public class GitHubServiceImpl implements GitHubService { 20 | private final Log log = LogFactory.getLog(GitHubService.class); 21 | private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss"); 22 | 23 | private final GitHub github; 24 | private final UserRepository userRepository; 25 | 26 | @Autowired 27 | public GitHubServiceImpl(UserRepository userRepository) throws IOException { 28 | this.github = GitHub.connect(); 29 | this.userRepository = userRepository; 30 | } 31 | 32 | @Override 33 | public User discoverUserByScreenName(String screenName) { 34 | User user = null; 35 | 36 | try { 37 | user = Optional.of(github.getUser(screenName)) 38 | .map(User::new) 39 | .get(); 40 | 41 | userRepository.save(user); 42 | log.info(String.format("Discover user: %s", user.getScreenName())); 43 | } catch (IOException e) { 44 | e.printStackTrace(); 45 | } 46 | 47 | return user; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/java/com/bingohuang/info/User.java: -------------------------------------------------------------------------------- 1 | package com.bingohuang.info; 2 | 3 | import org.kohsuke.github.GHUser; 4 | import org.neo4j.ogm.annotation.GraphId; 5 | import org.neo4j.ogm.annotation.NodeEntity; 6 | 7 | import java.io.IOException; 8 | import java.io.Serializable; 9 | import java.util.Date; 10 | 11 | /** 12 | * Author: bingohuang 13 | * Date: 06/12/2016 14 | * Time: 11:33 15 | */ 16 | @NodeEntity 17 | public class User implements Serializable { 18 | @GraphId 19 | private Long id; 20 | 21 | private String profileId; 22 | 23 | private String screenName; 24 | private String name; 25 | private String url; 26 | private String profileImageUrl; 27 | private String description; 28 | private String location; 29 | private Date createdDate; 30 | private Integer followerCount; 31 | private Integer followsCount; 32 | 33 | public User() { 34 | } 35 | 36 | public User(Long id, String profileId) { 37 | this.id = id; 38 | this.profileId = profileId; 39 | } 40 | 41 | public User(GHUser ghUser) { 42 | this.profileId = String.valueOf(ghUser.getId()); 43 | this.screenName = ghUser.getLogin(); 44 | this.url = ghUser.getHtmlUrl().toString(); 45 | this.profileImageUrl = ghUser.getAvatarUrl(); 46 | try { 47 | this.name = ghUser.getName(); 48 | this.location = ghUser.getLocation(); 49 | this.followerCount = ghUser.getFollowersCount(); 50 | this.followsCount = ghUser.getFollowingCount(); 51 | } catch (IOException e) { 52 | e.printStackTrace(); 53 | } 54 | } 55 | 56 | public Long getId() { 57 | return id; 58 | } 59 | 60 | public void setId(Long id) { 61 | this.id = id; 62 | } 63 | 64 | public String getProfileId() { 65 | return profileId; 66 | } 67 | 68 | public void setProfileId(String profileId) { 69 | this.profileId = profileId; 70 | } 71 | 72 | public String getScreenName() { 73 | return screenName; 74 | } 75 | 76 | public void setScreenName(String screenName) { 77 | this.screenName = screenName; 78 | } 79 | 80 | public String getName() { 81 | return name; 82 | } 83 | 84 | public void setName(String name) { 85 | this.name = name; 86 | } 87 | 88 | public String getUrl() { 89 | return url; 90 | } 91 | 92 | public void setUrl(String url) { 93 | this.url = url; 94 | } 95 | 96 | public String getProfileImageUrl() { 97 | return profileImageUrl; 98 | } 99 | 100 | public void setProfileImageUrl(String profileImageUrl) { 101 | this.profileImageUrl = profileImageUrl; 102 | } 103 | 104 | public String getDescription() { 105 | return description; 106 | } 107 | 108 | public void setDescription(String description) { 109 | this.description = description; 110 | } 111 | 112 | public String getLocation() { 113 | return location; 114 | } 115 | 116 | public void setLocation(String location) { 117 | this.location = location; 118 | } 119 | 120 | public Date getCreatedDate() { 121 | return createdDate; 122 | } 123 | 124 | public void setCreatedDate(Date createdDate) { 125 | this.createdDate = createdDate; 126 | } 127 | 128 | public Integer getFollowerCount() { 129 | return followerCount; 130 | } 131 | 132 | public void setFollowerCount(Integer followerCount) { 133 | this.followerCount = followerCount; 134 | } 135 | 136 | public Integer getFollowsCount() { 137 | return followsCount; 138 | } 139 | 140 | public void setFollowsCount(Integer followsCount) { 141 | this.followsCount = followsCount; 142 | } 143 | 144 | @Override 145 | public String toString() { 146 | return "User{" + 147 | "id=" + id + 148 | ", profileId=" + profileId + 149 | ", screenName='" + screenName + '\'' + 150 | ", name='" + name + '\'' + 151 | ", url='" + url + '\'' + 152 | ", profileImageUrl='" + profileImageUrl + '\'' + 153 | ", description='" + description + '\'' + 154 | ", location='" + location + '\'' + 155 | ", createdDate=" + createdDate + 156 | ", followerCount=" + followerCount + 157 | ", followsCount=" + followsCount + 158 | '}'; 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/java/com/bingohuang/info/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.bingohuang.info; 2 | 3 | import org.springframework.data.neo4j.annotation.Query; 4 | import org.springframework.data.neo4j.repository.GraphRepository; 5 | import org.springframework.data.repository.query.Param; 6 | 7 | import java.util.List; 8 | import java.util.Set; 9 | 10 | /** 11 | * Author: bingohuang 12 | * Date: 06/12/2016 13 | * Time: 11:37 14 | */ 15 | public interface UserRepository extends GraphRepository { 16 | @Query("MATCH (user:User) WHERE has(user.screenName)\n" + 17 | "WITH user\n" + 18 | "ORDER BY user.screenName ASC\n" + 19 | "SKIP {skip}\n" + 20 | "LIMIT {limit}\n" + 21 | "RETURN user") 22 | Set findAllUsers(@Param("skip") Integer skip, @Param("limit") Integer limit); 23 | } 24 | -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=native-cloud-app 2 | 3 | #server.port=1989 4 | #spring.data.neo4j.username=neo4j 5 | #spring.data.neo4j.password=bingo -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring.profiles.active: 'dev' 2 | --- 3 | server: 4 | port: 1989 5 | spring: 6 | data: 7 | neo4j: 8 | uri: 'http://localhost:7474' 9 | username: 'neo4j' 10 | password: 'bingo' 11 | profiles: 'dev' 12 | --- 13 | server: 14 | port: 8080 15 | spring: 16 | data: 17 | neo4j: 18 | uri: 'http://neo4j:7474' 19 | username: 'neo4j' 20 | password: 'bingo' 21 | profiles: 'pro' -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/resources/static/assets/css/ie10-viewport-bug-workaround.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * IE10 viewport hack for Surface/desktop Windows 8 bug 3 | * Copyright 2014-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | /* 8 | * See the Getting Started docs for more information: 9 | * http://getbootstrap.com/getting-started/#support-ie10-width 10 | */ 11 | @-webkit-viewport { width: device-width; } 12 | @-moz-viewport { width: device-width; } 13 | @-ms-viewport { width: device-width; } 14 | @-o-viewport { width: device-width; } 15 | @viewport { width: device-width; } 16 | -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/resources/static/assets/js/ie-emulation-modes-warning.js: -------------------------------------------------------------------------------- 1 | // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT 2 | // IT'S JUST JUNK FOR OUR DOCS! 3 | // ++++++++++++++++++++++++++++++++++++++++++ 4 | /*! 5 | * Copyright 2014-2015 Twitter, Inc. 6 | * 7 | * Licensed under the Creative Commons Attribution 3.0 Unported License. For 8 | * details, see https://creativecommons.org/licenses/by/3.0/. 9 | */ 10 | // Intended to prevent false-positive bug reports about Bootstrap not working properly in old versions of IE due to folks testing using IE's unreliable emulation modes. 11 | (function () { 12 | 'use strict'; 13 | 14 | function emulatedIEMajorVersion() { 15 | var groups = /MSIE ([0-9.]+)/.exec(window.navigator.userAgent) 16 | if (groups === null) { 17 | return null 18 | } 19 | var ieVersionNum = parseInt(groups[1], 10) 20 | var ieMajorVersion = Math.floor(ieVersionNum) 21 | return ieMajorVersion 22 | } 23 | 24 | function actualNonEmulatedIEMajorVersion() { 25 | // Detects the actual version of IE in use, even if it's in an older-IE emulation mode. 26 | // IE JavaScript conditional compilation docs: https://msdn.microsoft.com/library/121hztk3%28v=vs.94%29.aspx 27 | // @cc_on docs: https://msdn.microsoft.com/library/8ka90k2e%28v=vs.94%29.aspx 28 | var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')() // jshint ignore:line 29 | if (jscriptVersion === undefined) { 30 | return 11 // IE11+ not in emulation mode 31 | } 32 | if (jscriptVersion < 9) { 33 | return 8 // IE8 (or lower; haven't tested on IE<8) 34 | } 35 | return jscriptVersion // IE9 or IE10 in any mode, or IE11 in non-IE11 mode 36 | } 37 | 38 | var ua = window.navigator.userAgent 39 | if (ua.indexOf('Opera') > -1 || ua.indexOf('Presto') > -1) { 40 | return // Opera, which might pretend to be IE 41 | } 42 | var emulated = emulatedIEMajorVersion() 43 | if (emulated === null) { 44 | return // Not IE 45 | } 46 | var nonEmulated = actualNonEmulatedIEMajorVersion() 47 | 48 | if (emulated !== nonEmulated) { 49 | window.alert('WARNING: You appear to be using IE' + nonEmulated + ' in IE' + emulated + ' emulation mode.\nIE emulation modes can behave significantly differently from ACTUAL older versions of IE.\nPLEASE DON\'T FILE BOOTSTRAP BUGS based on testing in IE emulation modes!') 50 | } 51 | })(); 52 | -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/resources/static/assets/js/ie10-viewport-bug-workaround.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * IE10 viewport hack for Surface/desktop Windows 8 bug 3 | * Copyright 2014-2015 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | // See the Getting Started docs for more information: 8 | // http://getbootstrap.com/getting-started/#support-ie10-width 9 | 10 | (function () { 11 | 'use strict'; 12 | 13 | if (navigator.userAgent.match(/IEMobile\/10\.0/)) { 14 | var msViewportStyle = document.createElement('style') 15 | msViewportStyle.appendChild( 16 | document.createTextNode( 17 | '@-ms-viewport{width:auto!important}' 18 | ) 19 | ) 20 | document.querySelector('head').appendChild(msViewportStyle) 21 | } 22 | 23 | })(); 24 | -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/resources/static/assets/js/vendor/holder.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | Holder - client side image placeholders 4 | Version 2.6.0+51ebp 5 | © 2015 Ivan Malopinsky - http://imsky.co 6 | 7 | Site: http://holderjs.com 8 | Issues: https://github.com/imsky/holder/issues 9 | License: http://opensource.org/licenses/MIT 10 | 11 | */ 12 | !function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):"object"==typeof exports?exports.Holder=b():a.Holder=b()}(this,function(){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){(function(b){function d(a,b,c,d){var g=e(c.substr(c.lastIndexOf(a.domain)),a);g&&f({mode:null,el:d,flags:g,engineSettings:b})}function e(a,b){for(var c={theme:y(K.settings.themes.gray,null),stylesheets:b.stylesheets,holderURL:[]},d=!1,e=String.fromCharCode(11),f=a.replace(/([^\\])\//g,"$1"+e).split(e),g=/%[0-9a-f]{2}/gi,h=f.length,i=0;h>i;i++){var j=f[i];if(j.match(g))try{j=decodeURIComponent(j)}catch(k){j=f[i]}var l=!1;if(K.flags.dimensions.match(j))d=!0,c.dimensions=K.flags.dimensions.output(j),l=!0;else if(K.flags.fluid.match(j))d=!0,c.dimensions=K.flags.fluid.output(j),c.fluid=!0,l=!0;else if(K.flags.textmode.match(j))c.textmode=K.flags.textmode.output(j),l=!0;else if(K.flags.colors.match(j)){var m=K.flags.colors.output(j);c.theme=y(c.theme,m),l=!0}else if(b.themes[j])b.themes.hasOwnProperty(j)&&(c.theme=y(b.themes[j],null)),l=!0;else if(K.flags.font.match(j))c.font=K.flags.font.output(j),l=!0;else if(K.flags.auto.match(j))c.auto=!0,l=!0;else if(K.flags.text.match(j))c.text=K.flags.text.output(j),l=!0;else if(K.flags.size.match(j))c.size=K.flags.size.output(j),l=!0;else if(K.flags.random.match(j)){null==K.vars.cache.themeKeys&&(K.vars.cache.themeKeys=Object.keys(b.themes));var n=K.vars.cache.themeKeys[0|Math.random()*K.vars.cache.themeKeys.length];c.theme=y(b.themes[n],null),l=!0}l&&c.holderURL.push(j)}return c.holderURL.unshift(b.domain),c.holderURL=c.holderURL.join("/"),d?c:!1}function f(a){var b=a.mode,c=a.el,d=a.flags,e=a.engineSettings,f=d.dimensions,h=d.theme,i=f.width+"x"+f.height;if(b=null==b?d.fluid?"fluid":"image":b,null!=d.text&&(h.text=d.text,"object"===c.nodeName.toLowerCase())){for(var l=h.text.split("\\n"),m=0;m1){var l=0,m=0,n=a.width*K.setup.lineWrapRatio,o=0;k=new e.Group("line"+o);for(var p=0;p=n||r===!0)&&(b(g,k,l,g.properties.leading),l=0,m+=g.properties.leading,o+=1,k=new e.Group("line"+o),k.y=m),r!==!0&&(j.moveTo(l,0),l+=h.spaceWidth+q.width,k.add(j))}b(g,k,l,g.properties.leading);for(var s in g.children)k=g.children[s],k.moveTo((g.width-k.width)/2,null,null);g.moveTo((a.width-g.width)/2,(a.height-g.height)/2,null),(a.height-g.height)/2<0&&g.moveTo(null,0,null)}else j=new e.Text(a.text),k=new e.Group("line0"),k.add(j),g.add(k),g.moveTo((a.width-h.boundingBox.width)/2,(a.height-h.boundingBox.height)/2,null);return d}function i(a,b,c){var d=parseInt(a,10),e=parseInt(b,10),f=Math.max(d,e),g=Math.min(d,e),h=.8*Math.min(g,f*K.defaults.scale);return Math.round(Math.max(c,h))}function j(a){var b;b=null==a||null==a.nodeType?K.vars.resizableImages:[a];for(var c=0,d=b.length;d>c;c++){var e=b[c];if(e.holderData){var f=e.holderData.flags,h=E(e);if(h){if(!e.holderData.resizeUpdate)continue;if(f.fluid&&f.auto){var i=e.holderData.fluidConfig;switch(i.mode){case"width":h.height=h.width/i.ratio;break;case"height":h.width=h.height*i.ratio}}var j={mode:"image",holderSettings:{dimensions:h,theme:f.theme,flags:f},el:e,engineSettings:e.holderData.engineSettings};"exact"==f.textmode&&(f.exactDimensions=h,j.holderSettings.dimensions=f.dimensions),g(j)}else n(e)}}}function k(a){if(a.holderData){var b=E(a);if(b){var c=a.holderData.flags,d={fluidHeight:"%"==c.dimensions.height.slice(-1),fluidWidth:"%"==c.dimensions.width.slice(-1),mode:null,initialDimensions:b};d.fluidWidth&&!d.fluidHeight?(d.mode="width",d.ratio=d.initialDimensions.width/parseFloat(c.dimensions.height)):!d.fluidWidth&&d.fluidHeight&&(d.mode="height",d.ratio=parseFloat(c.dimensions.width)/d.initialDimensions.height),a.holderData.fluidConfig=d}else n(a)}}function l(){for(var a,c=[],d=Object.keys(K.vars.invisibleImages),e=0,f=d.length;f>e;e++)a=K.vars.invisibleImages[d[e]],E(a)&&"img"==a.nodeName.toLowerCase()&&(c.push(a),delete K.vars.invisibleImages[d[e]]);c.length&&J.run({images:c}),b.requestAnimationFrame(l)}function m(){K.vars.visibilityCheckStarted||(b.requestAnimationFrame(l),K.vars.visibilityCheckStarted=!0)}function n(a){a.holderData.invisibleId||(K.vars.invisibleId+=1,K.vars.invisibleImages["i"+K.vars.invisibleId]=a,a.holderData.invisibleId=K.vars.invisibleId)}function o(a,b){return null==b?document.createElement(a):document.createElementNS(b,a)}function p(a,b){for(var c in b)a.setAttribute(c,b[c])}function q(a,b,c){var d,e;null==a?(a=o("svg",F),d=o("defs",F),e=o("style",F),p(e,{type:"text/css"}),d.appendChild(e),a.appendChild(d)):e=a.querySelector("style"),a.webkitMatchesSelector&&a.setAttribute("xmlns",F);for(var f=0;f=0;h--){var i=g.createProcessingInstruction("xml-stylesheet",'href="'+f[h]+'" rel="stylesheet"');g.insertBefore(i,g.firstChild)}var j=g.createProcessingInstruction("xml",'version="1.0" encoding="UTF-8" standalone="yes"');g.insertBefore(j,g.firstChild),g.removeChild(g.documentElement),e=d.serializeToString(g)}var k=d.serializeToString(a);return k=k.replace(/\&(\#[0-9]{2,}\;)/g,"&$1"),e+k}}function s(){return b.DOMParser?(new DOMParser).parseFromString("","application/xml"):void 0}function t(a){K.vars.debounceTimer||a.call(this),K.vars.debounceTimer&&b.clearTimeout(K.vars.debounceTimer),K.vars.debounceTimer=b.setTimeout(function(){K.vars.debounceTimer=null,a.call(this)},K.setup.debounce)}function u(){t(function(){j(null)})}var v=c(1),w=c(2),x=c(3),y=x.extend,z=x.cssProps,A=x.encodeHtmlEntity,B=x.decodeHtmlEntity,C=x.imageExists,D=x.getNodeArray,E=x.dimensionCheck,F="http://www.w3.org/2000/svg",G=8,H="2.6.0",I="\nCreated with Holder.js "+H+".\nLearn more at http://holderjs.com\n(c) 2012-2015 Ivan Malopinsky - http://imsky.co\n",J={version:H,addTheme:function(a,b){return null!=a&&null!=b&&(K.settings.themes[a]=b),delete K.vars.cache.themeKeys,this},addImage:function(a,b){var c=document.querySelectorAll(b);if(c.length)for(var d=0,e=c.length;e>d;d++){var f=o("img"),g={};g[K.vars.dataAttr]=a,p(f,g),c[d].appendChild(f)}return this},setResizeUpdate:function(a,b){a.holderData&&(a.holderData.resizeUpdate=!!b,a.holderData.resizeUpdate&&j(a))},run:function(a){a=a||{};var c={},g=y(K.settings,a);K.vars.preempted=!0,K.vars.dataAttr=g.dataAttr||K.vars.dataAttr,c.renderer=g.renderer?g.renderer:K.setup.renderer,-1===K.setup.renderers.join(",").indexOf(c.renderer)&&(c.renderer=K.setup.supportsSVG?"svg":K.setup.supportsCanvas?"canvas":"html");var h=D(g.images),i=D(g.bgnodes),j=D(g.stylenodes),k=D(g.objects);c.stylesheets=[],c.svgXMLStylesheet=!0,c.noFontFallback=g.noFontFallback?g.noFontFallback:!1;for(var l=0;l1){c.nodeValue="";for(var u=0;u=0?b:1)}function f(a){v?e(a):w.push(a)}null==document.readyState&&document.addEventListener&&(document.addEventListener("DOMContentLoaded",function y(){document.removeEventListener("DOMContentLoaded",y,!1),document.readyState="complete"},!1),document.readyState="loading");var g=a.document,h=g.documentElement,i="load",j=!1,k="on"+i,l="complete",m="readyState",n="attachEvent",o="detachEvent",p="addEventListener",q="DOMContentLoaded",r="onreadystatechange",s="removeEventListener",t=p in g,u=j,v=j,w=[];if(g[m]===l)e(b);else if(t)g[p](q,c,j),a[p](i,c,j);else{g[n](r,c),a[n](k,c);try{u=null==a.frameElement&&h}catch(x){}u&&u.doScroll&&!function z(){if(!v){try{u.doScroll("left")}catch(a){return e(z,50)}d(),b()}}()}return f.version="1.4.0",f.isReady=function(){return v},f}a.exports="undefined"!=typeof window&&b(window)},function(a,b,c){var d=c(4),e=function(a){function b(a,b){for(var c in b)a[c]=b[c];return a}var c=1,e=d.defclass({constructor:function(a){c++,this.parent=null,this.children={},this.id=c,this.name="n"+c,null!=a&&(this.name=a),this.x=0,this.y=0,this.z=0,this.width=0,this.height=0},resize:function(a,b){null!=a&&(this.width=a),null!=b&&(this.height=b)},moveTo:function(a,b,c){this.x=null!=a?a:this.x,this.y=null!=b?b:this.y,this.z=null!=c?c:this.z},add:function(a){var b=a.name;if(null!=this.children[b])throw"SceneGraph: child with that name already exists: "+b;this.children[b]=a,a.parent=this}}),f=d(e,function(b){this.constructor=function(){b.constructor.call(this,"root"),this.properties=a}}),g=d(e,function(a){function c(c,d){if(a.constructor.call(this,c),this.properties={fill:"#000"},null!=d)b(this.properties,d);else if(null!=c&&"string"!=typeof c)throw"SceneGraph: invalid node name"}this.Group=d.extend(this,{constructor:c,type:"group"}),this.Rect=d.extend(this,{constructor:c,type:"rect"}),this.Text=d.extend(this,{constructor:function(a){c.call(this),this.properties.text=a},type:"text"})}),h=new f;return this.Shape=g,this.root=h,this};a.exports=e},function(a,b){(function(a){b.extend=function(a,b){var c={};for(var d in a)a.hasOwnProperty(d)&&(c[d]=a[d]);if(null!=b)for(var e in b)b.hasOwnProperty(e)&&(c[e]=b[e]);return c},b.cssProps=function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c+":"+a[c]);return b.join(";")},b.encodeHtmlEntity=function(a){for(var b=[],c=0,d=a.length-1;d>=0;d--)c=a.charCodeAt(d),b.unshift(c>128?["",c,";"].join(""):a[d]);return b.join("")},b.getNodeArray=function(b){var c=null;return"string"==typeof b?c=document.querySelectorAll(b):a.NodeList&&b instanceof a.NodeList?c=b:a.Node&&b instanceof a.Node?c=[b]:a.HTMLCollection&&b instanceof a.HTMLCollection?c=b:b instanceof Array?c=b:null===b&&(c=[]),c},b.imageExists=function(a,b){var c=new Image;c.onerror=function(){b.call(this,!1)},c.onload=function(){b.call(this,!0)},c.src=a},b.decodeHtmlEntity=function(a){return a.replace(/(\d+);/g,function(a,b){return String.fromCharCode(b)})},b.dimensionCheck=function(a){var b={height:a.clientHeight,width:a.clientWidth};return b.height&&b.width?b:!1}}).call(b,function(){return this}())},function(a){var b=function(){},c=Array.prototype.slice,d=function(a,d){var e=b.prototype="function"==typeof a?a.prototype:a,f=new b,g=d.apply(f,c.call(arguments,2).concat(e));if("object"==typeof g)for(var h in g)f[h]=g[h];if(!f.hasOwnProperty("constructor"))return f;var i=f.constructor;return i.prototype=f,i};d.defclass=function(a){var b=a.constructor;return b.prototype=a,b},d.extend=function(a,b){return d(a,function(a){return this.uber=a,b})},a.exports=d}])}); -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/resources/static/css/dashboard.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Base structure 3 | */ 4 | 5 | /* Move down content because we have a fixed navbar that is 50px tall */ 6 | body { 7 | padding-top: 50px; 8 | } 9 | 10 | /* 11 | * Global add-ons 12 | */ 13 | 14 | .sub-header { 15 | padding-bottom: 10px; 16 | border-bottom: 1px solid #eee; 17 | } 18 | 19 | /* 20 | * Top navigation 21 | * Hide default border to remove 1px line. 22 | */ 23 | .navbar-fixed-top { 24 | border: 0; 25 | } 26 | 27 | /* 28 | * Sidebar 29 | */ 30 | 31 | /* Hide for mobile, show later */ 32 | .sidebar { 33 | display: none; 34 | } 35 | 36 | @media (min-width: 768px) { 37 | .sidebar { 38 | position: fixed; 39 | top: 51px; 40 | bottom: 0; 41 | left: 0; 42 | z-index: 1000; 43 | display: block; 44 | padding: 20px; 45 | overflow-x: hidden; 46 | overflow-y: auto; /* Scrollable contents if viewport is shorter than content. */ 47 | background-color: #f5f5f5; 48 | border-right: 1px solid #eee; 49 | } 50 | } 51 | 52 | /* Sidebar navigation */ 53 | .nav-sidebar { 54 | margin-right: -21px; /* 20px padding + 1px border */ 55 | margin-bottom: 20px; 56 | margin-left: -20px; 57 | } 58 | 59 | .nav-sidebar > li > a { 60 | padding-right: 20px; 61 | padding-left: 20px; 62 | } 63 | 64 | .nav-sidebar > .active > a, 65 | .nav-sidebar > .active > a:hover, 66 | .nav-sidebar > .active > a:focus { 67 | color: #fff; 68 | background-color: #428bca; 69 | } 70 | 71 | /* 72 | * Main content 73 | */ 74 | 75 | .main { 76 | padding: 20px; 77 | } 78 | 79 | @media (min-width: 768px) { 80 | .main { 81 | padding-right: 40px; 82 | padding-left: 40px; 83 | } 84 | } 85 | 86 | .main .page-header { 87 | margin-top: 0; 88 | } 89 | 90 | /* 91 | * Placeholder dashboard ideas 92 | */ 93 | 94 | .placeholders { 95 | text-align: center; 96 | } 97 | 98 | .placeholders h4 { 99 | margin-bottom: 0; 100 | } 101 | 102 | .placeholder { 103 | margin-top: 1em; 104 | } 105 | 106 | .placeholder img { 107 | display: inline-block; 108 | border-radius: 50%; 109 | } 110 | 111 | .placeholder .img-profile-dashboard { 112 | max-height: 6em; 113 | width: auto; 114 | } 115 | 116 | .placeholder .img-profile-row { 117 | max-height: 200px; 118 | width: auto; 119 | } 120 | -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/resources/static/css/main.css: -------------------------------------------------------------------------------- 1 | .fa-caret-up { 2 | color: green; 3 | text-shadow: 1px 1px 1px #ccc; 4 | font-size: 1.75em !important; 5 | } 6 | 7 | .fa-caret-down { 8 | color: red; 9 | text-shadow: 1px 1px 1px #ccc; 10 | font-size: 1.75em !important; 11 | } 12 | 13 | .fa-minus { 14 | color: #999; 15 | text-shadow: 1px 1px 1px #ccc; 16 | font-size: 1em !important; 17 | } 18 | 19 | .fa-plus { 20 | font-size: 1em !important; 21 | color: green; 22 | text-shadow: 1px 1px 1px #ccc; 23 | } 24 | 25 | .h1, h1 { 26 | font-size: 26px; 27 | } 28 | 29 | .h2, h2 { 30 | font-size: 24px; 31 | } 32 | 33 | .table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td, .table > tfoot > tr > th, .table > thead > tr > td, .table > thead > tr > th { 34 | vertical-align: middle; 35 | } 36 | 37 | .rank-col { 38 | text-align: center; 39 | font-weight: 400; 40 | } 41 | 42 | .add-profile { 43 | padding: 1em; 44 | } 45 | 46 | .loader { 47 | background: rgba(50, 50, 50, 0.9) none repeat scroll 0 0; 48 | height: 100%; 49 | margin-bottom: 0; 50 | position: fixed; 51 | top: 0; 52 | vertical-align: middle; 53 | width: 100%; 54 | z-index: 1040; 55 | } 56 | 57 | .glyphicon-exclamation-sign { 58 | font-size: 2.5em; 59 | color: white; 60 | top: 50%; 61 | position: fixed; 62 | text-shadow: 1px 1px 1px #555; 63 | } 64 | 65 | .glyphicon-refresh-animate { 66 | -animation: spin .7s infinite linear; 67 | -ms-animation: spin .7s infinite linear; 68 | -webkit-animation: spinw .7s infinite linear; 69 | -moz-animation: spinm .7s infinite linear; 70 | font-size: 2.5em; 71 | color: black; 72 | top: 50%; 73 | position: fixed; 74 | } 75 | 76 | @keyframes spin { 77 | from { 78 | transform: scale(1) rotate(0deg); 79 | } 80 | to { 81 | transform: scale(1) rotate(360deg); 82 | } 83 | } 84 | 85 | @-webkit-keyframes spinw { 86 | from { 87 | -webkit-transform: rotate(0deg); 88 | } 89 | to { 90 | -webkit-transform: rotate(360deg); 91 | } 92 | } 93 | 94 | @-moz-keyframes spinm { 95 | from { 96 | -moz-transform: rotate(0deg); 97 | } 98 | to { 99 | -moz-transform: rotate(360deg); 100 | } 101 | } 102 | 103 | @media (max-width: 768px) { 104 | body { 105 | font-size: 12px; 106 | } 107 | 108 | .h1, h1 { 109 | font-size: 24px; 110 | } 111 | 112 | .h4, h4 { 113 | font-size: 14px; 114 | } 115 | 116 | .h2, h2 { 117 | font-size: 20px; 118 | } 119 | } 120 | 121 | @media (max-width: 320px) { 122 | body { 123 | font-size: 14px; 124 | } 125 | } -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/resources/static/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/163yun/cloud-native-app-sample/49657fa1039d6c2fa5886f31387953008ae76d41/native-cloud-app-2/src/main/resources/static/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/resources/static/dist/fonts/glyphicons-halflings-regular.eot?: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/163yun/cloud-native-app-sample/49657fa1039d6c2fa5886f31387953008ae76d41/native-cloud-app-2/src/main/resources/static/dist/fonts/glyphicons-halflings-regular.eot? -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/resources/static/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/163yun/cloud-native-app-sample/49657fa1039d6c2fa5886f31387953008ae76d41/native-cloud-app-2/src/main/resources/static/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/resources/static/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/163yun/cloud-native-app-sample/49657fa1039d6c2fa5886f31387953008ae76d41/native-cloud-app-2/src/main/resources/static/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/resources/static/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/163yun/cloud-native-app-sample/49657fa1039d6c2fa5886f31387953008ae76d41/native-cloud-app-2/src/main/resources/static/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/163yun/cloud-native-app-sample/49657fa1039d6c2fa5886f31387953008ae76d41/native-cloud-app-2/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/resources/static/fonts/glyphicons-halflings-regular.eot?: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/163yun/cloud-native-app-sample/49657fa1039d6c2fa5886f31387953008ae76d41/native-cloud-app-2/src/main/resources/static/fonts/glyphicons-halflings-regular.eot? -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/163yun/cloud-native-app-sample/49657fa1039d6c2fa5886f31387953008ae76d41/native-cloud-app-2/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/163yun/cloud-native-app-sample/49657fa1039d6c2fa5886f31387953008ae76d41/native-cloud-app-2/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/163yun/cloud-native-app-sample/49657fa1039d6c2fa5886f31387953008ae76d41/native-cloud-app-2/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/resources/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Spring Boot - GitHub Discovery 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 45 | Toggle navigation 46 | 47 | 48 | 49 | 50 | 云计算书籍示例-GitHub用户爬虫 51 | 52 | 53 | 54 | 书籍 55 | GitHub 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 面板 66 | 67 | 68 | 注:完善爬虫功能后,后台将自动抓取用户的好友信息 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | Add GitHub Profile 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | × 89 | 添加 GitHub 用户 90 | 91 | 92 | 93 | 94 | GitHub 用户名 95 | 96 | @ 97 | 99 | 100 | 101 | 102 | 103 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 抓取的用户配置 116 | 排名靠前的几位用户 117 | 118 | 119 | 120 | 121 | Rank 122 | 头像 123 | 姓名 124 | Profile 125 | Following 126 | Followers 127 | PageRank 128 | Change 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/resources/static/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.6 (http://getbootstrap.com) 3 | * Copyright 2011-2015 Twitter, Inc. 4 | * Licensed under the MIT license 5 | */ 6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>2)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.6",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.6",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.6",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.6",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.6",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.6",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.6",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); -------------------------------------------------------------------------------- /native-cloud-app-2/src/main/resources/static/js/main.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | 3 | $('#myModal').on('shown.bs.modal', function () { 4 | $('#myInput').focus() 5 | $('#add-profile-form').bootstrapValidator('resetForm', true); 6 | }) 7 | 8 | $('#add-profile-form').bootstrapValidator({ 9 | feedbackIcons: { 10 | valid: 'glyphicon glyphicon-ok', 11 | invalid: 'glyphicon glyphicon-remove', 12 | validating: 'glyphicon glyphicon-refresh' 13 | }, 14 | submitHandler: function (validator, form, submitButton) { 15 | var screenName = $("#gitHubHandle").val(); 16 | $(".loader").show(); 17 | 18 | $.ajax({ 19 | url: '/v1/user/' + screenName, 20 | type: "get", 21 | dataType: "json", 22 | success: function (data) { 23 | $(".loader").hide(); 24 | $('#myModal').modal("hide"); 25 | $("#dashboard-header").html(""); 26 | location.reload(); 27 | }, 28 | error: function (xhr, status) { 29 | $(".loader").hide(); 30 | $("#add-profile-form").data('bootstrapValidator').updateStatus("gitHubHandle", "INVALID", "callback") 31 | } 32 | }); 33 | }, 34 | fields: { 35 | gitHubHandle: { 36 | validators: { 37 | notEmpty: { 38 | message: 'A valid GitHub profile handle is required' 39 | }, 40 | callback: { 41 | message: 'An error occurred', 42 | callback: function (value, validator) { 43 | return true; 44 | } 45 | } 46 | } 47 | } 48 | } 49 | }); 50 | 51 | $.ajax({ 52 | url: '/users/search/findAllUsers?skip=0&limit=100', 53 | type: "get", 54 | dataType: "json", 55 | success: function (data) { 56 | $(".loader").hide(); 57 | drawTable(data._embedded.users); 58 | drawDashboardHeader(data._embedded.users) 59 | }, 60 | error: function (xhr, status) { 61 | $(".glyphicon-refresh") 62 | .removeClass("glyphicon-refresh") 63 | .removeClass("glyphicon-refresh-animate") 64 | .addClass("glyphicon-exclamation-sign") 65 | } 66 | }); 67 | 68 | function drawTable(data) { 69 | for (var i = 0; i < data.length; i++) { 70 | drawRow(data[i]); 71 | } 72 | } 73 | 74 | function drawDashboardHeader(data) { 75 | 76 | data.sort(function (a, b) { 77 | return a.discoveredRank - b.discoveredRank; 78 | }); 79 | 80 | for (var i = 0; i < Math.min(data.length, 3); i++) { 81 | drawSpotlight(data[i]); 82 | } 83 | } 84 | 85 | function drawSpotlight(rowData) { 86 | var row = $('@' + rowData.screenName + ' ' + rowData.name + '') 87 | $("#dashboard-header").append(row); 88 | } 89 | 90 | function drawRow(rowData) { 91 | var row = $("") 92 | $("#personDataTable").append(row); 93 | 94 | var currentRank = rowData.currentRank == null ? "" : rowData.currentRank + "."; 95 | 96 | row.append($("" + currentRank + "")); 97 | row.append($("")); 98 | row.append($("" + rowData.name + "")); 99 | row.append($("@" + rowData.screenName + "")); 100 | row.append($("" + rowData.followsCount + "")); 101 | row.append($("" + rowData.followerCount + "")); 102 | row.append($("" + rowData.pagerank + "")); 103 | 104 | var change = (((rowData.previousRank == 0) ? rowData.currentRank : rowData.previousRank) - rowData.currentRank); 105 | var arrowChange = change > 0 ? "fa fa-caret-up" : change < 0 ? "fa fa-caret-down" : (rowData.previousRank == 0) ? "fa fa-caret-up" : "fa fa-minus"; 106 | 107 | row.append($("")); 108 | } 109 | }); -------------------------------------------------------------------------------- /native-cloud-app-2/src/test/java/com/bingohuang/api/GitHubApiControllerTest.java: -------------------------------------------------------------------------------- 1 | package com.bingohuang.api; 2 | 3 | import com.bingohuang.info.User; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.boot.context.embedded.LocalServerPort; 8 | import org.springframework.boot.test.context.SpringBootTest; 9 | import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; 10 | import org.springframework.boot.test.web.client.TestRestTemplate; 11 | import org.springframework.http.HttpStatus; 12 | import org.springframework.http.ResponseEntity; 13 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 14 | 15 | import static org.junit.Assert.assertEquals; 16 | 17 | /** 18 | * Author: bingohuang 19 | * Date: 07/12/2016 20 | * Time: 16:28 21 | */ 22 | @RunWith(SpringJUnit4ClassRunner.class) 23 | @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) 24 | public class GitHubApiControllerTest { 25 | 26 | @LocalServerPort 27 | private int port; 28 | 29 | @Autowired 30 | private TestRestTemplate restTemplate; 31 | 32 | @Test 33 | public void testDiscoverUserByScreenName() throws Exception { 34 | ResponseEntity user1 = restTemplate.getForEntity("http://localhost:" + port + "/v1/user/bingohuang", User.class); 35 | assertEquals(HttpStatus.OK, user1.getStatusCode()); 36 | 37 | ResponseEntity user2 = restTemplate.getForEntity("http://localhost:" + port + "/v1/user/163yun", User.class); 38 | assertEquals(HttpStatus.OK, user2.getStatusCode()); 39 | 40 | ResponseEntity user3 = restTemplate.getForEntity("http://localhost:" + port + "/v1/user/huangqingbing", User.class); 41 | assertEquals(HttpStatus.OK, user3.getStatusCode()); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /native-cloud-app-2/start.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # start neo4j docker container 4 | function neo4j-docker() { 5 | docker run -d \ 6 | --publish=7474:7474 \ 7 | --volume=$HOME/neo4j/2.3/data:/data \ 8 | --name=neo4j-2.3 \ 9 | hub.c.163.com/bingohuang/neo4j:2.3 10 | 11 | 12 | } 13 | 14 | # change neo4j password 15 | function neo4j-password() { 16 | curl -v -u neo4j:neo4j -X POST localhost:7474/user/neo4j/password -H 'Content-type:application/json' -d '{"password":"bingo"}' 17 | } 18 | 19 | 20 | function help() { 21 | echo "$0 neo4j|app" 22 | } 23 | 24 | if [ "$1" == "" ]; then 25 | help 26 | elif [ "$1" == "neo4j-docker" ];then 27 | neo4j-docker 28 | elif [ "$1" == "neo4j-password" ];then 29 | neo4j-password 30 | elif [ "$1" == "app" ];then 31 | app 32 | else 33 | help 34 | fi --------------------------------------------------------------------------------
排名靠前的几位用户