├── .gitattributes ├── mmc-dubbo-doe ├── src │ ├── main │ │ ├── resources │ │ │ ├── static │ │ │ │ └── v3 │ │ │ │ │ ├── js │ │ │ │ │ ├── pom.js │ │ │ │ │ ├── Nora.js │ │ │ │ │ └── echartUtils.js │ │ │ │ │ └── assets │ │ │ │ │ ├── login │ │ │ │ │ ├── 21.gif │ │ │ │ │ └── images │ │ │ │ │ │ └── pattern.jpg │ │ │ │ │ ├── avatars │ │ │ │ │ ├── Thumbs.db │ │ │ │ │ ├── avatar.png │ │ │ │ │ ├── user.jpg │ │ │ │ │ ├── avatar1.png │ │ │ │ │ ├── avatar2.png │ │ │ │ │ ├── avatar3.png │ │ │ │ │ ├── avatar4.png │ │ │ │ │ ├── avatar5.png │ │ │ │ │ ├── person_1.png │ │ │ │ │ ├── person_2.png │ │ │ │ │ └── profile-pic.jpg │ │ │ │ │ ├── images │ │ │ │ │ ├── pattern.jpg │ │ │ │ │ └── gallery │ │ │ │ │ │ ├── image-1.jpg │ │ │ │ │ │ ├── image-2.jpg │ │ │ │ │ │ ├── image-3.jpg │ │ │ │ │ │ ├── image-4.jpg │ │ │ │ │ │ ├── image-5.jpg │ │ │ │ │ │ ├── image-6.jpg │ │ │ │ │ │ ├── thumb-1.jpg │ │ │ │ │ │ ├── thumb-2.jpg │ │ │ │ │ │ ├── thumb-3.jpg │ │ │ │ │ │ ├── thumb-4.jpg │ │ │ │ │ │ ├── thumb-5.jpg │ │ │ │ │ │ └── thumb-6.jpg │ │ │ │ │ ├── css │ │ │ │ │ ├── images │ │ │ │ │ │ ├── Thumbs.db │ │ │ │ │ │ └── loading.gif │ │ │ │ │ ├── multiple-select.png │ │ │ │ │ ├── jquery-ui-1.10.3.full.min.css │ │ │ │ │ ├── jquery.gritter.css │ │ │ │ │ ├── jquery-ui-1.10.3.custom.min.css │ │ │ │ │ ├── colorpicker.css │ │ │ │ │ └── bootstrap-timepicker.css │ │ │ │ │ ├── font │ │ │ │ │ ├── fontawesome-webfont.woff │ │ │ │ │ ├── DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff │ │ │ │ │ ├── cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff │ │ │ │ │ └── fonts.googleapis.com.css │ │ │ │ │ └── js │ │ │ │ │ ├── jquery.ui.touch-punch.min.js │ │ │ │ │ ├── jquery.hotkeys.min.js │ │ │ │ │ ├── flot │ │ │ │ │ └── jquery.flot.resize.min.js │ │ │ │ │ ├── dataTables.bootstrap.min.js │ │ │ │ │ ├── fuelux │ │ │ │ │ ├── fuelux.wizard.min.js │ │ │ │ │ ├── fuelux.spinner.min.js │ │ │ │ │ └── fuelux.tree.min.js │ │ │ │ │ ├── jquery.autosize.min.js │ │ │ │ │ ├── jquery.easy-pie-chart.min.js │ │ │ │ │ ├── bootstrap-tag.min.js │ │ │ │ │ ├── jquery.maskedinput.min.js │ │ │ │ │ ├── bootstrap-wysiwyg.min.js │ │ │ │ │ └── respond.min.js │ │ │ ├── application.yml │ │ │ ├── registry.json │ │ │ ├── templates │ │ │ │ ├── index.html │ │ │ │ └── pages │ │ │ │ │ └── tpl │ │ │ │ │ ├── head.html │ │ │ │ │ ├── bread.html │ │ │ │ │ ├── foot.html │ │ │ │ │ └── top.html │ │ │ ├── application-dev.yml │ │ │ └── application-prd.yml │ │ └── java │ │ │ └── com │ │ │ └── mmc │ │ │ └── dubbo │ │ │ └── doe │ │ │ ├── dto │ │ │ ├── CaseModelDTO.java │ │ │ ├── UrlModelDTO.java │ │ │ ├── PomDTO.java │ │ │ ├── BaseDTO.java │ │ │ ├── MethodModelDTO.java │ │ │ └── ConnectDTO.java │ │ │ ├── model │ │ │ ├── ServiceModel.java │ │ │ ├── RegistryModel.java │ │ │ ├── PointModel.java │ │ │ ├── UrlModel.java │ │ │ ├── CaseModel.java │ │ │ ├── PomModel.java │ │ │ └── MethodModel.java │ │ │ ├── exception │ │ │ └── DoeException.java │ │ │ ├── DubboDoeApplication.java │ │ │ ├── service │ │ │ ├── MenuService.java │ │ │ ├── TelnetService.java │ │ │ ├── CaseService.java │ │ │ ├── ConfigService.java │ │ │ ├── ClassService.java │ │ │ ├── ConnectService.java │ │ │ ├── impl │ │ │ │ └── CaseServiceImpl.java │ │ │ └── PomService.java │ │ │ ├── dao │ │ │ └── CaseDAO.java │ │ │ ├── auth │ │ │ ├── MenuNode.java │ │ │ └── MenuTree.java │ │ │ ├── util │ │ │ ├── StringUtil.java │ │ │ ├── JsonFileUtil.java │ │ │ ├── MD5Util.java │ │ │ └── FileUtil.java │ │ │ ├── context │ │ │ ├── Const.java │ │ │ ├── ApplicationReadyEventListener.java │ │ │ ├── ResponseDispatcher.java │ │ │ └── TaskContainer.java │ │ │ ├── client │ │ │ └── DoeClient.java │ │ │ ├── crontroller │ │ │ ├── SysConfController.java │ │ │ ├── CaseController.java │ │ │ ├── HomeController.java │ │ │ └── RegistryController.java │ │ │ ├── cache │ │ │ ├── UrlCaches.java │ │ │ ├── MethodCaches.java │ │ │ └── CuratorCaches.java │ │ │ └── handler │ │ │ ├── SendReceiveHandler.java │ │ │ └── StreamHandler.java │ └── test │ │ ├── java │ │ └── com │ │ │ └── mmc │ │ │ └── dubbo │ │ │ └── doe │ │ │ ├── DubboDoeApplicationTests.java │ │ │ └── test │ │ │ ├── TestLogback.java │ │ │ ├── TestNumber.java │ │ │ ├── TestDoeClassLoader.java │ │ │ ├── TestParam.java │ │ │ ├── TestFuture.java │ │ │ ├── TestRedisTemplate.java │ │ │ ├── TestRedisResolver.java │ │ │ ├── TestProcessClient.java │ │ │ ├── TestTelnetService.java │ │ │ ├── TestCaseService.java │ │ │ ├── TestDoeClient.java │ │ │ ├── TestCuratorHandler.java │ │ │ ├── TestClassService.java │ │ │ ├── TestDemo.java │ │ │ ├── TestConnectService.java │ │ │ ├── TestTime.java │ │ │ └── TestConfigService.java │ │ └── resources │ │ └── test-pom.xml └── .gitignore ├── deploy ├── easy.png ├── normal.png ├── qrcode_for_gh_0c6aeb037ce4_258.jpg ├── pom.xml ├── pom.xml.backup ├── deploy.sh └── SimpleHttpServer.py ├── .gitignore ├── mmc-dubbo-api ├── .gitignore ├── src │ └── main │ │ └── java │ │ └── com │ │ └── mmc │ │ └── dubbo │ │ └── api │ │ └── user │ │ ├── UserService.java │ │ ├── GenericResp.java │ │ ├── GenericReq.java │ │ └── UserFact.java └── pom.xml ├── mmc-dubbo-provider ├── .gitignore ├── src │ └── main │ │ ├── resources │ │ └── application.yml │ │ └── java │ │ └── com │ │ └── mmc │ │ └── dubbo │ │ └── provider │ │ ├── DubboProviderApplication.java │ │ └── user │ │ ├── UserMemberServiceImpl.java │ │ └── UserFeedbackServiceImpl.java └── pom.xml ├── UPGRADE.md └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | *.js linguist-language=Java 2 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/js/pom.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deploy/easy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/deploy/easy.png -------------------------------------------------------------------------------- /deploy/normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/deploy/normal.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ##ignore this file## 2 | .idea/ 3 | target 4 | target/ 5 | *.iml 6 | 7 | -------------------------------------------------------------------------------- /mmc-dubbo-api/.gitignore: -------------------------------------------------------------------------------- 1 | ##ignore this file## 2 | .idea/ 3 | target 4 | target/ 5 | *.iml 6 | -------------------------------------------------------------------------------- /mmc-dubbo-provider/.gitignore: -------------------------------------------------------------------------------- 1 | ##ignore this file## 2 | .idea/ 3 | target 4 | target/ 5 | *.iml 6 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | profiles: 3 | active: @spring.profiles.active@ 4 | 5 | -------------------------------------------------------------------------------- /deploy/qrcode_for_gh_0c6aeb037ce4_258.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/deploy/qrcode_for_gh_0c6aeb037ce4_258.jpg -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/registry.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "registryKey": "127.0.0.1:2181", 4 | "registryDesc": "localhost -- 127.0.0.1:2181" 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/login/21.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/login/21.gif -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/Thumbs.db -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/avatar.png -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/user.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/user.jpg -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/images/pattern.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/images/pattern.jpg -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/avatar1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/avatar1.png -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/avatar2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/avatar2.png -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/avatar3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/avatar3.png -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/avatar4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/avatar4.png -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/avatar5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/avatar5.png -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/person_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/person_1.png -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/person_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/person_2.png -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/css/images/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/css/images/Thumbs.db -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/profile-pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/avatars/profile-pic.jpg -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/css/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/css/images/loading.gif -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/css/multiple-select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/css/multiple-select.png -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/login/images/pattern.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/login/images/pattern.jpg -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/image-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/image-1.jpg -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/image-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/image-2.jpg -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/image-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/image-3.jpg -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/image-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/image-4.jpg -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/image-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/image-5.jpg -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/image-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/image-6.jpg -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/thumb-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/thumb-1.jpg -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/thumb-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/thumb-2.jpg -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/thumb-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/thumb-3.jpg -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/thumb-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/thumb-4.jpg -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/thumb-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/thumb-5.jpg -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/thumb-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/images/gallery/thumb-6.jpg -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/font/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/font/fontawesome-webfont.woff -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/css/jquery-ui-1.10.3.full.min.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/css/jquery-ui-1.10.3.full.min.css -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/font/DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/font/DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/font/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VIPJoey/doe/HEAD/mmc-dubbo-doe/src/main/resources/static/v3/assets/font/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | welcome to doe.
9 | 10 | 连接管理
11 | 增加JAR向导
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/font/fonts.googleapis.com.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Open Sans'; 3 | font-style: normal; 4 | font-weight: 300; 5 | src: local('Open Sans Light'), local('OpenSans-Light'), url(DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff) format('woff'); 6 | } 7 | @font-face { 8 | font-family: 'Open Sans'; 9 | font-style: normal; 10 | font-weight: 400; 11 | src: local('Open Sans'), local('OpenSans'), url(cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff) format('woff'); 12 | } -------------------------------------------------------------------------------- /mmc-dubbo-provider/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | # ====================server==================== 2 | server: 3 | port: 8080 4 | spring: 5 | application: 6 | name: mmc-dubbo-provider 7 | dubbo: 8 | application: 9 | id: mmc-dubbo-provider 10 | name: mmc-dubbo-provider 11 | protocol: 12 | id: dubbo 13 | name: dubbo 14 | port: 30880 15 | registry: 16 | address: zookeeper://127.0.0.1:2181 17 | id: mmc-dubbo-provider-registry 18 | scan: 19 | base-packages: com.mmc.dubbo.provider -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/DubboDoeApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.mmc.dubbo.doe; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class DubboDoeApplicationTests { 11 | 12 | 13 | @Test 14 | public void contextLoads() { 15 | 16 | System.out.println("begin."); 17 | 18 | 19 | System.out.println("done."); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/CaseModelDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.dto; 11 | 12 | import com.mmc.dubbo.doe.model.CaseModel; 13 | 14 | /** 15 | * @author Joey 16 | * @date 2018/6/29 15:58 17 | */ 18 | public class CaseModelDTO extends CaseModel { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /mmc-dubbo-provider/src/main/java/com/mmc/dubbo/provider/DubboProviderApplication.java: -------------------------------------------------------------------------------- 1 | package com.mmc.dubbo.provider; 2 | 3 | import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @EnableDubbo 8 | @SpringBootApplication 9 | public class DubboProviderApplication { 10 | 11 | public static void main(String[] args) { 12 | 13 | SpringApplication springApplication = new SpringApplication(DubboProviderApplication.class); 14 | springApplication.run(args); 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/ServiceModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.model; 11 | 12 | import lombok.Data; 13 | 14 | /** 15 | * interface wrapper. 16 | * 17 | * @author Joey 18 | * @date 2018/6/18 17:51 19 | */ 20 | @Data 21 | public class ServiceModel { 22 | 23 | private String serviceName; 24 | } 25 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/exception/DoeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.exception; 11 | 12 | /** 13 | * @author Joey 14 | * @date 2018/6/13 19:29 15 | */ 16 | public class DoeException extends RuntimeException { 17 | 18 | public DoeException(String message) { 19 | super(message); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/RegistryModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.model; 11 | 12 | import lombok.Data; 13 | 14 | /** 15 | * @author Joey 16 | * @date 2018/7/9 19:42 17 | */ 18 | @Data 19 | public class RegistryModel { 20 | 21 | private String registryKey; 22 | private String registryDesc; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/DubboDoeApplication.java: -------------------------------------------------------------------------------- 1 | package com.mmc.dubbo.doe; 2 | 3 | import com.mmc.dubbo.doe.context.ApplicationReadyEventListener; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | public class DubboDoeApplication { 9 | 10 | public static void main(String[] args) { 11 | 12 | SpringApplication springApplication = new SpringApplication(DubboDoeApplication.class); 13 | springApplication.addListeners(new ApplicationReadyEventListener()); // load jars when startup 14 | springApplication.run(args); 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/UrlModelDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.dto; 11 | 12 | import lombok.Data; 13 | 14 | /** 15 | * @author Joey 16 | * @date 2018/6/18 21:19 17 | */ 18 | @Data 19 | public class UrlModelDTO { 20 | 21 | private String key; 22 | private String host; 23 | private Integer port; 24 | 25 | } 26 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestLogback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.test; 11 | 12 | import lombok.extern.slf4j.Slf4j; 13 | import org.junit.Test; 14 | 15 | /** 16 | * @author Joey 17 | * @date 2018/6/27 18:19 18 | */ 19 | @Slf4j 20 | public class TestLogback { 21 | 22 | @Test 23 | public void test() { 24 | 25 | log.info("what are you dong ? "); 26 | 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/PomDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.dto; 11 | 12 | import lombok.Data; 13 | 14 | /** 15 | * @author Joey 16 | * @date 2018/6/17 10:03 17 | */ 18 | @Data 19 | public class PomDTO extends BaseDTO { 20 | 21 | /** 22 | * the pom xml content. 23 | */ 24 | private String pom; 25 | 26 | /** 27 | * the path of pom file. 28 | */ 29 | private String path; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/PointModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.model; 11 | 12 | import lombok.Data; 13 | 14 | /** 15 | * ip and port. 16 | * 17 | * @author Joey 18 | * @date 2018/7/18 10:17 19 | */ 20 | @Data 21 | public class PointModel { 22 | 23 | private String ip; 24 | private int port; 25 | 26 | public PointModel(String host, Integer port) { 27 | this.ip = host; 28 | this.port = port; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestNumber.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.test; 11 | 12 | import org.junit.Test; 13 | 14 | /** 15 | * @author Joey 16 | * @date 2018/7/27 17:04 17 | */ 18 | public class TestNumber { 19 | 20 | @Test 21 | public void testPercent() { 22 | 23 | int a = 19; 24 | int b = 17; 25 | 26 | double c = ((double) a) * 100 / b; 27 | 28 | System.out.println(String.format("%.0f%s", c, "%")); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/MenuService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.service; 11 | 12 | /** 13 | * @author Joey 14 | * @date 2018/11/26 16:20 15 | */ 16 | public interface MenuService { 17 | 18 | /** 19 | * get url map to the mid. 20 | * 21 | * @param mid menuId 22 | * @return the menu mrl 23 | */ 24 | String getUrl(Integer mid); 25 | 26 | /** 27 | * get the menu text. 28 | * @return 29 | */ 30 | String getHtml(); 31 | } 32 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/TelnetService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | 11 | package com.mmc.dubbo.doe.service; 12 | 13 | import com.mmc.dubbo.doe.dto.ConnectDTO; 14 | import com.mmc.dubbo.doe.dto.ResultDTO; 15 | 16 | import javax.validation.constraints.NotNull; 17 | 18 | /** 19 | * @author Joey 20 | * @date 2018/7/17 15:10 21 | */ 22 | public interface TelnetService { 23 | 24 | /** 25 | * send message with telnet client. 26 | * @param dto 27 | * @return 28 | */ 29 | ResultDTO send(@NotNull ConnectDTO dto); 30 | } 31 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/application-dev.yml: -------------------------------------------------------------------------------- 1 | # ====================server==================== 2 | server: 3 | port: 9876 4 | spring: 5 | thymeleaf: 6 | # 开发环境禁用页面缓存 7 | cache: false 8 | encoding: utf-8 9 | mode: HTML5 10 | redis: 11 | # 数据库索引 12 | database: 0 13 | host: 127.0.0.1 14 | port: 6379 15 | jedis: 16 | pool: 17 | # 最大连接数 18 | max-active: 8 19 | # 最大空闲 20 | max-idle: 8 21 | # 最小空闲 22 | min-idle: 4 23 | # 连接超时时间 24 | timeout: 10000 25 | 26 | # ====================doe==================== 27 | doe: 28 | dependency: 29 | # 用于下载依赖的pom文件 30 | pom: /app/doe/pom.xml 31 | # 用于存放下载的jar的目录 32 | lib: /app/doe/lib/ 33 | # 用于执行mvn命令超时时间(秒) 34 | timeout: 20 35 | watchdog: 36 | url: http://localhost:8000 37 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dao/CaseDAO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.dao; 11 | 12 | import com.mmc.dubbo.doe.model.CaseModel; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * @author Joey 18 | * @date 2018/6/29 15:36 19 | */ 20 | public interface CaseDAO { 21 | 22 | /** 23 | * save the case. 24 | * 25 | * @param model 26 | * @return 27 | */ 28 | int save(CaseModel model); 29 | 30 | /** 31 | * list all model. 32 | * @return 33 | */ 34 | List listAll(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/BaseDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.dto; 11 | 12 | import java.util.concurrent.atomic.AtomicLong; 13 | 14 | /** 15 | * @author Joey 16 | * @date 2018/6/17 10:11 17 | */ 18 | public class BaseDTO { 19 | 20 | private static final AtomicLong counter = new AtomicLong(); 21 | 22 | private final String requestId; 23 | 24 | public BaseDTO() { 25 | 26 | this.requestId = String.valueOf(counter.getAndAdd(1)); 27 | } 28 | 29 | public String getRequestId() { 30 | return requestId; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/UrlModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.model; 11 | 12 | import com.alibaba.dubbo.common.URL; 13 | 14 | /** 15 | * @author Joey 16 | * @date 2018/6/15 17:56 17 | */ 18 | public class UrlModel { 19 | 20 | private final String key; 21 | private final URL url; 22 | 23 | public UrlModel(String key, URL url) { 24 | this.key = key; 25 | this.url = url; 26 | } 27 | 28 | public String getKey() { 29 | return key; 30 | } 31 | 32 | public URL getUrl() { 33 | return url; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/application-prd.yml: -------------------------------------------------------------------------------- 1 | # ====================server==================== 2 | server: 3 | port: 9876 4 | spring: 5 | thymeleaf: 6 | # 开发环境禁用页面缓存 7 | cache: true 8 | encoding: utf-8 9 | mode: HTML5 10 | prefix: classpath:/templates 11 | suffix: .html 12 | redis: 13 | # 数据库索引 14 | database: 0 15 | host: 127.0.0.1 16 | port: 6379 17 | jedis: 18 | pool: 19 | # 最大连接数 20 | max-active: 8 21 | # 最大空闲 22 | max-idle: 8 23 | # 最小空闲 24 | min-idle: 4 25 | # 连接超时时间 26 | timeout: 10000 27 | 28 | # ====================doe==================== 29 | doe: 30 | dependency: 31 | # 用于下载依赖的pom文件 32 | pom: /app/doe/pom.xml 33 | # 用于存放下载的jar的目录 34 | lib: /app/doe/lib/ 35 | # 用于执行mvn命令超时时间(秒) 36 | timeout: 20 37 | watchdog: 38 | url: http://localhost:8000 -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/CaseService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | 11 | package com.mmc.dubbo.doe.service; 12 | 13 | import com.mmc.dubbo.doe.dto.ResultDTO; 14 | import com.mmc.dubbo.doe.model.CaseModel; 15 | 16 | import java.util.List; 17 | 18 | /** 19 | * @author Joey 20 | * @date 2018/6/29 15:21 21 | */ 22 | public interface CaseService { 23 | 24 | /** 25 | * save the case. 26 | * 27 | * @param model 28 | * @return 29 | */ 30 | ResultDTO save(CaseModel model); 31 | 32 | /** 33 | * list all case. 34 | * 35 | * @return 36 | */ 37 | List listAll(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /UPGRADE.md: -------------------------------------------------------------------------------- 1 | 2 | 版本发布记录 3 | 4 | # Doe 发布 [V1.0.0] 5 | ## 版本特性 6 | 一、连接发送 7 | * 极简模式 8 | * 普通模式 9 | * 用例模式 10 | 11 | 二、依赖管理 12 | * 增加依赖 13 | * 依赖列表 14 | 15 | > 基础功能基本实现 16 | 17 | 18 | # Doe 发布 [V1.1.0] 19 | 20 | ## 版本特性 21 | 22 | ##### 一、新功能 23 | * 增加注册中心管理模块 24 | * 增加编辑依赖模块 25 | * 增加守护程序,停止、重启、重新发布 26 | 27 | ##### 二. 优化功能 28 | * provider 修改为starter方式 29 | * 增加接口version和group支持 30 | 31 | ##### 三. 缺陷修复 32 | * 修复grid序号问题 33 | * 修复spring 版本过低问题 34 | * 优化菜单栏展示方式 35 | 36 | 37 | 38 | # Doe 发布 [V1.2.0] 39 | 40 | ## 版本特性 41 | 42 | ##### 一、新功能 43 | * 增加独立加载JAR功能 44 | * 增加清空lib目录功能 45 | 46 | ##### 二. 优化功能 47 | * 增加mac系统判断(commited by Lutong ) 48 | * 增加泛型接口测试 49 | * 修改dubbo依赖为starter方式 50 | * 修改类加载方式,增加沙箱隔离 51 | * 移除python模块 52 | 53 | ##### 三. 缺陷修复 54 | * 无 55 | 56 | 57 | 58 | # Doe 发布 [V1.3.0] 59 | 60 | ## 功能特性 61 | 62 | ##### 一、新功能 63 | * 无 64 | 65 | ##### 二. 优化功能 66 | * 无 67 | 68 | ##### 三. 缺陷修复 69 | * 修复【依赖编辑】模块未清空原目录残存jar包问题 70 | * 修复【重新加载】模块未清空缓存classMap问题 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /mmc-dubbo-api/src/main/java/com/mmc/dubbo/api/user/UserService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | 11 | package com.mmc.dubbo.api.user; 12 | 13 | /** 14 | * @author Joey 15 | * @date 2018/5/8 20:25 16 | */ 17 | public interface UserService { 18 | 19 | /** 20 | * 测试方法一(单个参数). 21 | * @param id 22 | * @return 23 | */ 24 | UserFact getCurrentById(long id); 25 | 26 | /** 27 | * 测试方法二(多个参数). 28 | * @param u 29 | * @param name 30 | * @param sex 31 | * @return 32 | */ 33 | UserFact insert(UserFact u, String name, int sex); 34 | 35 | /** 36 | * 泛型测试. 37 | * @param user 38 | * @return 39 | */ 40 | GenericResp echo(GenericReq user); 41 | 42 | } 43 | 44 | -------------------------------------------------------------------------------- /mmc-dubbo-api/src/main/java/com/mmc/dubbo/api/user/GenericResp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.api.user; 11 | 12 | import java.io.Serializable; 13 | 14 | /** 15 | * @author Joey 16 | * @date 2019/5/10 16:11 17 | */ 18 | public class GenericResp implements Serializable { 19 | 20 | private static final long serialVersionUID = 6753766666093779059L; 21 | private T data; 22 | private String name; 23 | 24 | public T getData() { 25 | return data; 26 | } 27 | 28 | public void setData(T data) { 29 | this.data = data; 30 | } 31 | 32 | public String getName() { 33 | return name; 34 | } 35 | 36 | public void setName(String name) { 37 | this.name = name; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /mmc-dubbo-api/src/main/java/com/mmc/dubbo/api/user/GenericReq.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.api.user; 11 | 12 | import java.io.Serializable; 13 | 14 | /** 15 | * @author Joey 16 | * @date 2019/5/10 16:10 17 | */ 18 | public class GenericReq implements Serializable { 19 | 20 | 21 | private static final long serialVersionUID = 3998577120137245599L; 22 | private String name; 23 | private T data; 24 | 25 | public String getName() { 26 | return name; 27 | } 28 | 29 | public void setName(String name) { 30 | this.name = name; 31 | } 32 | 33 | public T getData() { 34 | return data; 35 | } 36 | 37 | public void setData(T data) { 38 | this.data = data; 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/auth/MenuNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | /** 11 | * 12 | */ 13 | package com.mmc.dubbo.doe.auth; 14 | 15 | import java.util.ArrayList; 16 | import java.util.List; 17 | 18 | /** 19 | * 菜单节点. 20 | * @author Joey 21 | * 2016年6月24日 下午4:50:47 22 | */ 23 | public class MenuNode extends MenuTree{ 24 | 25 | /** 26 | * 27 | */ 28 | private static final long serialVersionUID = 1456456456L; 29 | 30 | private List children = new ArrayList(); 31 | 32 | public List getChildren() { 33 | return children; 34 | } 35 | 36 | public void setChildren(List children) { 37 | this.children = children; 38 | } 39 | 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestDoeClassLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.test; 11 | 12 | import com.mmc.dubbo.doe.context.DoeClassLoader; 13 | import org.junit.Test; 14 | 15 | /** 16 | * @author Joey 17 | * @date 2019/6/28 14:54 18 | */ 19 | public class TestDoeClassLoader { 20 | 21 | @Test 22 | public void testLoad() throws Exception { 23 | 24 | String path = "F:\\app\\doe\\lib"; 25 | 26 | DoeClassLoader doeClassLoader = new DoeClassLoader(path); 27 | 28 | doeClassLoader.loadJars(); 29 | doeClassLoader.loadClassFile(); 30 | Class clazz = doeClassLoader.loadClass("com.fcbox.edms.terminal.api.CabinetServiceFacade"); 31 | 32 | 33 | System.out.println(clazz.getClassLoader()); 34 | 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /mmc-dubbo-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | mmc-dubbo 8 | api 9 | 1.3-RELEASE 10 | 11 | mmc-dubbo-api 12 | 13 | 14 | 1.8 15 | 1.8 16 | 17 | 18 | 19 | 20 | 21 | org.apache.maven.plugins 22 | maven-compiler-plugin 23 | 3.1 24 | 25 | 1.8 26 | 1.8 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestParam.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.test; 11 | 12 | import org.junit.Test; 13 | 14 | import java.util.ArrayList; 15 | import java.util.Arrays; 16 | import java.util.List; 17 | 18 | /** 19 | * @author Joey 20 | * @date 2018/8/6 14:10 21 | */ 22 | public class TestParam { 23 | 24 | @Test 25 | public void testMethodPassValue() { 26 | 27 | 28 | List list = new ArrayList<>(); 29 | list.add("a"); 30 | list.add("b"); 31 | list.add("c"); 32 | list.add("d"); 33 | list.add("e"); 34 | 35 | new TestParam().print(list.toArray(new String[0])); 36 | 37 | } 38 | 39 | private void print(String... values) { 40 | 41 | Arrays.stream(values).forEach(System.out::println); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/ConfigService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | 11 | package com.mmc.dubbo.doe.service; 12 | 13 | import com.mmc.dubbo.doe.dto.ResultDTO; 14 | import com.mmc.dubbo.doe.model.RegistryModel; 15 | 16 | import java.util.List; 17 | 18 | /** 19 | * @author Joey 20 | * @date 2018/7/9 19:40 21 | */ 22 | public interface ConfigService { 23 | 24 | /** 25 | * list all registry. 26 | * 27 | * @return 28 | */ 29 | List listRegistry(); 30 | 31 | /** 32 | * add registry. 33 | * 34 | * @return 35 | */ 36 | ResultDTO addRegistry(RegistryModel model); 37 | 38 | /** 39 | * load zk config. 40 | */ 41 | void loadZkConfigFromResource(); 42 | 43 | /** 44 | * delete registry. 45 | * 46 | * @param model 47 | * @return 48 | */ 49 | ResultDTO delRegistry(RegistryModel model); 50 | } 51 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/js/jquery.ui.touch-punch.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery UI Touch Punch 0.2.2 3 | * 4 | * Copyright 2011, Dave Furfero 5 | * Dual licensed under the MIT or GPL Version 2 licenses. 6 | * 7 | * Depends: 8 | * jquery.ui.widget.js 9 | * jquery.ui.mouse.js 10 | */ 11 | (function(b){b.support.touch="ontouchend" in document;if(!b.support.touch){return;}var c=b.ui.mouse.prototype,e=c._mouseInit,a;function d(g,h){if(g.originalEvent.touches.length>1){return;}g.preventDefault();var i=g.originalEvent.changedTouches[0],f=document.createEvent("MouseEvents");f.initMouseEvent(h,true,true,window,1,i.screenX,i.screenY,i.clientX,i.clientY,false,false,false,false,0,null);g.target.dispatchEvent(f);}c._touchStart=function(g){var f=this;if(a||!f._mouseCapture(g.originalEvent.changedTouches[0])){return;}a=true;f._touchMoved=false;d(g,"mouseover");d(g,"mousemove");d(g,"mousedown");};c._touchMove=function(f){if(!a){return;}this._touchMoved=true;d(f,"mousemove");};c._touchEnd=function(f){if(!a){return;}d(f,"mouseup");d(f,"mouseout");if(!this._touchMoved){d(f,"click");}a=false;};c._mouseInit=function(){var f=this;f.element.bind("touchstart",b.proxy(f,"_touchStart")).bind("touchmove",b.proxy(f,"_touchMove")).bind("touchend",b.proxy(f,"_touchEnd"));e.call(f);};})(jQuery); -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/util/StringUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.util; 11 | 12 | /** 13 | * 字符串工具类. 14 | * @author Joey 15 | * 2016年10月17日 下午4:08:55 16 | */ 17 | public class StringUtil { 18 | 19 | /** 20 | * 简单格式化{}样式的字符串.
21 | * String str = "aaa{} bbb{} ccc{}";
22 | * System.out.println(StringUtil.format(str, "1", "2", "3")); 23 | * @param src 源字符串 24 | * @param param 跟源字符串{}匹配的个数字符串 25 | * @return 26 | */ 27 | public static String format(String src, Object... param) { 28 | int i = 0; 29 | int index = 0; 30 | StringBuffer sb = new StringBuffer(src); 31 | while (-1 != (index = sb.indexOf("{}"))) { 32 | sb.replace(index, index + 2, String.valueOf(param[i++])); 33 | } 34 | return sb.toString(); 35 | } 36 | 37 | public static void main(String[] args) { 38 | String str = "aaa{} bbb{} ccc{}"; 39 | System.out.println(StringUtil.format(str, "1", "2", "3")); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/templates/pages/tpl/head.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/ClassService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | 11 | package com.mmc.dubbo.doe.service; 12 | 13 | import com.mmc.dubbo.doe.dto.ConnectDTO; 14 | import com.mmc.dubbo.doe.dto.MethodModelDTO; 15 | import com.mmc.dubbo.doe.dto.ResultDTO; 16 | 17 | import javax.validation.constraints.NotNull; 18 | import java.util.List; 19 | 20 | /** 21 | * @author Joey 22 | * @date 2018/6/28 11:28 23 | */ 24 | public interface ClassService { 25 | 26 | /** 27 | * generate the simple json string of the method parameters. 28 | * 29 | * @param dto 30 | * @return 31 | */ 32 | ResultDTO generateMethodParamsJsonString(@NotNull MethodModelDTO dto) throws ClassNotFoundException, InstantiationException, IllegalAccessException; 33 | 34 | /** 35 | * get all methods from the given interface. 36 | * 37 | * @param dto 38 | * @return 39 | */ 40 | List listMethods(ConnectDTO dto); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestFuture.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.test; 11 | 12 | import org.junit.Test; 13 | 14 | import java.util.concurrent.CompletableFuture; 15 | import java.util.concurrent.ExecutionException; 16 | 17 | /** 18 | * @author Joey 19 | * @date 2018/6/12 13:54 20 | */ 21 | public class TestFuture { 22 | 23 | @Test 24 | public void test() throws ExecutionException, InterruptedException { 25 | 26 | CompletableFuture future = new CompletableFuture<>(); 27 | 28 | System.out.println("do something."); 29 | 30 | new Thread(() -> { 31 | 32 | try { 33 | Thread.sleep(5000); 34 | } catch (InterruptedException e) { 35 | e.printStackTrace(); 36 | } 37 | future.complete("World"); 38 | 39 | }).start(); 40 | 41 | System.out.println(future.get()); 42 | 43 | System.out.println("done."); 44 | } 45 | 46 | 47 | } -------------------------------------------------------------------------------- /deploy/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | mmc-dubbo 6 | doe 7 | 1.0-SNAPSHOT 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | compile 17 | 18 | 19 | maven-dependency-plugin 20 | 21 | 22 | process-sources 23 | 24 | 25 | copy-dependencies 26 | 27 | 28 | 29 | /app/doe/lib 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/MethodModelDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.dto; 11 | 12 | import com.mmc.dubbo.doe.model.MethodModel; 13 | import lombok.Data; 14 | 15 | /** 16 | * @author Joey 17 | * @date 2018/6/18 21:49 18 | */ 19 | @Data 20 | public class MethodModelDTO { 21 | 22 | /** 23 | * the name of interface which the method belong to. 24 | */ 25 | private String interfaceName; 26 | /** 27 | * the cache key. 28 | */ 29 | private String methodKey; 30 | /** 31 | * just only the method name. 32 | */ 33 | private String methodName; 34 | /** 35 | * show on the web. 36 | */ 37 | private String methodText; 38 | 39 | public MethodModelDTO() { 40 | 41 | } 42 | 43 | public MethodModelDTO(MethodModel model) { 44 | 45 | this.methodKey = model.getKey(); 46 | this.methodName = model.getMethod().getName(); 47 | this.methodText = model.getMethodText(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /deploy/pom.xml.backup: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | mmc-dubbo 6 | doe 7 | 1.0-SNAPSHOT 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | compile 17 | 18 | 19 | maven-dependency-plugin 20 | 21 | 22 | process-sources 23 | 24 | 25 | copy-dependencies 26 | 27 | 28 | 29 | /app/doe/lib 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/ConnectDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.dto; 11 | 12 | import lombok.Data; 13 | 14 | /** 15 | * @author Joey 16 | * @date 2018/6/18 19:10 17 | */ 18 | @Data 19 | public class ConnectDTO extends BaseDTO { 20 | 21 | /** 22 | * ip and port. 23 | */ 24 | private String conn; 25 | /** 26 | * interface name; 27 | */ 28 | private String serviceName; 29 | /** 30 | * the provider cache key. 31 | */ 32 | private String providerKey; 33 | /** 34 | * method key. 35 | */ 36 | private String methodKey; 37 | /** 38 | * method name. 39 | */ 40 | private String methodName; 41 | /** 42 | * method params. 43 | */ 44 | private String json; 45 | /** 46 | * timeout of waiting for result. 47 | */ 48 | private int timeout; 49 | /** 50 | * interface version number, eg: 1.0.0 51 | */ 52 | private String version; 53 | /** 54 | * the group of interface, eg: mmcgroup 55 | */ 56 | private String group; 57 | } 58 | -------------------------------------------------------------------------------- /mmc-dubbo-api/src/main/java/com/mmc/dubbo/api/user/UserFact.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.api.user; 11 | 12 | import java.io.Serializable; 13 | 14 | /** 15 | * @author Joey 16 | * @date 2018/5/8 20:26 17 | */ 18 | public class UserFact implements Serializable { 19 | 20 | private static final long serialVersionUID = 2798561567572955369L; 21 | private long id; 22 | private String name; 23 | private int sex; 24 | private int height; 25 | 26 | public long getId() { 27 | return id; 28 | } 29 | 30 | public void setId(long id) { 31 | this.id = id; 32 | } 33 | 34 | public String getName() { 35 | return name; 36 | } 37 | 38 | public void setName(String name) { 39 | this.name = name; 40 | } 41 | 42 | public int getSex() { 43 | return sex; 44 | } 45 | 46 | public void setSex(int sex) { 47 | this.sex = sex; 48 | } 49 | 50 | public int getHeight() { 51 | return height; 52 | } 53 | 54 | public void setHeight(int height) { 55 | this.height = height; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/templates/pages/tpl/bread.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/context/Const.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.context; 11 | 12 | /** 13 | * @author Joey 14 | * @date 2018/6/17 18:38 15 | */ 16 | public class Const { 17 | 18 | /** 19 | * download task key. 20 | */ 21 | public static final String DOE_DOWNLOAD_JAR_TASK = "doe:download:jar:task"; 22 | /** 23 | * when the task was running. 24 | */ 25 | public static final int RUNNING_FlAG = 1; 26 | /** 27 | * when the task has completed. 28 | */ 29 | public static final int COMPLETE_FLAG = 2; 30 | /** 31 | * download task real time message key. 32 | */ 33 | public static final String DOE_DOWNLOAD_JAR_MESSAGE = "doe:download:jar:msg:{}"; 34 | 35 | /** 36 | * the project cache namespace. 37 | */ 38 | public static final String DOE_CACHE_PREFIX = "doe:cache"; 39 | /** 40 | * use case key. 41 | */ 42 | public static final String DOE_CASE_KEY = "doe:case"; 43 | /** 44 | * all config of zk address key. 45 | */ 46 | public static final String DOE_REGISTRY_KEY = "doe:registry:list"; 47 | } 48 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/CaseModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.model; 11 | 12 | import lombok.Data; 13 | 14 | import java.util.Date; 15 | import java.util.Map; 16 | 17 | /** 18 | * @author Joey 19 | * @date 2018/6/28 10:42 20 | */ 21 | @Data 22 | public class CaseModel { 23 | 24 | /** 25 | * case Id. 26 | */ 27 | private long caseId; 28 | /** 29 | * case group. 30 | */ 31 | private String caseGroup; 32 | private String caseName; 33 | private String caseDesc; 34 | private String insertTime; 35 | /** 36 | * provider address. 37 | */ 38 | private String address; 39 | private String interfaceName; 40 | /** 41 | * the method name with parameters. 42 | */ 43 | private String methodText; 44 | private String providerKey; 45 | private String methodKey; 46 | /** 47 | * parameters. 48 | */ 49 | private String json; 50 | /** 51 | * assert condition. 52 | */ 53 | private String condition; 54 | /** 55 | * expected result. 56 | */ 57 | private String expect; 58 | 59 | } 60 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/templates/pages/tpl/foot.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |
-------------------------------------------------------------------------------- /mmc-dubbo-doe/src/test/resources/test-pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | mmc-dubbo 7 | doe 8 | 1.0-SNAPSHOT 9 | 10 | 11 | 12 | mmc-dubbo 13 | api 14 | 1.0-SNAPSHOT 15 | 16 | 17 | 18 | 19 | compile 20 | 21 | 22 | maven-dependency-plugin 23 | 24 | 25 | process-sources 26 | 27 | 28 | copy-dependencies 29 | 30 | 31 | 32 | /app/doe/lib 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestRedisTemplate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.test; 11 | 12 | import org.junit.Assert; 13 | import org.junit.Test; 14 | import org.junit.runner.RunWith; 15 | import org.springframework.beans.factory.annotation.Autowired; 16 | import org.springframework.boot.test.context.SpringBootTest; 17 | import org.springframework.data.redis.core.RedisTemplate; 18 | import org.springframework.test.context.junit4.SpringRunner; 19 | 20 | import java.util.concurrent.TimeUnit; 21 | 22 | /** 23 | * @author Joey 24 | * @date 2018/6/17 17:24 25 | */ 26 | @RunWith(SpringRunner.class) 27 | @SpringBootTest 28 | public class TestRedisTemplate { 29 | 30 | @Autowired 31 | private RedisTemplate redisTemplate; 32 | 33 | @Test 34 | public void testRedis() { 35 | 36 | System.out.println("begin."); 37 | 38 | redisTemplate.opsForValue().set("testKey", "testValue", 1, TimeUnit.HOURS); 39 | 40 | String value = redisTemplate.opsForValue().get("testKey"); 41 | 42 | Assert.assertTrue("testValue".equals(value)); 43 | 44 | 45 | System.out.println("done."); 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestRedisResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.test; 11 | 12 | import com.mmc.dubbo.doe.cache.RedisResolver; 13 | import org.junit.Assert; 14 | import org.junit.Test; 15 | import org.junit.runner.RunWith; 16 | import org.springframework.beans.factory.annotation.Autowired; 17 | import org.springframework.boot.test.context.SpringBootTest; 18 | import org.springframework.data.redis.core.RedisTemplate; 19 | import org.springframework.test.context.junit4.SpringRunner; 20 | 21 | import java.util.concurrent.TimeUnit; 22 | 23 | /** 24 | * @author Joey 25 | * @date 2018/6/17 17:24 26 | */ 27 | @RunWith(SpringRunner.class) 28 | @SpringBootTest 29 | public class TestRedisResolver { 30 | 31 | @Autowired 32 | private RedisResolver redisResolver; 33 | 34 | @Test 35 | public void testString() { 36 | 37 | System.out.println("begin."); 38 | 39 | redisResolver.set("testKey", "testValue", 1, TimeUnit.HOURS); 40 | 41 | String value = (String) redisResolver.get("testKey"); 42 | 43 | Assert.assertTrue("testValue".equals(value)); 44 | 45 | 46 | System.out.println("done."); 47 | 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /deploy/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /etc/profile 4 | 5 | function log() { 6 | echo `date '+%Y-%m-%d %H:%M:%S'` "$1" 7 | } 8 | 9 | function doStop() { 10 | log "bein to stop doe." 11 | 12 | count=`ps aux|grep "java -jar dubbo-doe" |grep -v grep|wc -l` 13 | 14 | if [ $count -gt 0 ] 15 | then 16 | log "bein to shutdown doe." 17 | pid=`ps aux|grep "java -jar dubbo-doe" |grep -v grep|awk '{ print $2 }'` 18 | kill $pid 19 | sleep 3s 20 | fi 21 | 22 | count=`ps aux|grep "java -jar dubbo-doe" |grep -v grep|wc -l` 23 | if [ $count -gt 0 ] 24 | then 25 | log "bein to force to kill doe." 26 | pid=`ps aux|grep "java -jar dubbo-doe" |grep -v grep|awk '{ print $2 }'` 27 | kill -9 $pid 28 | sleep 3s 29 | fi 30 | log "finish stop doe." 31 | } 32 | function doStart() { 33 | log "bein to install doe." 34 | 35 | java -jar dubbo-doe.jar --spring.profiles.active=prd & 36 | 37 | log "finish install doe." 38 | } 39 | 40 | function main() { 41 | 42 | log "welcome to doe." 43 | 44 | option="$1" 45 | 46 | if [ "$option" = "start" ] 47 | then 48 | doStart 49 | elif [ "$option" = "stop" ] 50 | then 51 | doStop 52 | elif [ "$option" = "reload" ] 53 | then 54 | doStop 55 | sleep 3s 56 | doStart 57 | elif [ "$option" = "republish" ] 58 | then 59 | doStop 60 | cp pom.xml.backup pom.xml 61 | rm -rf ./lib/* 62 | sleep 3s 63 | doStart 64 | else 65 | log "input option error (start/stop/reload/republish)" 66 | fi 67 | 68 | log "done." 69 | 70 | } 71 | 72 | main "$1" -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/ConnectService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.service; 11 | 12 | import com.mmc.dubbo.doe.dto.ConnectDTO; 13 | import com.mmc.dubbo.doe.dto.ResultDTO; 14 | import com.mmc.dubbo.doe.dto.MethodModelDTO; 15 | import com.mmc.dubbo.doe.dto.UrlModelDTO; 16 | import com.mmc.dubbo.doe.model.ServiceModel; 17 | 18 | import javax.validation.constraints.NotNull; 19 | import java.util.List; 20 | 21 | /** 22 | * @author Joey 23 | * @date 2018/6/18 17:10 24 | */ 25 | public interface ConnectService { 26 | 27 | /** 28 | * connect to zk and get all providers. 29 | * 30 | * @param conn 31 | * @return 32 | */ 33 | List connect(@NotNull String conn) throws NoSuchFieldException, IllegalAccessException; 34 | 35 | /** 36 | * list providers of service. 37 | * 38 | * @param connect 39 | * @return 40 | */ 41 | List listProviders(@NotNull ConnectDTO connect) throws NoSuchFieldException, IllegalAccessException; 42 | 43 | /** 44 | * send request to the real dubbo server. 45 | * 46 | * @param dto 47 | * @return 48 | */ 49 | ResultDTO send(ConnectDTO dto) throws Exception; 50 | } 51 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/PomModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.model; 11 | 12 | import com.alibaba.dubbo.common.utils.StringUtils; 13 | 14 | /** 15 | * @author Joey 16 | * @date 2018/6/16 9:55 17 | */ 18 | public class PomModel { 19 | 20 | private String groupId; 21 | private String artifactId; 22 | private String version; 23 | private String scope; 24 | 25 | public String getGroupId() { 26 | return groupId; 27 | } 28 | 29 | public void setGroupId(String groupId) { 30 | this.groupId = groupId; 31 | } 32 | 33 | public String getArtifactId() { 34 | return artifactId; 35 | } 36 | 37 | public void setArtifactId(String artifactId) { 38 | this.artifactId = artifactId; 39 | } 40 | 41 | public String getVersion() { 42 | return version; 43 | } 44 | 45 | public void setVersion(String version) { 46 | this.version = version; 47 | } 48 | 49 | public String getScope() { 50 | return scope; 51 | } 52 | 53 | public void setScope(String scope) { 54 | this.scope = scope; 55 | } 56 | 57 | public boolean isBroken() { 58 | return StringUtils.isEmpty(groupId) || StringUtils.isEmpty(artifactId) || StringUtils.isEmpty(version); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestProcessClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.test; 11 | 12 | import com.mmc.dubbo.doe.cache.RedisResolver; 13 | import com.mmc.dubbo.doe.client.ProcessClient; 14 | import com.mmc.dubbo.doe.dto.PomDTO; 15 | import org.junit.Assert; 16 | import org.junit.Test; 17 | import org.junit.runner.RunWith; 18 | import org.springframework.beans.factory.annotation.Autowired; 19 | import org.springframework.boot.test.context.SpringBootTest; 20 | import org.springframework.test.context.junit4.SpringRunner; 21 | 22 | /** 23 | * @author Joey 24 | * @date 2018/6/15 18:51 25 | */ 26 | @RunWith(SpringRunner.class) 27 | @SpringBootTest 28 | public class TestProcessClient { 29 | 30 | @Autowired 31 | private RedisResolver redisResolver; 32 | 33 | @Test 34 | public void testDownload() throws InterruptedException { 35 | 36 | 37 | String pomXml = TestProcessClient.class.getResource("/test-pom.xml").getPath(); 38 | pomXml = pomXml.substring(1); 39 | System.out.println(pomXml); 40 | 41 | String libPath = pomXml.substring(0, pomXml.lastIndexOf("/")) + "lib"; 42 | System.out.println(libPath); 43 | 44 | PomDTO dto = new PomDTO(); 45 | ProcessClient client = new ProcessClient(dto, redisResolver, pomXml, libPath); 46 | client.start(); 47 | client.join(); 48 | 49 | Assert.assertTrue(client.isDone()); 50 | 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/client/DoeClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.client; 11 | 12 | import com.alibaba.dubbo.common.URL; 13 | import com.alibaba.dubbo.remoting.RemotingException; 14 | import com.alibaba.dubbo.remoting.exchange.Request; 15 | import com.mmc.dubbo.doe.channel.NettyChannel; 16 | import com.mmc.dubbo.doe.handler.SendReceiveHandler; 17 | import org.jboss.netty.channel.Channel; 18 | import org.jboss.netty.channel.ChannelFuture; 19 | 20 | import java.util.concurrent.TimeUnit; 21 | 22 | 23 | /** 24 | * @author Joey 25 | * @date 2018/6/7 10:42 26 | */ 27 | public class DoeClient extends TransportClient { 28 | 29 | 30 | public DoeClient(URL url) { 31 | super(url, new SendReceiveHandler()); 32 | } 33 | 34 | public void doConnect() { 35 | ChannelFuture future = bootstrap.connect(getConnectAddress()); 36 | boolean ret = future.awaitUninterruptibly(timeout, TimeUnit.MILLISECONDS); 37 | if (ret && future.isSuccess()) { 38 | Channel newChannel = future.getChannel(); 39 | newChannel.setInterestOps(Channel.OP_READ_WRITE); 40 | DoeClient.this.channel = future.getChannel(); 41 | } else { 42 | throw new RuntimeException("can't not connect to server."); 43 | } 44 | } 45 | 46 | public void send(Request req) throws RemotingException { 47 | 48 | NettyChannel ch = NettyChannel.getOrAddChannel(this.channel, url, handler); 49 | 50 | ch.send(req); 51 | 52 | } 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/context/ApplicationReadyEventListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.context; 11 | 12 | import com.mmc.dubbo.doe.service.PomService; 13 | import lombok.extern.slf4j.Slf4j; 14 | import org.springframework.boot.context.event.ApplicationReadyEvent; 15 | import org.springframework.context.ApplicationEvent; 16 | import org.springframework.context.ApplicationListener; 17 | import org.springframework.context.ConfigurableApplicationContext; 18 | 19 | import java.net.MalformedURLException; 20 | 21 | /** 22 | * @author Joey 23 | * @date 2018/6/22 13:55 24 | */ 25 | @Slf4j 26 | public class ApplicationReadyEventListener implements ApplicationListener { 27 | 28 | 29 | /** 30 | * Handle an application event. 31 | * 32 | * @param event the event to respond to 33 | */ 34 | @Override 35 | public void onApplicationEvent(ApplicationReadyEvent event) { 36 | 37 | log.info("ApplicationReadyEventListener.onApplicationEvent()"); 38 | ConfigurableApplicationContext applicationContext = event.getApplicationContext(); 39 | 40 | PomService pomService = applicationContext.getBean("pomService", PomService.class); 41 | try { 42 | log.info("begin auto to load jars."); 43 | pomService.loadJars(""); 44 | log.info("finished load jars."); 45 | } catch (NoSuchMethodException | MalformedURLException e) { 46 | log.error("fail to load jars.", e); 47 | } 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestTelnetService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.test; 11 | 12 | import com.alibaba.fastjson.JSON; 13 | import com.mmc.dubbo.doe.dto.ConnectDTO; 14 | import com.mmc.dubbo.doe.dto.ResultDTO; 15 | import com.mmc.dubbo.doe.service.TelnetService; 16 | import com.mmc.dubbo.doe.service.impl.TelnetServiceImpl; 17 | import org.apache.commons.net.telnet.TelnetClient; 18 | import org.junit.Assert; 19 | import org.junit.Test; 20 | import org.junit.runner.RunWith; 21 | import org.springframework.beans.factory.annotation.Autowired; 22 | import org.springframework.boot.test.context.SpringBootTest; 23 | import org.springframework.test.context.junit4.SpringRunner; 24 | 25 | import java.io.IOException; 26 | import java.io.InputStream; 27 | import java.io.PrintStream; 28 | import java.net.SocketException; 29 | 30 | /** 31 | * @author Joey 32 | * @date 2018/7/5 14:57 33 | */ 34 | public class TestTelnetService { 35 | 36 | private TelnetService telnetService = new TelnetServiceImpl(); 37 | 38 | @Test 39 | public void testSend() { 40 | 41 | ConnectDTO dto = new ConnectDTO(); 42 | 43 | dto.setConn("127.0.0.1:30880"); 44 | dto.setServiceName("com.mmc.dubbo.api.user.UserService"); 45 | dto.setMethodName("getCurrentById"); 46 | dto.setJson("22222"); 47 | 48 | ResultDTO ret = telnetService.send(dto); 49 | 50 | Assert.assertTrue(ret.isSuccess()); 51 | 52 | System.out.println(ret.getData()); 53 | } 54 | 55 | 56 | 57 | } 58 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/js/jquery.hotkeys.min.js: -------------------------------------------------------------------------------- 1 | (function(b){b.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",186:";",191:"/",220:"\\",222:"'",224:"meta"},shiftNums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}};function a(d){if(typeof d.data=="undefined"){return}if(typeof d.data==="string"){d.data={keys:d.data}}if(!d.data||!d.data.keys||typeof d.data.keys!=="string"){return}var c=d.handler,e=d.data.keys.toLowerCase().split(" "),f=["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"];d.handler=function(k){if(this!==k.target&&(/textarea|select/i.test(k.target.nodeName)||b.inArray(k.target.type,f)>-1)){return}var h=b.hotkeys.specialKeys[k.keyCode],m=(k.type==="keydown"||k.type==="keypress")&&String.fromCharCode(k.which).toLowerCase();modif="",possible={};if(k.altKey&&h!=="alt"){modif+="alt+"}if(k.ctrlKey&&h!=="ctrl"){modif+="ctrl+"}if(k.metaKey&&!k.ctrlKey&&h!=="meta"){modif+="meta+"}if(k.shiftKey&&h!=="shift"){modif+="shift+"}if(h){possible[modif+h]=true}if(m){possible[modif+m]=true;possible[modif+b.hotkeys.shiftNums[m]]=true;if(modif==="shift+"){possible[b.hotkeys.shiftNums[m]]=true}}for(var j=0,g=e.length;j doReload(HttpServletResponse response) { 40 | 41 | log.info("SysConfController.doReload"); 42 | 43 | try { 44 | 45 | return pomService.loadJars(""); 46 | 47 | } catch (NoSuchMethodException | MalformedURLException e) { 48 | 49 | return ResultDTO.handleException(null, null, e); 50 | } 51 | 52 | } 53 | 54 | @RequestMapping("/doRepublish") 55 | public ResultDTO doRepublish(HttpServletResponse response) { 56 | 57 | log.info("SysConfController.doRepublish"); 58 | 59 | return pomService.deleteJars(""); 60 | 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/util/JsonFileUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.util; 11 | 12 | import com.alibaba.fastjson.JSON; 13 | 14 | import java.io.BufferedReader; 15 | import java.io.IOException; 16 | import java.io.InputStream; 17 | import java.io.InputStreamReader; 18 | import java.util.List; 19 | 20 | /** 21 | * Json文件处理类. 22 | * @author Joey 23 | * @date 2018/11/14 9:23 24 | */ 25 | public class JsonFileUtil { 26 | 27 | /** 28 | * 从JSON文件流中读取列表. 29 | */ 30 | public static List readList(InputStream inputStream, Class clazz) throws IOException { 31 | 32 | BufferedReader tBufferedReader = new BufferedReader(new InputStreamReader(inputStream)); 33 | 34 | StringBuilder sb = new StringBuilder(); 35 | 36 | String sTempOneLine; 37 | 38 | while ((sTempOneLine = tBufferedReader.readLine()) != null) { 39 | 40 | sb.append(sTempOneLine); 41 | 42 | } 43 | 44 | return JSON.parseArray(sb.toString(), clazz); 45 | 46 | } 47 | 48 | /** 49 | * 从JSON文件流中读取对象. 50 | */ 51 | public static T readObject(InputStream inputStream, Class clazz) throws IOException { 52 | 53 | BufferedReader tBufferedReader = new BufferedReader(new InputStreamReader(inputStream)); 54 | 55 | StringBuilder sb = new StringBuilder(); 56 | 57 | String sTempOneLine; 58 | 59 | while ((sTempOneLine = tBufferedReader.readLine()) != null) { 60 | 61 | sb.append(sTempOneLine); 62 | 63 | } 64 | 65 | return JSON.parseObject(sb.toString(), clazz); 66 | 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/util/MD5Util.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.util; 11 | 12 | import lombok.extern.slf4j.Slf4j; 13 | 14 | import java.security.MessageDigest; 15 | 16 | /** 17 | * MD5加密工具类. 18 | * @author Joey 19 | * @date 2018/6/24 16:40 20 | */ 21 | @Slf4j 22 | public class MD5Util { 23 | 24 | public final static String encrypt(String pwd) { 25 | //用于加密的字符 26 | char md5String[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 27 | 'A', 'B', 'C', 'D', 'E', 'F' }; 28 | try { 29 | //使用平台的默认字符集将此 String 编码为 byte序列,并将结果存储到一个新的 byte数组中 30 | byte[] btInput = pwd.getBytes(); 31 | 32 | //信息摘要是安全的单向哈希函数,它接收任意大小的数据,并输出固定长度的哈希值。 33 | MessageDigest mdInst = MessageDigest.getInstance("MD5"); 34 | 35 | //MessageDigest对象通过使用 update方法处理数据, 使用指定的byte数组更新摘要 36 | mdInst.update(btInput); 37 | 38 | // 摘要更新之后,通过调用digest()执行哈希计算,获得密文 39 | byte[] md = mdInst.digest(); 40 | 41 | // 把密文转换成十六进制的字符串形式 42 | int j = md.length; 43 | char str[] = new char[j * 2]; 44 | int k = 0; 45 | for (int i = 0; i < j; i++) { // i = 0 46 | byte byte0 = md[i]; //95 47 | str[k++] = md5String[byte0 >>> 4 & 0xf]; // 5 48 | str[k++] = md5String[byte0 & 0xf]; // F 49 | } 50 | 51 | //返回经过加密后的字符串 52 | return new String(str); 53 | 54 | } catch (Exception e) { 55 | log.error("encrypt error: ", e); 56 | return null; 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/js/flot/jquery.flot.resize.min.js: -------------------------------------------------------------------------------- 1 | /* Flot plugin for automatically redrawing plots as the placeholder resizes. 2 | 3 | Copyright (c) 2007-2013 IOLA and Ole Laursen. 4 | Licensed under the MIT license. 5 | 6 | It works by listening for changes on the placeholder div (through the jQuery 7 | resize event plugin) - if the size changes, it will redraw the plot. 8 | 9 | There are no options. If you need to disable the plugin for some plots, you 10 | can just fix the size of their placeholders. 11 | 12 | *//* Inline dependency: 13 | * jQuery resize event - v1.1 - 3/14/2010 14 | * http://benalman.com/projects/jquery-resize-plugin/ 15 | * 16 | * Copyright (c) 2010 "Cowboy" Ben Alman 17 | * Dual licensed under the MIT and GPL licenses. 18 | * http://benalman.com/about/license/ 19 | */(function(e,t,n){function c(){s=t[o](function(){r.each(function(){var t=e(this),n=t.width(),r=t.height(),i=e.data(this,a);(n!==i.w||r!==i.h)&&t.trigger(u,[i.w=n,i.h=r])}),c()},i[f])}var r=e([]),i=e.resize=e.extend(e.resize,{}),s,o="setTimeout",u="resize",a=u+"-special-event",f="delay",l="throttleWindow";i[f]=250,i[l]=!0,e.event.special[u]={setup:function(){if(!i[l]&&this[o])return!1;var t=e(this);r=r.add(t),e.data(this,a,{w:t.width(),h:t.height()}),r.length===1&&c()},teardown:function(){if(!i[l]&&this[o])return!1;var t=e(this);r=r.not(t),t.removeData(a),r.length||clearTimeout(s)},add:function(t){function s(t,i,s){var o=e(this),u=e.data(this,a);u.w=i!==n?i:o.width(),u.h=s!==n?s:o.height(),r.apply(this,arguments)}if(!i[l]&&this[o])return!1;var r;if(e.isFunction(t))return r=t,s;r=t.handler,t.handler=s}}})(jQuery,this),function(e){function n(e){function t(){var t=e.getPlaceholder();if(t.width()==0||t.height()==0)return;e.resize(),e.setupGrid(),e.draw()}function n(e,n){e.getPlaceholder().resize(t)}function r(e,n){e.getPlaceholder().unbind("resize",t)}e.hooks.bindEvents.push(n),e.hooks.shutdown.push(r)}var t={};e.plot.plugins.push({init:n,options:t,name:"resize",version:"1.0"})}(jQuery); -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/util/FileUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.util; 11 | 12 | import com.mmc.dubbo.doe.exception.DoeException; 13 | import lombok.extern.slf4j.Slf4j; 14 | 15 | import java.io.*; 16 | 17 | /** 18 | * @author Joey 19 | * @date 2018/11/23 17:28 20 | */ 21 | @Slf4j 22 | public class FileUtil { 23 | 24 | public static String readToString(String fileName) throws DoeException { 25 | String encoding = "UTF-8"; 26 | File file = new File(fileName); 27 | Long filelength = file.length(); 28 | byte[] filecontent = new byte[filelength.intValue()]; 29 | try { 30 | FileInputStream in = new FileInputStream(file); 31 | int read = in.read(filecontent); 32 | in.close(); 33 | log.info("read:{} filelength:{}", read, filelength); 34 | } catch (IOException e) { 35 | throw new DoeException(StringUtil.format("can't load the file content, because {}.", e.getMessage())); 36 | } 37 | try { 38 | return new String(filecontent, encoding); 39 | } catch (UnsupportedEncodingException e) { 40 | throw new DoeException(StringUtil.format("can't load the file content, because {}.", e.getMessage())); 41 | } 42 | } 43 | 44 | public static void WriteStringToFile(String fileName, String text) { 45 | try { 46 | try (PrintWriter out = new PrintWriter(new File(fileName).getAbsoluteFile())) { 47 | out.print(text); 48 | } 49 | } catch (IOException e) { 50 | throw new RuntimeException(e); 51 | } 52 | } 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/cache/UrlCaches.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.cache; 11 | 12 | import com.alibaba.dubbo.common.URL; 13 | import com.mmc.dubbo.doe.model.UrlModel; 14 | import com.mmc.dubbo.doe.util.StringUtil; 15 | 16 | import javax.validation.constraints.NotNull; 17 | import java.util.ArrayList; 18 | import java.util.List; 19 | import java.util.Map; 20 | import java.util.concurrent.ConcurrentHashMap; 21 | import java.util.concurrent.atomic.AtomicLong; 22 | 23 | /** 24 | * @author Joey 25 | * @date 2018/6/15 17:59 26 | */ 27 | public class UrlCaches { 28 | 29 | private final static Map map = new ConcurrentHashMap<>(); 30 | 31 | /** 32 | * cache all providers by unique key. 33 | * 34 | * @param interfaceName 35 | * @param urls 36 | * @return 37 | */ 38 | public static List cache(String interfaceName, List urls) { 39 | 40 | List ret = new ArrayList<>(); 41 | 42 | for (int i = 0; i < urls.size(); i++) { 43 | 44 | URL url = urls.get(i); 45 | String key = generateUrlKey(interfaceName, url.getHost(), url.getPort()); 46 | UrlModel model = new UrlModel(key, url); 47 | ret.add(model); 48 | 49 | map.put(model.getKey(), model); // 存入缓存 50 | } 51 | 52 | return ret; 53 | } 54 | 55 | private static String generateUrlKey(String interfaceName, String host, int port) { 56 | return StringUtil.format("{}#{}#{}#", interfaceName, host, port); 57 | } 58 | 59 | public static UrlModel get(@NotNull String key) { 60 | return map.get(key); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/js/dataTables.bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | DataTables Bootstrap 3 integration 3 | ©2011-2015 SpryMedia Ltd - datatables.net/license 4 | */ 5 | (function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return b(a,window,document)}):"object"===typeof exports?module.exports=function(a,d){a||(a=window);if(!d||!d.fn.dataTable)d=require("datatables.net")(a,d).$;return b(d,a,a.document)}:b(jQuery,window,document)})(function(b,a,d){var f=b.fn.dataTable;b.extend(!0,f.defaults,{dom:"<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-5'i><'col-sm-7'p>>",renderer:"bootstrap"});b.extend(f.ext.classes, 6 | {sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm",sProcessing:"dataTables_processing panel panel-default"});f.ext.renderer.pageButton.bootstrap=function(a,h,r,m,j,n){var o=new f.Api(a),s=a.oClasses,k=a.oLanguage.oPaginate,t=a.oLanguage.oAria.paginate||{},e,g,p=0,q=function(d,f){var l,h,i,c,m=function(a){a.preventDefault();!b(a.currentTarget).hasClass("disabled")&&o.page()!=a.data.action&&o.page(a.data.action).draw("page")}; 7 | l=0;for(h=f.length;l",{"class":s.sPageButton+" "+g,id:0===r&&"string"===typeof c?a.sTableId+"_"+c:null}).append(b("",{href:"#", 8 | "aria-controls":a.sTableId,"aria-label":t[c],"data-dt-idx":p,tabindex:a.iTabIndex}).html(e)).appendTo(d),a.oApi._fnBindAction(i,{action:c},m),p++)}},i;try{i=b(h).find(d.activeElement).data("dt-idx")}catch(u){}q(b(h).empty().html('
    ').children("ul"),m);i&&b(h).find("[data-dt-idx="+i+"]").focus()};return f}); 9 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/context/ResponseDispatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.context; 11 | 12 | import com.alibaba.dubbo.remoting.exchange.Request; 13 | import com.alibaba.dubbo.remoting.exchange.Response; 14 | import com.alibaba.dubbo.rpc.RpcResult; 15 | 16 | import java.util.Map; 17 | import java.util.concurrent.CompletableFuture; 18 | import java.util.concurrent.ConcurrentHashMap; 19 | 20 | /** 21 | * @author Joey 22 | * @date 2018/6/11 12:33 23 | */ 24 | public class ResponseDispatcher { 25 | 26 | private Map futures = new ConcurrentHashMap<>(); 27 | 28 | private ResponseDispatcher() { 29 | 30 | } 31 | 32 | @SuppressWarnings("uncheck") 33 | public CompletableFuture getFuture(Request req) { 34 | return futures.get(req.getId()); 35 | } 36 | 37 | public void register(Request req) { 38 | 39 | CompletableFuture future = new CompletableFuture(); 40 | futures.put(req.getId(), future); 41 | } 42 | 43 | public void dispatch(Response res) { 44 | 45 | CompletableFuture future = futures.get(res.getId()); 46 | if (null == future) { 47 | throw new RuntimeException(); 48 | } 49 | future.complete(res.getResult()); 50 | } 51 | 52 | public CompletableFuture removeFuture(Request req) { 53 | return futures.remove(req.getId()); 54 | } 55 | 56 | static class ResponseDispatcherHolder { 57 | static final ResponseDispatcher instance = new ResponseDispatcher(); 58 | } 59 | 60 | public static ResponseDispatcher getDispatcher() { 61 | return ResponseDispatcherHolder.instance; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /mmc-dubbo-provider/src/main/java/com/mmc/dubbo/provider/user/UserMemberServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.provider.user; 11 | 12 | import com.alibaba.fastjson.JSON; 13 | import com.mmc.dubbo.api.user.GenericReq; 14 | import com.mmc.dubbo.api.user.GenericResp; 15 | import com.mmc.dubbo.api.user.UserFact; 16 | import com.mmc.dubbo.api.user.UserService; 17 | import org.slf4j.MDC; 18 | import org.springframework.beans.BeanUtils; 19 | 20 | /** 21 | * @author Joey 22 | * @date 2018/5/8 20:31 23 | */ 24 | @com.alibaba.dubbo.config.annotation.Service 25 | public class UserMemberServiceImpl implements UserService { 26 | 27 | 28 | @Override 29 | public UserFact getCurrentById(long id) { 30 | 31 | System.out.println("UserMemberServiceImpl.getCurrentById"); 32 | 33 | UserFact user = new UserFact(); 34 | user.setId(id); 35 | user.setName("SUCCESS"); 36 | 37 | return user; 38 | 39 | } 40 | 41 | @Override 42 | public UserFact insert(UserFact u, String name, int sex) { 43 | 44 | System.out.println("UserMemberServiceImpl.insert"); 45 | 46 | UserFact userFact = new UserFact(); 47 | userFact.setName(name); 48 | userFact.setSex(sex); 49 | userFact.setId(u.getId()); 50 | 51 | return userFact; 52 | 53 | } 54 | 55 | /** 56 | * 泛型测试. 57 | * 58 | * @param user 59 | * @return 60 | */ 61 | @Override 62 | public GenericResp echo(GenericReq user) { 63 | 64 | System.out.println(JSON.toJSONString(user)); 65 | 66 | System.out.println("msp: " + MDC.getCopyOfContextMap()); 67 | 68 | GenericResp resp = new GenericResp<>(); 69 | BeanUtils.copyProperties(user, resp); 70 | 71 | return resp; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/cache/MethodCaches.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.cache; 11 | 12 | import com.mmc.dubbo.doe.model.MethodModel; 13 | import com.mmc.dubbo.doe.dto.MethodModelDTO; 14 | import com.mmc.dubbo.doe.util.MD5Util; 15 | import com.mmc.dubbo.doe.util.StringUtil; 16 | 17 | import javax.validation.constraints.NotNull; 18 | import java.lang.reflect.Method; 19 | import java.util.ArrayList; 20 | import java.util.Arrays; 21 | import java.util.List; 22 | import java.util.Map; 23 | import java.util.concurrent.ConcurrentHashMap; 24 | import java.util.concurrent.atomic.AtomicLong; 25 | 26 | /** 27 | * @author Joey 28 | * @date 2018/6/15 14:55 29 | */ 30 | public class MethodCaches { 31 | 32 | private final static Map map = new ConcurrentHashMap<>(); 33 | 34 | /** 35 | * cache the method object so we can get them next time quickly. 36 | * 37 | * @param interfaceName 38 | * @param methods 39 | * @return 40 | */ 41 | public static List cache(final String interfaceName, Method[] methods) { 42 | 43 | List ret = new ArrayList<>(); 44 | 45 | Arrays.stream(methods).forEach(m -> { 46 | 47 | String key = generateMethodKey(m, interfaceName); 48 | 49 | MethodModel model = new MethodModel(key, m); 50 | 51 | ret.add(new MethodModelDTO(model)); 52 | 53 | map.putIfAbsent(key, model); // add to cache 54 | 55 | }); 56 | 57 | 58 | return ret; 59 | } 60 | 61 | private static String generateMethodKey(Method method, String interfaceName) { 62 | return StringUtil.format("{}#{}", interfaceName, MD5Util.encrypt(method.toGenericString())); 63 | } 64 | 65 | public static MethodModel get(@NotNull String key) { 66 | return map.get(key); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/cache/CuratorCaches.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.cache; 11 | 12 | import com.mmc.dubbo.doe.exception.DoeException; 13 | import com.mmc.dubbo.doe.handler.CuratorHandler; 14 | import com.mmc.dubbo.doe.model.PointModel; 15 | import com.mmc.dubbo.doe.util.ParamUtil; 16 | import com.mmc.dubbo.doe.util.StringUtil; 17 | 18 | import javax.validation.constraints.NotNull; 19 | import java.util.Map; 20 | import java.util.concurrent.ConcurrentHashMap; 21 | 22 | /** 23 | * cache all zk connection. 24 | * 25 | * @author Joey 26 | * @date 2018/6/18 20:12 27 | */ 28 | public class CuratorCaches { 29 | 30 | private final static Map map = new ConcurrentHashMap<>(); 31 | 32 | public static CuratorHandler getHandler(@NotNull String conn) throws NoSuchFieldException, IllegalAccessException { 33 | 34 | CuratorHandler client = map.get(conn); 35 | 36 | if (null == client) { 37 | 38 | 39 | try { 40 | // split host and port 41 | PointModel model = ParamUtil.parsePointModel(conn); 42 | 43 | client = new CuratorHandler("zookeeper", model.getIp(), model.getPort()); 44 | // connect to zk 45 | client.doConnect(); 46 | // async connecting, so we should wait a few second. 47 | Thread.sleep(1000); 48 | if (client.isAvailable()) { 49 | // cache client for reuse 50 | map.putIfAbsent(conn, client); 51 | } else { 52 | client.close(); 53 | } 54 | 55 | } catch(Exception e) { 56 | throw new DoeException(StringUtil.format("can't connect to {}, {}", conn, e.getMessage())); 57 | } 58 | } 59 | 60 | return client; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestCaseService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.test; 11 | 12 | import com.alibaba.fastjson.JSON; 13 | import com.alibaba.fastjson.serializer.SerializerFeature; 14 | import com.mmc.dubbo.doe.dto.ResultDTO; 15 | import com.mmc.dubbo.doe.model.CaseModel; 16 | import com.mmc.dubbo.doe.service.CaseService; 17 | import org.junit.Assert; 18 | import org.junit.Test; 19 | import org.junit.runner.RunWith; 20 | import org.springframework.beans.factory.annotation.Autowired; 21 | import org.springframework.boot.test.context.SpringBootTest; 22 | import org.springframework.test.context.junit4.SpringRunner; 23 | 24 | import java.util.List; 25 | 26 | /** 27 | * @author Joey 28 | * @date 2018/6/29 15:44 29 | */ 30 | @RunWith(SpringRunner.class) 31 | @SpringBootTest 32 | public class TestCaseService { 33 | 34 | @Autowired 35 | private CaseService caseService; 36 | 37 | @Test 38 | public void testSave() { 39 | 40 | CaseModel model = new CaseModel(); 41 | model.setCaseId(1); 42 | model.setCaseName("demo case"); 43 | model.setProviderKey("com.mmc.dubbo.api.user.UserService#172.26.246.1#30880#"); 44 | model.setMethodKey("com.mmc.dubbo.api.user.UserService#6A365B586448DD533E9F474672D657CE"); 45 | model.setJson("[{\"height\":165,\"id\":490,\"name\":\"sally\",\"sex\":0},\"sally\",0]"); 46 | 47 | ResultDTO ret = caseService.save(model); 48 | 49 | Assert.assertTrue(ret.isSuccess()); 50 | 51 | } 52 | 53 | @Test 54 | public void testListAll() { 55 | 56 | List list = caseService.listAll(); 57 | 58 | String json = JSON.toJSONString(list, SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue, 59 | SerializerFeature.WriteDateUseDateFormat); 60 | 61 | System.out.println(json); 62 | 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /mmc-dubbo-provider/src/main/java/com/mmc/dubbo/provider/user/UserFeedbackServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.provider.user; 11 | 12 | import com.alibaba.fastjson.JSON; 13 | import com.mmc.dubbo.api.user.GenericReq; 14 | import com.mmc.dubbo.api.user.GenericResp; 15 | import com.mmc.dubbo.api.user.UserFact; 16 | import com.mmc.dubbo.api.user.UserService; 17 | import org.springframework.beans.BeanUtils; 18 | 19 | /** 20 | * @author Joey 21 | * @date 2018/5/8 20:31 22 | */ 23 | @com.alibaba.dubbo.config.annotation.Service(version = "2.0.0", group = "mmcgroup") 24 | public class UserFeedbackServiceImpl implements UserService { 25 | 26 | /** 27 | * 测试方法一(单参数). 28 | * 29 | * @param id 30 | * @return 31 | */ 32 | @Override 33 | public UserFact getCurrentById(long id) { 34 | 35 | System.out.println("default provider UserFeedbackServiceImpl.getCurrentById()"); 36 | 37 | UserFact user = new UserFact(); 38 | user.setId(id); 39 | user.setName("mmcgroup"); 40 | 41 | return user; 42 | } 43 | 44 | /** 45 | * 测试方法二(多参数). 46 | * 47 | * @param u 48 | * @param name 49 | * @param sex 50 | * @return 51 | */ 52 | @Override 53 | public UserFact insert(UserFact u, String name, int sex) { 54 | 55 | UserFact userFact = new UserFact(); 56 | userFact.setName(name); 57 | userFact.setSex(sex); 58 | userFact.setId(u.getId()); 59 | 60 | return userFact; 61 | } 62 | 63 | /** 64 | * 泛型测试. 65 | * 66 | * @param user 67 | * @return 68 | */ 69 | @Override 70 | public GenericResp echo(GenericReq user) { 71 | System.out.println(JSON.toJSONString(user)); 72 | 73 | GenericResp resp = new GenericResp<>(); 74 | BeanUtils.copyProperties(user, resp); 75 | 76 | return resp; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/context/TaskContainer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.context; 11 | 12 | import lombok.extern.slf4j.Slf4j; 13 | 14 | import java.util.concurrent.*; 15 | 16 | /** 17 | * @author Joey 18 | * @date 2018/6/29 20:00 19 | */ 20 | @Slf4j 21 | public class TaskContainer { 22 | 23 | // 获取当前的cpu核心数 24 | private static final int CPU_COUNT = Runtime.getRuntime().availableProcessors(); 25 | // 线程池最大容量 26 | public static final int MAXIMUM_POOL_SIZE = CPU_COUNT; 27 | // 线程池核心容量 28 | private static final int CORE_POOL_SIZE = CPU_COUNT; 29 | // 线程池 30 | private final ThreadPoolExecutor poolExecutor; 31 | // 判断是否关闭 32 | protected volatile boolean isShutdown; 33 | // 任务计数器 34 | protected CountDownLatch watch; 35 | 36 | private TaskContainer() { 37 | 38 | // 创建任务池 39 | poolExecutor = new ThreadPoolExecutor(2, MAXIMUM_POOL_SIZE, 1, 40 | TimeUnit.HOURS, new ArrayBlockingQueue(CORE_POOL_SIZE), new RejectedExecutionHandler() { 41 | @Override 42 | public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { 43 | try { 44 | // 核心改造点,由blocking queue的offer改成put阻塞方法 45 | executor.getQueue().put(r); 46 | } catch (InterruptedException e) { 47 | log.error("任务进入队列出错:", e); 48 | } 49 | } 50 | }); 51 | 52 | } 53 | 54 | public static TaskContainer getTaskContainer() { 55 | return TaskContainerHolder.instance; 56 | } 57 | 58 | /** 59 | * execute task. 60 | * 61 | * @param task 62 | */ 63 | public void execute(Runnable task) { 64 | poolExecutor.execute(task); 65 | } 66 | 67 | static class TaskContainerHolder { 68 | static final TaskContainer instance = new TaskContainer(); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/css/jquery.gritter.css: -------------------------------------------------------------------------------- 1 | /* the norm */ 2 | #gritter-notice-wrapper { 3 | position:fixed; 4 | top:20px; 5 | right:20px; 6 | width:301px; 7 | z-index:9999; 8 | } 9 | #gritter-notice-wrapper.top-left { 10 | left: 20px; 11 | right: auto; 12 | } 13 | #gritter-notice-wrapper.bottom-right { 14 | top: auto; 15 | left: auto; 16 | bottom: 20px; 17 | right: 20px; 18 | } 19 | #gritter-notice-wrapper.bottom-left { 20 | top: auto; 21 | right: auto; 22 | bottom: 20px; 23 | left: 20px; 24 | } 25 | .gritter-item-wrapper { 26 | position:relative; 27 | margin:0 0 10px 0; 28 | background:url('../images/ie-spacer.gif'); /* ie7/8 fix */ 29 | } 30 | .gritter-top { 31 | background:url(../images/gritter.png) no-repeat left -30px; 32 | height:10px; 33 | } 34 | .hover .gritter-top { 35 | background-position:right -30px; 36 | } 37 | .gritter-bottom { 38 | background:url(../images/gritter.png) no-repeat left bottom; 39 | height:8px; 40 | margin:0; 41 | } 42 | .hover .gritter-bottom { 43 | background-position: bottom right; 44 | } 45 | .gritter-item { 46 | display:block; 47 | background:url(../images/gritter.png) no-repeat left -40px; 48 | color:#eee; 49 | padding:2px 11px 8px 11px; 50 | font-size: 11px; 51 | font-family:verdana; 52 | } 53 | .hover .gritter-item { 54 | background-position:right -40px; 55 | } 56 | .gritter-item p { 57 | padding:0; 58 | margin:0; 59 | word-wrap:break-word; 60 | } 61 | .gritter-close { 62 | display:none; 63 | position:absolute; 64 | top:5px; 65 | left:3px; 66 | background:url(../images/gritter.png) no-repeat left top; 67 | cursor:pointer; 68 | width:30px; 69 | height:30px; 70 | } 71 | .gritter-title { 72 | font-size:14px; 73 | font-weight:bold; 74 | padding:0 0 7px 0; 75 | display:block; 76 | text-shadow:1px 1px 0 #000; /* Not supported by IE :( */ 77 | } 78 | .gritter-image { 79 | width:48px; 80 | height:48px; 81 | float:left; 82 | } 83 | .gritter-with-image, 84 | .gritter-without-image { 85 | padding:0; 86 | } 87 | .gritter-with-image { 88 | width:220px; 89 | float:right; 90 | } 91 | /* for the light (white) version of the gritter notice */ 92 | .gritter-light .gritter-item, 93 | .gritter-light .gritter-bottom, 94 | .gritter-light .gritter-top, 95 | .gritter-light .gritter-close { 96 | background-image: url(../images/gritter-light.png); 97 | color: #222; 98 | } 99 | .gritter-light .gritter-title { 100 | text-shadow: none; 101 | } 102 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/MethodModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.model; 11 | 12 | import com.alibaba.dubbo.common.utils.StringUtils; 13 | import com.mmc.dubbo.doe.util.StringUtil; 14 | 15 | import java.lang.reflect.Method; 16 | import java.lang.reflect.Parameter; 17 | 18 | /** 19 | * @author Joey 20 | * @date 2018/6/15 14:54 21 | */ 22 | public class MethodModel { 23 | 24 | private final Method method; 25 | private final String key; 26 | 27 | public String getKey() { 28 | return key; 29 | } 30 | 31 | public Method getMethod() { 32 | return method; 33 | } 34 | 35 | public MethodModel(String key, Method method) { 36 | this.key = key; 37 | this.method = method; 38 | } 39 | 40 | @Override 41 | public String toString() { 42 | 43 | StringBuilder sb = new StringBuilder(); 44 | sb.append(method.getName()); 45 | sb.append("("); 46 | 47 | for (Parameter param : method.getParameters()) { 48 | sb.append(param.getType().getName()); 49 | sb.append(" "); 50 | sb.append(param.getName()); 51 | sb.append(", "); 52 | } 53 | sb.delete(sb.length() - 2, sb.length()); 54 | sb.append(")"); 55 | 56 | return sb.toString(); 57 | 58 | } 59 | 60 | public String getMethodText() { 61 | StringBuilder sb = new StringBuilder(); 62 | sb.append(method.getName()); 63 | sb.append("("); 64 | 65 | for (Parameter param : method.getParameters()) { 66 | sb.append(getShortType(param.getType().getName())); 67 | sb.append(" "); 68 | sb.append(param.getName()); 69 | sb.append(", "); 70 | } 71 | sb.delete(sb.length() - 2, sb.length()); 72 | sb.append(")"); 73 | 74 | return sb.toString(); 75 | } 76 | 77 | private String getShortType(String name) { 78 | 79 | if (StringUtils.isEmpty(name)) { 80 | return name; 81 | } 82 | int index = name.lastIndexOf("."); 83 | if (index > 0 && index < name.length()) { 84 | name = name.substring(index + 1); 85 | } 86 | return name; 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/templates/pages/tpl/top.html: -------------------------------------------------------------------------------- 1 | 2 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestDoeClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.test; 11 | 12 | import com.alibaba.dubbo.common.URL; 13 | import com.alibaba.dubbo.remoting.exchange.Request; 14 | import com.alibaba.dubbo.rpc.RpcInvocation; 15 | import com.alibaba.dubbo.rpc.RpcResult; 16 | import com.mmc.dubbo.api.user.UserFact; 17 | import com.mmc.dubbo.api.user.UserService; 18 | import com.mmc.dubbo.doe.context.ResponseDispatcher; 19 | import com.mmc.dubbo.doe.client.DoeClient; 20 | import com.mmc.dubbo.doe.util.ParamUtil; 21 | import org.junit.Assert; 22 | import org.junit.Before; 23 | import org.junit.Test; 24 | 25 | import java.lang.reflect.Method; 26 | import java.util.HashMap; 27 | import java.util.concurrent.CompletableFuture; 28 | 29 | /** 30 | * @author Joey 31 | * @date 2018/6/6 20:18 32 | */ 33 | public class TestDoeClient { 34 | 35 | private URL url = URL.valueOf("dubbo://10.204.240.75:30880/com.mmc.dubbo.api.user.UserService?anyhost=true&application=dubboConsumer&async=false&check=false&codec=dubbo&dubbo=2.6.1&generic=false&heartbeat=60000&interface=com.mmc.dubbo.api.user.UserService&methods=getCurrentById&pid=23984®ister.ip=10.204.240.75&remote.timestamp=1527252773377&revision=1.0-SNAPSHOT&side=consumer&timeout=30000×tamp=1527254250379"); 36 | private DoeClient client; 37 | 38 | @Before 39 | public void testConnect() { 40 | 41 | client = new DoeClient(url); 42 | client.doConnect(); 43 | } 44 | 45 | @Test 46 | public void testSend() throws Exception { 47 | 48 | Class clazz = UserService.class; 49 | Method method = clazz.getDeclaredMethod("getCurrentById", new Class[]{long.class}); 50 | 51 | HashMap map = ParamUtil.getAttachmentFromUrl(url); 52 | 53 | // create request. 54 | Request req = new Request(); 55 | req.setVersion("2.0.0"); 56 | req.setTwoWay(true); 57 | req.setData(new RpcInvocation(method, new Object[] {1111}, map)); 58 | 59 | client.send(req); 60 | 61 | CompletableFuture future = ResponseDispatcher.getDispatcher().getFuture(req); 62 | RpcResult result = future.get(); 63 | UserFact fact = (UserFact) result.getValue(); 64 | 65 | Assert.assertEquals("SUCCESS", fact.getName()); 66 | 67 | System.out.println("done."); 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/crontroller/CaseController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.crontroller; 11 | 12 | import com.alibaba.fastjson.JSON; 13 | import com.mmc.dubbo.doe.dto.CaseModelDTO; 14 | import com.mmc.dubbo.doe.dto.ResultDTO; 15 | import com.mmc.dubbo.doe.model.CaseModel; 16 | import com.mmc.dubbo.doe.service.CaseService; 17 | import lombok.extern.slf4j.Slf4j; 18 | import org.springframework.beans.BeanUtils; 19 | import org.springframework.beans.factory.annotation.Autowired; 20 | import org.springframework.web.bind.annotation.RequestMapping; 21 | import org.springframework.web.bind.annotation.ResponseBody; 22 | import org.springframework.web.bind.annotation.RestController; 23 | 24 | import javax.validation.constraints.NotNull; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | import java.util.stream.Collectors; 28 | 29 | /** 30 | * @author Joey 31 | * @date 2018/6/29 15:57 32 | */ 33 | @RestController 34 | @RequestMapping("/doe/case") 35 | @Slf4j 36 | public class CaseController { 37 | 38 | @Autowired 39 | private CaseService caseService; 40 | 41 | 42 | @RequestMapping("/doSave") 43 | public ResultDTO doSave(@NotNull CaseModelDTO dto) { 44 | 45 | log.info("CaseController.doSave({})", JSON.toJSONString(dto)); 46 | 47 | ResultDTO resultDTO; 48 | 49 | try { 50 | 51 | CaseModel model = new CaseModel(); 52 | BeanUtils.copyProperties(dto, model); 53 | resultDTO = caseService.save(model); 54 | 55 | } catch(Exception e) { 56 | 57 | resultDTO = ResultDTO.createExceptionResult(e, CaseModel.class); 58 | } 59 | 60 | return resultDTO; 61 | } 62 | 63 | @RequestMapping("/doList") 64 | public String doList(CaseModelDTO dto) { 65 | 66 | log.info("CaseController.doList({})", JSON.toJSONString(dto)); 67 | 68 | try { 69 | 70 | List list = caseService.listAll(); 71 | 72 | List ret = list.stream().map(l -> { 73 | CaseModel model = new CaseModel(); 74 | BeanUtils.copyProperties(l, model); 75 | return model; 76 | }).collect(Collectors.toList()); 77 | 78 | return JSON.toJSONString(ret); 79 | 80 | } catch(Exception e) { 81 | 82 | return "[]"; 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/css/jquery-ui-1.10.3.custom.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.10.3 - 2013-07-07 2 | * http://jqueryui.com 3 | * Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css 4 | * Copyright 2013 jQuery Foundation and other contributors Licensed MIT */ 5 | 6 | .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted #000}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0} -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestCuratorHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.test; 11 | 12 | import com.mmc.dubbo.doe.dto.ConnectDTO; 13 | import com.mmc.dubbo.doe.handler.CuratorHandler; 14 | import com.mmc.dubbo.doe.dto.MethodModelDTO; 15 | import com.mmc.dubbo.doe.model.ServiceModel; 16 | import com.mmc.dubbo.doe.model.UrlModel; 17 | import org.junit.Assert; 18 | import org.junit.Before; 19 | import org.junit.Test; 20 | 21 | import java.util.List; 22 | 23 | /** 24 | * @author Joey 25 | * @date 2018/6/14 19:40 26 | */ 27 | public class TestCuratorHandler { 28 | 29 | 30 | private CuratorHandler client; 31 | 32 | @Before 33 | public void testConnect() throws NoSuchFieldException, IllegalAccessException { 34 | 35 | client = new CuratorHandler("zookeeper", "127.0.0.1", 2181); 36 | client.doConnect(); 37 | 38 | } 39 | 40 | @Test 41 | public void testGetInterfaces() { 42 | 43 | List list = client.getInterfaces(); 44 | Assert.assertFalse(list.isEmpty()); 45 | 46 | System.out.println("----------------------------------------------------------------"); 47 | list.forEach(l -> { 48 | System.out.println(l); 49 | }); 50 | 51 | } 52 | 53 | @Test 54 | public void testGetProviders() { 55 | 56 | String interfaceName = "com.mmc.dubbo.api.user.UserService"; 57 | 58 | ConnectDTO dto = new ConnectDTO(); 59 | dto.setServiceName(interfaceName); 60 | 61 | List list = client.getProviders(dto); 62 | Assert.assertTrue(list.size() <= 1); 63 | 64 | dto.setVersion("2.0.0"); 65 | dto.setGroup("mmcgroup"); 66 | list = client.getProviders(dto); 67 | Assert.assertTrue(list.size() == 0); 68 | 69 | System.out.println("----------------------------------------------------------------"); 70 | list.forEach(l -> { 71 | System.out.println(l); 72 | }); 73 | } 74 | 75 | @Test 76 | public void testGetMethods() throws ClassNotFoundException { 77 | 78 | String interfaceName = "com.mmc.dubbo.api.user.UserService"; 79 | List list = client.getMethods(interfaceName); 80 | Assert.assertFalse(list.isEmpty()); 81 | 82 | System.out.println("----------------------------------------------------------------"); 83 | list.forEach(l -> { 84 | System.out.println(l); 85 | }); 86 | } 87 | 88 | 89 | 90 | } 91 | -------------------------------------------------------------------------------- /deploy/SimpleHttpServer.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # --coding:utf-8-- 3 | 4 | import os 5 | import time 6 | from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer 7 | from os import path 8 | import urlparse 9 | 10 | curdir = path.dirname(path.realpath(__file__)) 11 | sep = '/' 12 | 13 | # MIME-TYPE 14 | mimedic = [ 15 | ('.html', 'text/html'), 16 | ('.htm', 'text/html'), 17 | ('.js', 'application/javascript'), 18 | ('.css', 'text/css'), 19 | ('.json', 'application/json'), 20 | ('.png', 'image/png'), 21 | ('.jpg', 'image/jpeg'), 22 | ('.gif', 'image/gif'), 23 | ('.txt', 'text/plain'), 24 | ('.avi', 'video/x-msvideo'), 25 | ] 26 | 27 | class SimpleHttpServerHandler(BaseHTTPRequestHandler): 28 | 29 | def log(self, msg): 30 | timstr = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) 31 | print("[%s] %s" % (timstr, msg)) 32 | 33 | # GET 34 | def do_GET(self): 35 | 36 | querypath = urlparse.urlparse(self.path) 37 | filepath, query = querypath.path, querypath.query 38 | 39 | filename, fileext = path.splitext(filepath) 40 | 41 | self.log(filename + " --- " + fileext) 42 | 43 | # 支持命令集合 44 | urlSet = set(("/start", "/stop", "/reload", "/republish")) 45 | sendReply = filename in urlSet 46 | 47 | if sendReply == True: 48 | try: 49 | 50 | param = filename[1:] 51 | 52 | self.log("/app/doe/deploy.sh " + param) 53 | os.system("/app/doe/deploy.sh " + param) 54 | 55 | content = ("{'success': true, 'msg': 'success.'}").encode("utf-8") 56 | self.send_response(200) 57 | self.send_header('Content-type', 'application/json') 58 | self.end_headers() 59 | self.wfile.write(content) 60 | except IOError: 61 | self.log('File Not Found: %s' % self.path) 62 | self.send_error(404, 'File Not Found: %s' % self.path) 63 | else: 64 | 65 | try: 66 | content = ("{'success': false, 'msg': 'no match url.'}").encode("utf-8") 67 | self.send_response(200) 68 | self.send_header('Content-type', 'application/json') 69 | self.end_headers() 70 | self.wfile.write(content) 71 | except IOError: 72 | self.log('File Not Found: %s' % self.path) 73 | self.send_error(404, 'File Not Found: %s' % self.path) 74 | 75 | 76 | def run(): 77 | port = 8000 78 | print('starting server, port', port) 79 | 80 | # Server settings 81 | server_address = ('', port) 82 | httpd = HTTPServer(server_address, SimpleHttpServerHandler) 83 | print('running server...') 84 | httpd.serve_forever() 85 | 86 | 87 | if __name__ == '__main__': 88 | run() 89 | 90 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/js/fuelux/fuelux.wizard.min.js: -------------------------------------------------------------------------------- 1 | (function(b,c){var a=function(f,e){var d;this.$element=b(f);this.options=b.extend({},b.fn.wizard.defaults,e);this.currentStep=1;this.numSteps=this.$element.find("li").length;this.$prevBtn=this.$element.find("button.btn-prev");this.$nextBtn=this.$element.find("button.btn-next");d=this.$nextBtn.children().detach();this.nextText=b.trim(this.$nextBtn.text());this.$nextBtn.append(d);this.$prevBtn.on("click",b.proxy(this.previous,this));this.$nextBtn.on("click",b.proxy(this.next,this));this.$element.on("click","li.complete",b.proxy(this.stepclicked,this));this.$stepContainer=this.$element.data("target")||"body";this.$stepContainer=b(this.$stepContainer)};a.prototype={constructor:a,setState:function(){var n=(this.currentStep>1);var o=(this.currentStep===1);var d=(this.currentStep===this.numSteps);this.$prevBtn.attr("disabled",(o===true||n===false));var h=this.$nextBtn.data();if(h&&h.last){this.lastText=h.last;if(typeof this.lastText!=="undefined"){var l=(d!==true)?this.nextText:this.lastText;var f=this.$nextBtn.children().detach();this.$nextBtn.text(l).append(f)}}var j=this.$element.find("li");j.removeClass("active").removeClass("complete");j.find("span.badge").removeClass("badge-info").removeClass("badge-success");var m="li:lt("+(this.currentStep-1)+")";var g=this.$element.find(m);g.addClass("complete");g.find("span.badge").addClass("badge-success");var e="li:eq("+(this.currentStep-1)+")";var k=this.$element.find(e);k.addClass("active");k.find("span.badge").addClass("badge-info");var i=k.data().target;this.$stepContainer.find(".step-pane").removeClass("active");b(i).addClass("active");this.$element.trigger("changed")},stepclicked:function(h){var d=b(h.currentTarget);var g=this.$element.find("li").index(d);var f=b.Event("stepclick");this.$element.trigger(f,{step:g+1});if(f.isDefaultPrevented()){return}this.currentStep=(g+1);this.setState()},previous:function(){var d=(this.currentStep>1);if(d){var f=b.Event("change");this.$element.trigger(f,{step:this.currentStep,direction:"previous"});if(f.isDefaultPrevented()){return}this.currentStep-=1;this.setState()}},next:function(){var g=(this.currentStep+1<=this.numSteps);var d=(this.currentStep===this.numSteps);if(g){var f=b.Event("change");this.$element.trigger(f,{step:this.currentStep,direction:"next"});if(f.isDefaultPrevented()){return}this.currentStep+=1;this.setState()}else{if(d){this.$element.trigger("finished")}}},selectedItem:function(d){return{step:this.currentStep}}};b.fn.wizard=function(e,g){var f;var d=this.each(function(){var j=b(this);var i=j.data("wizard");var h=typeof e==="object"&&e;if(!i){j.data("wizard",(i=new a(this,h)))}if(typeof e==="string"){f=i[e](g)}});return(f===c)?d:f};b.fn.wizard.defaults={};b.fn.wizard.Constructor=a;b(function(){b("body").on("mousedown.wizard.data-api",".wizard",function(){var d=b(this);if(d.data("wizard")){return}d.wizard(d.data())})})})(window.jQuery); -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/crontroller/HomeController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.crontroller; 11 | 12 | import com.mmc.dubbo.doe.service.MenuService; 13 | import org.springframework.beans.factory.annotation.Autowired; 14 | import org.springframework.stereotype.Controller; 15 | import org.springframework.ui.Model; 16 | import org.springframework.web.bind.annotation.RequestMapping; 17 | 18 | /** 19 | * @author Joey 20 | * @date 2018/6/16 11:57 21 | */ 22 | @Controller 23 | @RequestMapping("/doe/home") 24 | public class HomeController { 25 | 26 | @Autowired 27 | private MenuService menuService; 28 | 29 | @RequestMapping("/index") 30 | public String index(Model model) { 31 | 32 | // open easyCnt page defaultly. 33 | return index("f16001100", model); 34 | } 35 | 36 | @RequestMapping("/main") 37 | public String index(String mid, Model model) { 38 | 39 | // you can do something here, such as auth validation,,, 40 | Integer menuId = Integer.valueOf(mid.substring(1)); 41 | String path = menuService.getUrl(menuId); 42 | String menuHtml = menuService.getHtml(); 43 | 44 | model.addAttribute("mid", mid); 45 | model.addAttribute("menuHtml", menuHtml); 46 | 47 | return path; 48 | 49 | } 50 | 51 | 52 | @RequestMapping("/normalCnt") 53 | public String openNormalPage() { 54 | 55 | return "/pages/v3/normalCnt.html"; 56 | } 57 | 58 | @RequestMapping("/caseCnt") 59 | public String openCasePage() { 60 | 61 | return "/pages/v3/caseCnt.html"; 62 | } 63 | 64 | @RequestMapping("/easyCnt") 65 | public String openEasyPage() { 66 | 67 | return "/pages/v3/easyCnt.html"; 68 | } 69 | 70 | @RequestMapping("/addJar") 71 | public String openAddJarPage() { 72 | 73 | return "/pages/v3/addJar.html"; 74 | } 75 | 76 | @RequestMapping("/listJar") 77 | public String openListJarPage() { 78 | 79 | return "/pages/v3/listJar.html"; 80 | } 81 | @RequestMapping("/editPom") 82 | public String openEditPomPage() { 83 | 84 | return "/pages/v3/editPom.html"; 85 | } 86 | 87 | @RequestMapping("/listZk") 88 | public String openListZkPage() { 89 | 90 | return "/pages/v3/listZk.html"; 91 | } 92 | 93 | @RequestMapping("/sys") 94 | public String openSysPage() { 95 | 96 | return "/pages/v3/sys.html"; 97 | } 98 | 99 | } 100 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/auth/MenuTree.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | /** 11 | * 12 | */ 13 | package com.mmc.dubbo.doe.auth; 14 | 15 | import java.io.Serializable; 16 | 17 | /** 18 | * 菜单树实体类. 19 | * @author Joey 20 | * 2016年5月26日 下午1:20:34 21 | */ 22 | public class MenuTree implements Serializable{ 23 | 24 | /** 25 | * 26 | */ 27 | private static final long serialVersionUID = 1485485452L; 28 | 29 | private Integer uId; 30 | private Integer roleId; 31 | private Integer menuId; 32 | private Integer pmenuId; 33 | private String menuName; 34 | private String menuUrl; 35 | private String menuStyle; 36 | private Integer mlevel; 37 | private Integer mleft; 38 | private Integer mright; 39 | 40 | public Integer getuId() { 41 | return uId; 42 | } 43 | public void setuId(Integer uId) { 44 | this.uId = uId; 45 | } 46 | public Integer getMenuId() { 47 | return menuId; 48 | } 49 | public void setMenuId(Integer menuId) { 50 | this.menuId = menuId; 51 | } 52 | public Integer getPmenuId() { 53 | return pmenuId; 54 | } 55 | public void setPmenuId(Integer pmenuId) { 56 | this.pmenuId = pmenuId; 57 | } 58 | public String getMenuName() { 59 | return menuName; 60 | } 61 | public void setMenuName(String menuName) { 62 | this.menuName = menuName; 63 | } 64 | public String getMenuUrl() { 65 | return menuUrl; 66 | } 67 | public void setMenuUrl(String menuUrl) { 68 | this.menuUrl = menuUrl; 69 | } 70 | public String getMenuStyle() { 71 | return menuStyle; 72 | } 73 | public void setMenuStyle(String menuStyle) { 74 | this.menuStyle = menuStyle; 75 | } 76 | public Integer getMlevel() { 77 | return mlevel; 78 | } 79 | public void setMlevel(Integer mlevel) { 80 | this.mlevel = mlevel; 81 | } 82 | public Integer getMleft() { 83 | return mleft; 84 | } 85 | public void setMleft(Integer mleft) { 86 | this.mleft = mleft; 87 | } 88 | public Integer getMright() { 89 | return mright; 90 | } 91 | public void setMright(Integer mright) { 92 | this.mright = mright; 93 | } 94 | public Integer getRoleId() { 95 | return roleId; 96 | } 97 | public void setRoleId(Integer roleId) { 98 | this.roleId = roleId; 99 | } 100 | 101 | 102 | } 103 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestClassService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.test; 11 | 12 | import com.alibaba.fastjson.JSON; 13 | import com.mmc.dubbo.api.user.UserService; 14 | import com.mmc.dubbo.doe.dto.ConnectDTO; 15 | import com.mmc.dubbo.doe.dto.MethodModelDTO; 16 | import com.mmc.dubbo.doe.dto.ResultDTO; 17 | import com.mmc.dubbo.doe.service.ClassService; 18 | import org.junit.Assert; 19 | import org.junit.Test; 20 | import org.junit.runner.RunWith; 21 | import org.springframework.beans.factory.annotation.Autowired; 22 | import org.springframework.boot.test.context.SpringBootTest; 23 | import org.springframework.test.context.junit4.SpringRunner; 24 | 25 | import java.util.List; 26 | 27 | /** 28 | * @author Joey 29 | * @date 2018/6/27 17:17 30 | */ 31 | @RunWith(SpringRunner.class) 32 | @SpringBootTest 33 | public class TestClassService { 34 | 35 | @Autowired 36 | private ClassService classService; 37 | 38 | @Test 39 | public void testGenerateMethodParamsJsonString() throws InstantiationException, IllegalAccessException, ClassNotFoundException { 40 | 41 | System.out.println("begin."); 42 | 43 | MethodModelDTO dto = new MethodModelDTO(); 44 | dto.setInterfaceName("com.mmc.dubbo.doe.service.ConnectService"); 45 | dto.setMethodName("send"); 46 | ResultDTO ret = classService.generateMethodParamsJsonString(dto); 47 | 48 | Assert.assertTrue(ret.isSuccess()); 49 | System.out.println(ret.getData()); 50 | 51 | System.out.println("-----------------------------"); 52 | 53 | dto.setInterfaceName("com.mmc.dubbo.doe.service.PomService"); 54 | dto.setMethodName("appendPom"); 55 | 56 | ret = classService.generateMethodParamsJsonString(dto); 57 | Assert.assertTrue(ret.isSuccess()); 58 | System.out.println(ret.getData()); 59 | 60 | System.out.println("done."); 61 | } 62 | 63 | @Test 64 | public void testListMethods() { 65 | 66 | System.out.println("begin."); 67 | 68 | ConnectDTO dto = new ConnectDTO(); 69 | dto.setServiceName(UserService.class.getName()); 70 | 71 | List ret = classService.listMethods(dto); 72 | 73 | Assert.assertFalse(ret.isEmpty()); 74 | 75 | System.out.println(JSON.toJSONString(ret)); 76 | 77 | System.out.println("------------------------"); 78 | 79 | ret = classService.listMethods(dto); 80 | 81 | System.out.println(JSON.toJSONString(ret)); 82 | 83 | 84 | System.out.println("done."); 85 | 86 | } 87 | 88 | 89 | } 90 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/js/fuelux/fuelux.spinner.min.js: -------------------------------------------------------------------------------- 1 | (function(b,c){var a=function(e,d){this.$element=b(e);this.options=b.extend({},b.fn.spinner.defaults,d);this.$input=this.$element.find(".spinner-input");this.$element.on("keyup",this.$input,b.proxy(this.change,this));if(this.options.hold){this.$element.on("mousedown",".spinner-up",b.proxy(function(){this.startSpin(true)},this));this.$element.on("mouseup",".spinner-up, .spinner-down",b.proxy(this.stopSpin,this));this.$element.on("mouseout",".spinner-up, .spinner-down",b.proxy(this.stopSpin,this));this.$element.on("mousedown",".spinner-down",b.proxy(function(){this.startSpin(false)},this))}else{this.$element.on("click",".spinner-up",b.proxy(function(){this.step(true)},this));this.$element.on("click",".spinner-down",b.proxy(function(){this.step(false)},this))}this.switches={count:1,enabled:true};if(this.options.speed==="medium"){this.switches.speed=300}else{if(this.options.speed==="fast"){this.switches.speed=100}else{this.switches.speed=500}}this.lastValue=null;this.render();if(this.options.disabled){this.disable()}};a.prototype={constructor:a,render:function(){this.$input.val(this.options.value);this.$input.attr("maxlength",(this.options.max+"").split("").length)},change:function(){var d=this.$input.val();if(d/1){this.options.value=d/1}else{d=d.replace(/[^0-9]/g,"");this.$input.val(d);this.options.value=d/1}this.triggerChangedEvent()},stopSpin:function(){clearTimeout(this.switches.timeout);this.switches.count=1;this.triggerChangedEvent()},triggerChangedEvent:function(){var d=this.value();if(d===this.lastValue){return}this.lastValue=d;this.$element.trigger("changed",d);this.$element.trigger("change")},startSpin:function(d){if(!this.options.disabled){var e=this.switches.count;if(e===1){this.step(d);e=1}else{if(e<3){e=1.5}else{if(e<8){e=2.5}else{e=4}}}this.switches.timeout=setTimeout(b.proxy(function(){this.iterator(d)},this),this.switches.speed/e);this.switches.count++}},iterator:function(d){this.step(d);this.startSpin(d)},step:function(e){var g=this.options.value;var f=e?this.options.max:this.options.min;if((e?gf)){var d=g+(e?1:-1)*this.options.step;if(e?d>f:d urls = curatorHandler.getProviders(conn); 54 | 55 | URL url = urls.get(0).getUrl(); 56 | url = url.addParameter(Constants.CODEC_KEY, protocol); // 非常重要,必须要设置编码器协议类型 57 | DoeClient client = new DoeClient(url); 58 | client.doConnect(); 59 | 60 | HashMap map = ParamUtil.getAttachmentFromUrl(url); 61 | Class clazz = Class.forName(interfaceName); 62 | Method[] methods = clazz.getMethods(); 63 | Method method = methods[0]; 64 | Object[] params = ParamUtil.parseJson(jsonStr, method); 65 | 66 | // create request. 67 | Request req = new Request(); 68 | req.setVersion("2.0.0"); 69 | req.setTwoWay(true); 70 | req.setData(new RpcInvocation(method, params, map)); 71 | 72 | client.send(req); 73 | 74 | CompletableFuture future = ResponseDispatcher.getDispatcher().getFuture(req); 75 | RpcResult result = future.get(10, TimeUnit.SECONDS); 76 | UserFact fact = (UserFact) result.getValue(); 77 | 78 | Assert.assertEquals("SUCCESS", fact.getName()); 79 | 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /mmc-dubbo-provider/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 4.0.0 6 | 7 | 8 | org.springframework.boot 9 | spring-boot-starter-parent 10 | 2.0.2.RELEASE 11 | 12 | 13 | 14 | mmc-dubbo 15 | provider 16 | 1.3-SNAPSHOT 17 | jar 18 | 19 | mmc-dubbo-provider 20 | 21 | 22 | UTF-8 23 | 1.8 24 | 1.8 25 | 26 | 0.2.0 27 | 28 | 1.2.51 29 | 30 | 31 | 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-starter-web 36 | 37 | 38 | org.springframework.boot 39 | spring-boot-starter-test 40 | test 41 | 42 | 43 | com.alibaba.boot 44 | dubbo-spring-boot-starter 45 | ${version.starter.dubbo} 46 | 47 | 48 | org.projectlombok 49 | lombok 50 | true 51 | compile 52 | 53 | 54 | 55 | com.alibaba 56 | fastjson 57 | ${version.fastjson} 58 | 59 | 60 | 61 | mmc-dubbo 62 | api 63 | 1.0-RELEASE 64 | 65 | 66 | 67 | 68 | 69 | provider 70 | 71 | 72 | org.springframework.boot 73 | spring-boot-maven-plugin 74 | 75 | com.fcbox.conf.server.ConfServerApplication 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/css/colorpicker.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Colorpicker for Bootstrap 3 | * 4 | * Copyright 2012 Stefan Petre 5 | * Licensed under the Apache License v2.0 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | */ 9 | .colorpicker-saturation { 10 | width: 100px; 11 | height: 100px; 12 | background-image: url(img/saturation.png); 13 | cursor: crosshair; 14 | float: left; 15 | } 16 | .colorpicker-saturation i { 17 | display: block; 18 | height: 5px; 19 | width: 5px; 20 | border: 1px solid #000; 21 | -webkit-border-radius: 5px; 22 | -moz-border-radius: 5px; 23 | border-radius: 5px; 24 | position: absolute; 25 | top: 0; 26 | left: 0; 27 | margin: -4px 0 0 -4px; 28 | } 29 | .colorpicker-saturation i b { 30 | display: block; 31 | height: 5px; 32 | width: 5px; 33 | border: 1px solid #fff; 34 | -webkit-border-radius: 5px; 35 | -moz-border-radius: 5px; 36 | border-radius: 5px; 37 | } 38 | .colorpicker-hue, .colorpicker-alpha { 39 | width: 15px; 40 | height: 100px; 41 | float: left; 42 | cursor: row-resize; 43 | margin-left: 4px; 44 | margin-bottom: 4px; 45 | } 46 | .colorpicker-hue i, .colorpicker-alpha i { 47 | display: block; 48 | height: 1px; 49 | background: #000; 50 | border-top: 1px solid #fff; 51 | position: absolute; 52 | top: 0; 53 | left: 0; 54 | width: 100%; 55 | margin-top: -1px; 56 | } 57 | .colorpicker-hue { 58 | background-image: url(img/hue.png); 59 | } 60 | .colorpicker-alpha { 61 | background-image: url(img/alpha.png); 62 | display: none; 63 | } 64 | .colorpicker { 65 | *zoom: 1; 66 | top: 0; 67 | left: 0; 68 | padding: 4px; 69 | min-width: 120px; 70 | margin-top: 1px; 71 | -webkit-border-radius: 4px; 72 | -moz-border-radius: 4px; 73 | border-radius: 4px; 74 | } 75 | .colorpicker:before, .colorpicker:after { 76 | display: table; 77 | content: ""; 78 | } 79 | .colorpicker:after { 80 | clear: both; 81 | } 82 | .colorpicker:before { 83 | content: ''; 84 | display: inline-block; 85 | border-left: 7px solid transparent; 86 | border-right: 7px solid transparent; 87 | border-bottom: 7px solid #ccc; 88 | border-bottom-color: rgba(0, 0, 0, 0.2); 89 | position: absolute; 90 | top: -7px; 91 | left: 6px; 92 | } 93 | .colorpicker:after { 94 | content: ''; 95 | display: inline-block; 96 | border-left: 6px solid transparent; 97 | border-right: 6px solid transparent; 98 | border-bottom: 6px solid #ffffff; 99 | position: absolute; 100 | top: -6px; 101 | left: 7px; 102 | } 103 | .colorpicker div { 104 | position: relative; 105 | } 106 | .colorpicker.alpha { 107 | min-width: 140px; 108 | } 109 | .colorpicker.alpha .colorpicker-alpha { 110 | display: block; 111 | } 112 | .colorpicker-color { 113 | height: 10px; 114 | margin-top: 5px; 115 | clear: both; 116 | background-image: url(img/alpha.png); 117 | background-position: 0 100%; 118 | } 119 | .colorpicker-color div { 120 | height: 10px; 121 | } 122 | .input-append.color .add-on i, .input-prepend.color .add-on i { 123 | display: block; 124 | cursor: pointer; 125 | width: 16px; 126 | height: 16px; 127 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Doe 发布 [V1.3.0] 3 | 4 | 前段时间排查某问题的时候,想要快速知道某些dubbo接口(三无)的响应结果,但不想启动项目(因为这些项目不是你负责的,不会部署而且超级笨重),也不想新建一个dubbo客户端项目(占地方),也不想开telnet客户端连接口(麻烦而且有限制)。所以扣了dubbo的netty模块源码,封装了个收发客户端集成一个工具,可以快速调试dubbo接口。 5 | 6 | ![极简模式](https://github.com/VIPJoey/doe/blob/master/deploy/easy.png) 7 | ![普通模式](https://github.com/VIPJoey/doe/blob/master/deploy/normal.png) 8 | 9 | 10 | ## 目录结构 11 | 12 | - mmc-dubbo-api 接口项目,主要用于测试。 13 | - mmc-dubbo-provider dubbo提供者项目,主要用于测试。 14 | - mmc-dubbo-doe 主项目,实现dubbo接口调试。 15 | - deploy 部署文档 16 | 17 | 18 | ## 功能特性 19 | 20 | - 极简模式:通过dubbo提供的telnet协议收发数据。 21 | - 普通模式:通过封装netty客户端收发数据。 22 | - 用例模式:通过缓存数据,方便下一次操作,依赖普通模式。 23 | - 增加依赖:通过调用maven命令,下载jar包和热加载到系统,主要用来分析接口方法参数,主要作用在普通模式(已过时,请使用【依赖编辑】模块)。 24 | - 依赖列表:通过分析pom文件,展示已经加载的jar包。 25 | - 依赖编辑:可以直接编辑pom文件,新增修改依赖jar。 26 | - 注册中心:可以添加或删除zookeeper注册中心。 27 | - 系统配置:可以清空jar或者重新加载jar。 28 | 29 | 30 | ## 其它特性 31 | 32 | - springboot 整合 redis,支持spring el 表达式。 33 | - springboot 整合 thymeleaf。 34 | - springboot 整合 logback。 35 | - netty rpc 实现原理。 36 | - 热加载和沙箱隔离原理。 37 | 38 | ## 开发环境 39 | 40 | - jdk 1.8 41 | - maven 3.5.3 42 | - dubbo 2.6.1 43 | - lombok 1.16.20 44 | - idea 2018 45 | - windows 7 46 | 47 | 48 | ## 启动方式 49 | * IDEA 启动 50 | - 安装JDK、并设置环境变量 51 | - 安装MAVEN,并设置好环境变量,仓库目录 52 | - 安装REDIS,设置相关配置 53 | - 安装IDEA,设置IDEA环境 54 | - 导入项目到IDEA,设置为maven工程,勾选profile环境 55 | - 根据各自需要,修改application-dev.yml或application-prd.yml配置文件,除了redis配置项,其它建议保持默认配置 56 | - 在当前IDEA的workspace所在根目录,创建/app/doe目录 57 | - 例如:application-*.yml为默认配置,且当前IDEA的workspace为F:\idea-workspaces\mmc-workspace\,则在F盘创建F:\app\doe 58 | - 进入mmc-dubbo-api目录,执行mvn clean install命令,生成api的jar包。 59 | - 进入mmc-dubbo-doe目录,执行mvn clean install 命令,在target目录生成dubbo-doe.jar 60 | - 打开mmc-dubbo-doe工程,找到DubboDoeApplication.java类,右键点击运行即可。 61 | - 默认日志目录:/app/applogs/doe 62 | - 打开浏览器,访问地址:http://localhost:9876/doe/home/index 63 | * LINUX 启动 64 | - 安装JDK、并设置环境变量 65 | - 安装MAVEN,并设置好环境变量,仓库目录 66 | - 安装REDIS,设置相关配置 67 | - 安装PYTHON(可选) 68 | - 执行mkdir -p /app/doe,创建/app/doe目录,注意权限问题 69 | - 把deploy目录中的所有文件上传到/app/doe 70 | - 参考IDEA方式,下载DOE源码,并编译生成dubbo-doe.jar,并上传到/app/doe 目录 71 | - 进入/app/doe 目录,执行chmod +x deploy.sh 72 | - 进入/app/doe 目录,执行 ./deploy.sh start 启动项目,支持(start/stop)参数,详细参数用途请阅读deploy.sh源码 73 | - 默认日志目录:/app/applogs/doe 74 | - 打开浏览器,访问地址:http://ip:9876/doe/home/index 75 | 76 | ## 项目介绍 77 | - https://blog.csdn.net/hanyi_?t=1 78 | - https://blog.csdn.net/hanyi_/article/details/113945026 79 | 80 | ## 发布记录 81 | * [发布记录](https://github.com/VIPJoey/doe/blob/feature/doe_v1.3.0/UPGRADE.md) 82 | 83 | ## 特别说明 84 | - 由于平时比较忙,仓促写下的代码未免有BUG,请见谅 85 | - 如遇到问题,可以github上留言,或贡献您的代码 86 | 87 | ## 关于内推 88 | 89 | 90 | 91 | 92 | 93 | 94 | 97 | 98 |
    关注公众号即可获得大厂内推机会,优质简历可以全程帮忙跟踪进度,欢迎投递。
    95 | 96 |
    99 | 100 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestConnectService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved. 3 | * 4 | * This software is the confidential and proprietary information of 5 | * Founder. You shall not disclose such Confidential Information 6 | * and shall use it only in accordance with the terms of the agreements 7 | * you entered into with Founder. 8 | * 9 | */ 10 | package com.mmc.dubbo.doe.test; 11 | 12 | import com.alibaba.fastjson.JSON; 13 | import com.mmc.dubbo.doe.dto.ConnectDTO; 14 | import com.mmc.dubbo.doe.dto.MethodModelDTO; 15 | import com.mmc.dubbo.doe.dto.ResultDTO; 16 | import com.mmc.dubbo.doe.dto.UrlModelDTO; 17 | import com.mmc.dubbo.doe.model.ServiceModel; 18 | import com.mmc.dubbo.doe.service.ClassService; 19 | import com.mmc.dubbo.doe.service.ConnectService; 20 | import org.junit.Assert; 21 | import org.junit.Test; 22 | import org.junit.runner.RunWith; 23 | import org.springframework.beans.factory.annotation.Autowired; 24 | import org.springframework.boot.test.context.SpringBootTest; 25 | import org.springframework.test.context.junit4.SpringRunner; 26 | 27 | import java.util.List; 28 | 29 | /** 30 | * @author Joey 31 | * @date 2018/6/29 10:17 32 | */ 33 | @RunWith(SpringRunner.class) 34 | @SpringBootTest 35 | public class TestConnectService { 36 | 37 | @Autowired 38 | private ConnectService connectService; 39 | @Autowired 40 | private ClassService classService; 41 | 42 | @Test 43 | public void testSend() throws Exception { 44 | 45 | String conn = "127.0.0.1:2181"; 46 | 47 | // connect to zk 48 | List models = connectService.connect(conn); 49 | 50 | String interfaceName = "com.mmc.dubbo.api.user.UserService"; 51 | ServiceModel model = new ServiceModel(); 52 | model.setServiceName(interfaceName); 53 | 54 | Assert.assertTrue(models.contains(model)); 55 | 56 | // list all providers 57 | ConnectDTO connectDTO = new ConnectDTO(); 58 | connectDTO.setServiceName(interfaceName); 59 | connectDTO.setConn(conn); 60 | List providers = connectService.listProviders(connectDTO); 61 | 62 | Assert.assertFalse(providers.isEmpty()); 63 | 64 | // list all method 65 | List methods = classService.listMethods(connectDTO); 66 | 67 | Assert.assertFalse(methods.isEmpty()); 68 | 69 | // get the expected method 70 | MethodModelDTO methodModelDTO = methods.stream().filter(m -> m.getMethodName().equals("insert") ).findAny().orElse(null); 71 | 72 | Assert.assertNotNull(methodModelDTO); 73 | 74 | // send request 75 | UrlModelDTO provider = providers.get(0); 76 | connectDTO.setProviderKey(provider.getKey()); 77 | connectDTO.setMethodKey(methodModelDTO.getMethodKey()); 78 | connectDTO.setJson("[{\"id\": 88888}, \"sally\", 1]"); 79 | ResultDTO ret = connectService.send(connectDTO); 80 | 81 | Assert.assertTrue(ret.isSuccess()); 82 | 83 | System.out.println(JSON.toJSONString(ret)); 84 | 85 | } 86 | 87 | 88 | 89 | } 90 | -------------------------------------------------------------------------------- /mmc-dubbo-doe/src/main/resources/static/v3/assets/js/jquery.autosize.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | Autosize v1.17.7 - 2013-09-03 3 | Automatically adjust textarea height based on user input. 4 | (c) 2013 Jack Moore - http://www.jacklmoore.com/autosize 5 | license: http://www.opensource.org/licenses/mit-license.php 6 | */ 7 | (function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(window.jQuery||window.$)})(function(e){var t,o={className:"autosizejs",append:"",callback:!1,resizeDelay:10},i='