Full Code of VIPJoey/doe for AI

master b37e58184bb1 cached
154 files
1.0 MB
302.2k tokens
566 symbols
1 requests
Download .txt
Showing preview only (1,113K chars total). Download the full file or copy to clipboard to get everything.
Repository: VIPJoey/doe
Branch: master
Commit: b37e58184bb1
Files: 154
Total size: 1.0 MB

Directory structure:
gitextract_eeqj_19b/

├── .gitattributes
├── .gitignore
├── README.md
├── UPGRADE.md
├── deploy/
│   ├── SimpleHttpServer.py
│   ├── deploy.sh
│   ├── pom.xml
│   └── pom.xml.backup
├── mmc-dubbo-api/
│   ├── .gitignore
│   ├── pom.xml
│   └── src/
│       └── main/
│           └── java/
│               └── com/
│                   └── mmc/
│                       └── dubbo/
│                           └── api/
│                               └── user/
│                                   ├── GenericReq.java
│                                   ├── GenericResp.java
│                                   ├── UserFact.java
│                                   └── UserService.java
├── mmc-dubbo-doe/
│   ├── .gitignore
│   ├── pom.xml
│   └── src/
│       ├── main/
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── mmc/
│       │   │           └── dubbo/
│       │   │               └── doe/
│       │   │                   ├── DubboDoeApplication.java
│       │   │                   ├── auth/
│       │   │                   │   ├── MenuNode.java
│       │   │                   │   └── MenuTree.java
│       │   │                   ├── cache/
│       │   │                   │   ├── CuratorCaches.java
│       │   │                   │   ├── DoeRedisResolver.java
│       │   │                   │   ├── MethodCaches.java
│       │   │                   │   ├── RedisConfiguration.java
│       │   │                   │   ├── RedisResolver.java
│       │   │                   │   └── UrlCaches.java
│       │   │                   ├── channel/
│       │   │                   │   └── NettyChannel.java
│       │   │                   ├── client/
│       │   │                   │   ├── DoeClient.java
│       │   │                   │   ├── ProcessClient.java
│       │   │                   │   └── TransportClient.java
│       │   │                   ├── context/
│       │   │                   │   ├── ApplicationReadyEventListener.java
│       │   │                   │   ├── Const.java
│       │   │                   │   ├── DoeClassLoader.java
│       │   │                   │   ├── ResponseDispatcher.java
│       │   │                   │   └── TaskContainer.java
│       │   │                   ├── crontroller/
│       │   │                   │   ├── CaseController.java
│       │   │                   │   ├── DubboController.java
│       │   │                   │   ├── HomeController.java
│       │   │                   │   ├── PomController.java
│       │   │                   │   ├── RegistryController.java
│       │   │                   │   └── SysConfController.java
│       │   │                   ├── dao/
│       │   │                   │   └── CaseDAO.java
│       │   │                   ├── dto/
│       │   │                   │   ├── BaseDTO.java
│       │   │                   │   ├── CaseModelDTO.java
│       │   │                   │   ├── ConnectDTO.java
│       │   │                   │   ├── MethodModelDTO.java
│       │   │                   │   ├── PomDTO.java
│       │   │                   │   ├── ResultDTO.java
│       │   │                   │   └── UrlModelDTO.java
│       │   │                   ├── exception/
│       │   │                   │   └── DoeException.java
│       │   │                   ├── handler/
│       │   │                   │   ├── CuratorHandler.java
│       │   │                   │   ├── SendReceiveHandler.java
│       │   │                   │   └── StreamHandler.java
│       │   │                   ├── model/
│       │   │                   │   ├── CaseModel.java
│       │   │                   │   ├── MethodModel.java
│       │   │                   │   ├── PointModel.java
│       │   │                   │   ├── PomModel.java
│       │   │                   │   ├── RegistryModel.java
│       │   │                   │   ├── ServiceModel.java
│       │   │                   │   └── UrlModel.java
│       │   │                   ├── service/
│       │   │                   │   ├── CaseService.java
│       │   │                   │   ├── ClassService.java
│       │   │                   │   ├── ConfigService.java
│       │   │                   │   ├── ConnectService.java
│       │   │                   │   ├── MenuService.java
│       │   │                   │   ├── PomService.java
│       │   │                   │   ├── TelnetService.java
│       │   │                   │   └── impl/
│       │   │                   │       ├── CaseServiceImpl.java
│       │   │                   │       ├── ClassServiceImpl.java
│       │   │                   │       ├── ConfigServiceImpl.java
│       │   │                   │       ├── ConnectServiceImpl.java
│       │   │                   │       ├── MenuServiceImpl.java
│       │   │                   │       ├── PomServiceImpl.java
│       │   │                   │       └── TelnetServiceImpl.java
│       │   │                   └── util/
│       │   │                       ├── DOMUtil.java
│       │   │                       ├── FileUtil.java
│       │   │                       ├── JsonFileUtil.java
│       │   │                       ├── MD5Util.java
│       │   │                       ├── ParamUtil.java
│       │   │                       └── StringUtil.java
│       │   └── resources/
│       │       ├── application-dev.yml
│       │       ├── application-prd.yml
│       │       ├── application.yml
│       │       ├── logback-spring.xml
│       │       ├── menu.json
│       │       ├── registry.json
│       │       ├── static/
│       │       │   └── v3/
│       │       │       ├── assets/
│       │       │       │   ├── css/
│       │       │       │   │   ├── bootstrap-editable.css
│       │       │       │   │   ├── bootstrap-timepicker.css
│       │       │       │   │   ├── chosen.css
│       │       │       │   │   ├── colorbox.css
│       │       │       │   │   ├── colorpicker.css
│       │       │       │   │   ├── datepicker.css
│       │       │       │   │   ├── daterangepicker.css
│       │       │       │   │   ├── dropzone.css
│       │       │       │   │   ├── fullcalendar.css
│       │       │       │   │   ├── jquery.gritter.css
│       │       │       │   │   ├── multiple-select.css
│       │       │       │   │   ├── select2.css
│       │       │       │   │   └── ui.jqgrid.css
│       │       │       │   ├── font/
│       │       │       │   │   └── fonts.googleapis.com.css
│       │       │       │   └── js/
│       │       │       │       ├── fuelux/
│       │       │       │       │   └── data/
│       │       │       │       │       └── fuelux.tree-sampledata.js
│       │       │       │       ├── html5shiv.js
│       │       │       │       ├── jqGrid/
│       │       │       │       │   ├── i18n/
│       │       │       │       │   │   └── grid.locale-en.js
│       │       │       │       │   └── jquery.jqGrid.src.js
│       │       │       │       ├── jquery.colorbox-min.js
│       │       │       │       ├── jquery.dataTables.bootstrap.js
│       │       │       │       ├── jquery.form.js
│       │       │       │       └── multiple-select.js
│       │       │       └── js/
│       │       │           ├── JGridUtils.js
│       │       │           ├── Nora.js
│       │       │           ├── core.js
│       │       │           ├── echartUtils.js
│       │       │           ├── jquery.jsonEdit.js
│       │       │           └── pom.js
│       │       └── templates/
│       │           ├── index.html
│       │           └── pages/
│       │               ├── tpl/
│       │               │   ├── bread.html
│       │               │   ├── foot.html
│       │               │   ├── head.html
│       │               │   ├── left.html
│       │               │   └── top.html
│       │               └── v3/
│       │                   ├── addJar.html
│       │                   ├── caseCnt.html
│       │                   ├── easyCnt.html
│       │                   ├── editPom.html
│       │                   ├── listJar.html
│       │                   ├── listZk.html
│       │                   ├── normalCnt.html
│       │                   └── sys.html
│       └── test/
│           ├── java/
│           │   └── com/
│           │       └── mmc/
│           │           └── dubbo/
│           │               └── doe/
│           │                   ├── DubboDoeApplicationTests.java
│           │                   └── test/
│           │                       ├── TestCaseService.java
│           │                       ├── TestClassService.java
│           │                       ├── TestConfigService.java
│           │                       ├── TestConnectService.java
│           │                       ├── TestCuratorHandler.java
│           │                       ├── TestDemo.java
│           │                       ├── TestDoeClassLoader.java
│           │                       ├── TestDoeClient.java
│           │                       ├── TestFuture.java
│           │                       ├── TestLogback.java
│           │                       ├── TestNumber.java
│           │                       ├── TestParam.java
│           │                       ├── TestPomService.java
│           │                       ├── TestProcessClient.java
│           │                       ├── TestRedisResolver.java
│           │                       ├── TestRedisTemplate.java
│           │                       ├── TestTelnetService.java
│           │                       └── TestTime.java
│           └── resources/
│               ├── logback-spring.xml
│               └── test-pom.xml
└── mmc-dubbo-provider/
    ├── .gitignore
    ├── pom.xml
    └── src/
        └── main/
            ├── java/
            │   └── com/
            │       └── mmc/
            │           └── dubbo/
            │               └── provider/
            │                   ├── DubboProviderApplication.java
            │                   └── user/
            │                       ├── UserFeedbackServiceImpl.java
            │                       └── UserMemberServiceImpl.java
            └── resources/
                └── application.yml

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitattributes
================================================
*.js linguist-language=Java


================================================
FILE: .gitignore
================================================
##ignore this file##
.idea/
target
target/
*.iml



================================================
FILE: README.md
================================================

# Doe 发布 [V1.3.0]

前段时间排查某问题的时候,想要快速知道某些dubbo接口(三无)的响应结果,但不想启动项目(因为这些项目不是你负责的,不会部署而且超级笨重),也不想新建一个dubbo客户端项目(占地方),也不想开telnet客户端连接口(麻烦而且有限制)。所以扣了dubbo的netty模块源码,封装了个收发客户端集成一个工具,可以快速调试dubbo接口。

![极简模式](https://github.com/VIPJoey/doe/blob/master/deploy/easy.png)
![普通模式](https://github.com/VIPJoey/doe/blob/master/deploy/normal.png)


## 目录结构

-   mmc-dubbo-api 接口项目,主要用于测试。
-   mmc-dubbo-provider dubbo提供者项目,主要用于测试。
-   mmc-dubbo-doe 主项目,实现dubbo接口调试。
-   deploy 部署文档


## 功能特性

-   极简模式:通过dubbo提供的telnet协议收发数据。
-   普通模式:通过封装netty客户端收发数据。
-   用例模式:通过缓存数据,方便下一次操作,依赖普通模式。
-   增加依赖:通过调用maven命令,下载jar包和热加载到系统,主要用来分析接口方法参数,主要作用在普通模式(已过时,请使用【依赖编辑】模块)。
-   依赖列表:通过分析pom文件,展示已经加载的jar包。
-   依赖编辑:可以直接编辑pom文件,新增修改依赖jar。
-   注册中心:可以添加或删除zookeeper注册中心。
-   系统配置:可以清空jar或者重新加载jar。


## 其它特性

-   springboot 整合 redis,支持spring el 表达式。
-   springboot 整合 thymeleaf。
-   springboot 整合 logback。
-   netty rpc 实现原理。
-   热加载和沙箱隔离原理。

## 开发环境

-   jdk 1.8
-   maven 3.5.3
-   dubbo 2.6.1
-   lombok 1.16.20
-   idea 2018
-   windows 7


## 启动方式
* IDEA 启动
    - 安装JDK、并设置环境变量
    - 安装MAVEN,并设置好环境变量,仓库目录
    - 安装REDIS,设置相关配置
    - 安装IDEA,设置IDEA环境
    - 导入项目到IDEA,设置为maven工程,勾选profile环境
    - 根据各自需要,修改application-dev.yml或application-prd.yml配置文件,除了redis配置项,其它建议保持默认配置
    - 在当前IDEA的workspace所在根目录,创建/app/doe目录
        - 例如:application-*.yml为默认配置,且当前IDEA的workspace为F:\idea-workspaces\mmc-workspace\,则在F盘创建F:\app\doe
    - 进入mmc-dubbo-api目录,执行mvn clean install命令,生成api的jar包。
    - 进入mmc-dubbo-doe目录,执行mvn clean install 命令,在target目录生成dubbo-doe.jar
    - 打开mmc-dubbo-doe工程,找到DubboDoeApplication.java类,右键点击运行即可。
    - 默认日志目录:/app/applogs/doe
    - 打开浏览器,访问地址:http://localhost:9876/doe/home/index
* LINUX 启动
    - 安装JDK、并设置环境变量
    - 安装MAVEN,并设置好环境变量,仓库目录
    - 安装REDIS,设置相关配置
    - 安装PYTHON(可选)
    - 执行mkdir -p /app/doe,创建/app/doe目录,注意权限问题
    - 把deploy目录中的所有文件上传到/app/doe
    - 参考IDEA方式,下载DOE源码,并编译生成dubbo-doe.jar,并上传到/app/doe 目录
    - 进入/app/doe 目录,执行chmod +x deploy.sh  
    - 进入/app/doe 目录,执行 ./deploy.sh start 启动项目,支持(start/stop)参数,详细参数用途请阅读deploy.sh源码
    - 默认日志目录:/app/applogs/doe
    - 打开浏览器,访问地址:http://ip:9876/doe/home/index

## 项目介绍
- https://blog.csdn.net/hanyi_?t=1
- https://blog.csdn.net/hanyi_/article/details/113945026

## 发布记录
* [发布记录](https://github.com/VIPJoey/doe/blob/feature/doe_v1.3.0/UPGRADE.md)

## 特别说明
- 由于平时比较忙,仓促写下的代码未免有BUG,请见谅
- 如遇到问题,可以github上留言,或贡献您的代码

## 关于内推

<table>
    <tr>
        <td>关注公众号即可获得大厂内推机会,优质简历可以全程帮忙跟踪进度,欢迎投递。</td>
    </tr>
        <tr>
            <td>
                <img src="https://github.com/VIPJoey/doe/blob/master/deploy/qrcode_for_gh_0c6aeb037ce4_258.jpg"/>
           </td>
    </tr>
</table>



================================================
FILE: UPGRADE.md
================================================

版本发布记录

# Doe 发布 [V1.0.0]
## 版本特性
一、连接发送
* 极简模式
* 普通模式
* 用例模式

二、依赖管理
* 增加依赖
* 依赖列表

> 基础功能基本实现


# Doe 发布 [V1.1.0]

## 版本特性

##### 一、新功能
* 增加注册中心管理模块
* 增加编辑依赖模块
* 增加守护程序,停止、重启、重新发布

##### 二. 优化功能
* provider 修改为starter方式
* 增加接口version和group支持

##### 三. 缺陷修复
* 修复grid序号问题
* 修复spring 版本过低问题
* 优化菜单栏展示方式



# Doe 发布 [V1.2.0]

## 版本特性

##### 一、新功能
* 增加独立加载JAR功能
* 增加清空lib目录功能

##### 二. 优化功能
* 增加mac系统判断(commited by Lutong )
* 增加泛型接口测试
* 修改dubbo依赖为starter方式
* 修改类加载方式,增加沙箱隔离
* 移除python模块

##### 三. 缺陷修复
* 无



# Doe 发布 [V1.3.0]

## 功能特性

##### 一、新功能
* 无

##### 二. 优化功能
* 无

##### 三. 缺陷修复
* 修复【依赖编辑】模块未清空原目录残存jar包问题
* 修复【重新加载】模块未清空缓存classMap问题







================================================
FILE: deploy/SimpleHttpServer.py
================================================
#!/usr/bin/env python2
# --coding:utf-8--

import os
import time
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from os import path
import urlparse

curdir = path.dirname(path.realpath(__file__))
sep = '/'

# MIME-TYPE
mimedic = [
    ('.html', 'text/html'),
    ('.htm', 'text/html'),
    ('.js', 'application/javascript'),
    ('.css', 'text/css'),
    ('.json', 'application/json'),
    ('.png', 'image/png'),
    ('.jpg', 'image/jpeg'),
    ('.gif', 'image/gif'),
    ('.txt', 'text/plain'),
    ('.avi', 'video/x-msvideo'),
]

class SimpleHttpServerHandler(BaseHTTPRequestHandler):

    def log(self, msg):
        timstr = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
        print("[%s] %s" % (timstr, msg))

    # GET
    def do_GET(self):

        querypath = urlparse.urlparse(self.path)
        filepath, query = querypath.path, querypath.query

        filename, fileext = path.splitext(filepath)

        self.log(filename + " --- " + fileext)

        # 支持命令集合
        urlSet = set(("/start", "/stop", "/reload", "/republish"))
        sendReply = filename in urlSet

        if sendReply == True:
            try:

                param = filename[1:]

                self.log("/app/doe/deploy.sh " + param)
		os.system("/app/doe/deploy.sh " + param)

                content = ("{'success': true, 'msg': 'success.'}").encode("utf-8")
                self.send_response(200)
                self.send_header('Content-type', 'application/json')
                self.end_headers()
                self.wfile.write(content)
            except IOError:
                self.log('File Not Found: %s' % self.path)
                self.send_error(404, 'File Not Found: %s' % self.path)
        else:

            try:
                content = ("{'success': false, 'msg': 'no match url.'}").encode("utf-8")
                self.send_response(200)
                self.send_header('Content-type', 'application/json')
                self.end_headers()
                self.wfile.write(content)
            except IOError:
                self.log('File Not Found: %s' % self.path)
                self.send_error(404, 'File Not Found: %s' % self.path)


def run():
    port = 8000
    print('starting server, port', port)

    # Server settings
    server_address = ('', port)
    httpd = HTTPServer(server_address, SimpleHttpServerHandler)
    print('running server...')
    httpd.serve_forever()


if __name__ == '__main__':
    run()



================================================
FILE: deploy/deploy.sh
================================================
#!/bin/bash

source /etc/profile

function log() {
    echo `date '+%Y-%m-%d %H:%M:%S'` "$1"
}

function doStop() {
	log "bein to stop doe."
	
	count=`ps aux|grep "java -jar dubbo-doe" |grep -v grep|wc -l`

	if [ $count -gt 0 ]
	then
		log "bein to shutdown doe."
		pid=`ps aux|grep "java -jar dubbo-doe" |grep -v grep|awk  '{ print $2 }'`
		kill $pid
		sleep 3s
	fi
	
	count=`ps aux|grep "java -jar dubbo-doe" |grep -v grep|wc -l`
	if [ $count -gt 0 ]
	then
		log "bein to force to kill doe."
		pid=`ps aux|grep "java -jar dubbo-doe" |grep -v grep|awk  '{ print $2 }'`
		kill -9 $pid
		sleep 3s
	fi
	log "finish stop doe."
}
function doStart() {
        log "bein to install doe."

        java -jar dubbo-doe.jar --spring.profiles.active=prd &

        log "finish install doe."
}

function main() {

	log "welcome to doe."
	
	option="$1"
	
	if [ "$option" = "start" ] 
	then 
		doStart
	elif [ "$option" = "stop" ]
	then
		doStop
	elif [ "$option" = "reload" ]
	then
	    doStop
	    sleep 3s
	    doStart
	elif [ "$option" = "republish" ]
	then
	    doStop
	    cp pom.xml.backup pom.xml
	    rm -rf ./lib/*
	    sleep 3s
	    doStart
	else 
		log "input option error (start/stop/reload/republish)"
	fi
	
	log "done."

}

main "$1"

================================================
FILE: deploy/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>mmc-dubbo</groupId>
    <artifactId>doe</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>


	</dependencies>
	

    <build>
        <defaultGoal>compile</defaultGoal>
        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                    <executions>
                        <execution>
                            <phase>process-sources</phase>

                            <goals>
                                <goal>copy-dependencies</goal>
                            </goals>

                            <configuration>
                                <outputDirectory>/app/doe/lib</outputDirectory>
                            </configuration>
                        </execution>
                    </executions>
            </plugin>
        </plugins>
    </build>
	
</project>


================================================
FILE: deploy/pom.xml.backup
================================================
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>mmc-dubbo</groupId>
    <artifactId>doe</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>


	</dependencies>
	

    <build>
        <defaultGoal>compile</defaultGoal>
        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                    <executions>
                        <execution>
                            <phase>process-sources</phase>

                            <goals>
                                <goal>copy-dependencies</goal>
                            </goals>

                            <configuration>
                                <outputDirectory>/app/doe/lib</outputDirectory>
                            </configuration>
                        </execution>
                    </executions>
            </plugin>
        </plugins>
    </build>
	
</project>


================================================
FILE: mmc-dubbo-api/.gitignore
================================================
##ignore this file##
.idea/
target
target/
*.iml


================================================
FILE: mmc-dubbo-api/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>mmc-dubbo</groupId>
    <artifactId>api</artifactId>
    <version>1.3-RELEASE</version>

    <name>mmc-dubbo-api</name>

    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target> 
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

================================================
FILE: mmc-dubbo-api/src/main/java/com/mmc/dubbo/api/user/GenericReq.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.api.user;

import java.io.Serializable;

/**
 * @author Joey
 * @date 2019/5/10 16:10
 */
public class GenericReq<T> implements Serializable {


    private static final long serialVersionUID = 3998577120137245599L;
    private String name;
    private T data;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}



================================================
FILE: mmc-dubbo-api/src/main/java/com/mmc/dubbo/api/user/GenericResp.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.api.user;

import java.io.Serializable;

/**
 * @author Joey
 * @date 2019/5/10 16:11
 */
public class GenericResp<T> implements Serializable {

    private static final long serialVersionUID = 6753766666093779059L;
    private T data;
    private String name;

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}


================================================
FILE: mmc-dubbo-api/src/main/java/com/mmc/dubbo/api/user/UserFact.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.api.user;

import java.io.Serializable;

/**
 * @author Joey
 * @date 2018/5/8 20:26
 */
public class UserFact implements Serializable {

    private static final long serialVersionUID = 2798561567572955369L;
    private long id;
    private String name;
    private int sex;
    private int height;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }
}


================================================
FILE: mmc-dubbo-api/src/main/java/com/mmc/dubbo/api/user/UserService.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */

package com.mmc.dubbo.api.user;

/**
 * @author Joey
 * @date 2018/5/8 20:25
 */
public interface UserService {

    /**
     * 测试方法一(单个参数).
     * @param id
     * @return
     */
    UserFact getCurrentById(long id);

    /**
     * 测试方法二(多个参数).
     * @param u
     * @param name
     * @param sex
     * @return
     */
    UserFact insert(UserFact u, String name, int sex);

    /**
     * 泛型测试.
     * @param user
     * @return
     */
    GenericResp<UserFact> echo(GenericReq<UserFact> user);

}



================================================
FILE: mmc-dubbo-doe/.gitignore
================================================
/target/
!.mvn/wrapper/maven-wrapper.jar

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/build/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

================================================
FILE: mmc-dubbo-doe/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.mmc</groupId>
    <artifactId>dubbo-doe</artifactId>
    <version>1.3.0-RELEASE</version>
    <packaging>jar</packaging>

    <name>mmc-dubbo-doe</name>
    <description>Demo project for Spring Boot</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.2.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <!-- springboot 整合 dubbo -->
        <version.starter.dubbo>0.2.0</version.starter.dubbo>
    </properties>

    <dependencies>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>

        <!-- Spring Boot Redis 依赖 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.alibaba.boot</groupId>
            <artifactId>dubbo-spring-boot-starter</artifactId>
            <version>${version.starter.dubbo}</version>
        </dependency>

        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.46</version>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>

        <!-- https://mvnrepository.com/artifact/ru.dmerkushov/xml-helper -->
        <dependency>
            <groupId>ru.dmerkushov</groupId>
            <artifactId>xml-helper</artifactId>
            <version>1.5.0</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-pool2 -->
        <!-- 要用redis连接池 必须有pool依赖-->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-pool2</artifactId>
            <version>2.5.0</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-text -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-text</artifactId>
            <version>1.3</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/commons-net/commons-net -->
        <dependency>
            <groupId>commons-net</groupId>
            <artifactId>commons-net</artifactId>
            <version>3.6</version>
        </dependency>


        <!-- 测试使用 -->
        <dependency>
            <groupId>mmc-dubbo</groupId>
            <artifactId>api</artifactId>
            <version>1.0-RELEASE</version>
        </dependency>

    </dependencies>

    <build>
        <finalName>dubbo-doe</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>dev</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <spring.profiles.active>dev</spring.profiles.active>
            </properties>
        </profile>
        <profile>
            <id>prd</id>
            <properties>
                <spring.profiles.active>prd</spring.profiles.active>
            </properties>
        </profile>
    </profiles>


</project>


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/DubboDoeApplication.java
================================================
package com.mmc.dubbo.doe;

import com.mmc.dubbo.doe.context.ApplicationReadyEventListener;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class DubboDoeApplication {

    public static void main(String[] args) {

        SpringApplication springApplication = new SpringApplication(DubboDoeApplication.class);
        springApplication.addListeners(new ApplicationReadyEventListener()); // load jars when startup
        springApplication.run(args);
    }
}



================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/auth/MenuNode.java
================================================
/*  
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.  
 *  
 * This software is the confidential and proprietary information of  
 * Founder. You shall not disclose such Confidential Information  
 * and shall use it only in accordance with the terms of the agreements  
 * you entered into with Founder.  
 *  
 */ 
/**
 * 
 */
package com.mmc.dubbo.doe.auth;

import java.util.ArrayList;
import java.util.List;

/**
 * 菜单节点.
 * @author Joey
 * 2016年6月24日 下午4:50:47
 */
public class MenuNode extends MenuTree{
    
    /**
     * 
     */
    private static final long serialVersionUID = 1456456456L;
    
    private List<MenuNode> children = new ArrayList<MenuNode>();

    public List<MenuNode> getChildren() {
        return children;
    }

    public void setChildren(List<MenuNode> children) {
        this.children = children;
    }
    
    

}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/auth/MenuTree.java
================================================
/*  
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.  
 *  
 * This software is the confidential and proprietary information of  
 * Founder. You shall not disclose such Confidential Information  
 * and shall use it only in accordance with the terms of the agreements  
 * you entered into with Founder.  
 *  
 */ 
/**
 * 
 */
package com.mmc.dubbo.doe.auth;

import java.io.Serializable;

/**
 * 菜单树实体类.
 * @author Joey
 * 2016年5月26日 下午1:20:34
 */
public class MenuTree implements Serializable{
    
    /**
     * 
     */
    private static final long serialVersionUID = 1485485452L;
    
    private Integer uId;
    private Integer roleId;
    private Integer menuId;
    private Integer pmenuId;
    private String menuName;
    private String menuUrl;
    private String menuStyle;
    private Integer mlevel;
    private Integer mleft;
    private Integer mright;
    
    public Integer getuId() {
        return uId;
    }
    public void setuId(Integer uId) {
        this.uId = uId;
    }
    public Integer getMenuId() {
        return menuId;
    }
    public void setMenuId(Integer menuId) {
        this.menuId = menuId;
    }
    public Integer getPmenuId() {
        return pmenuId;
    }
    public void setPmenuId(Integer pmenuId) {
        this.pmenuId = pmenuId;
    }
    public String getMenuName() {
        return menuName;
    }
    public void setMenuName(String menuName) {
        this.menuName = menuName;
    }
    public String getMenuUrl() {
        return menuUrl;
    }
    public void setMenuUrl(String menuUrl) {
        this.menuUrl = menuUrl;
    }
    public String getMenuStyle() {
        return menuStyle;
    }
    public void setMenuStyle(String menuStyle) {
        this.menuStyle = menuStyle;
    }
    public Integer getMlevel() {
        return mlevel;
    }
    public void setMlevel(Integer mlevel) {
        this.mlevel = mlevel;
    }
    public Integer getMleft() {
        return mleft;
    }
    public void setMleft(Integer mleft) {
        this.mleft = mleft;
    }
    public Integer getMright() {
        return mright;
    }
    public void setMright(Integer mright) {
        this.mright = mright;
    }
    public Integer getRoleId() {
        return roleId;
    }
    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }
    
    
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/cache/CuratorCaches.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.cache;

import com.mmc.dubbo.doe.exception.DoeException;
import com.mmc.dubbo.doe.handler.CuratorHandler;
import com.mmc.dubbo.doe.model.PointModel;
import com.mmc.dubbo.doe.util.ParamUtil;
import com.mmc.dubbo.doe.util.StringUtil;

import javax.validation.constraints.NotNull;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * cache all zk connection.
 *
 * @author Joey
 * @date 2018/6/18 20:12
 */
public class CuratorCaches {

    private final static Map<String, CuratorHandler> map = new ConcurrentHashMap<>();

    public static CuratorHandler getHandler(@NotNull String conn) throws NoSuchFieldException, IllegalAccessException {

        CuratorHandler client = map.get(conn);

        if (null == client) {


            try {
                // split host and port
                PointModel model = ParamUtil.parsePointModel(conn);

                client = new CuratorHandler("zookeeper", model.getIp(), model.getPort());
                // connect to zk
                client.doConnect();
                // async connecting, so we should wait a few second.
                Thread.sleep(1000);
                if (client.isAvailable()) {
                    // cache client for reuse
                    map.putIfAbsent(conn, client);
                } else {
                    client.close();
                }

            } catch(Exception e) {
                throw new DoeException(StringUtil.format("can't connect to {}, {}", conn, e.getMessage()));
            }
        }

        return client;
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/cache/DoeRedisResolver.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.cache;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;

/**
 * @author Joey
 * @date 2018/6/17 18:00
 */
@Service("redisResolver")
@Slf4j
public class DoeRedisResolver implements RedisResolver {

    @Autowired
    private RedisTemplate<String, Object> redisTemplate;

    public RedisTemplate<String, Object> getRedisTemplate() {
        return redisTemplate;
    }

    //=============================common============================

    @Override
    public boolean expire(String key, long time) {
        try {
            if (time > 0) {
                redisTemplate.expire(key, time, TimeUnit.SECONDS);
            }
            return true;
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return false;
        }
    }

    @Override
    public long getExpire(String key) {
        return redisTemplate.getExpire(key, TimeUnit.SECONDS);
    }

    @Override
    public boolean hasKey(String key) {
        try {
            return redisTemplate.hasKey(key);
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return false;
        }
    }

    @Override
    @SuppressWarnings("unchecked")
    public void del(String... key) {
        if (key != null && key.length > 0) {
            if (key.length == 1) {
                redisTemplate.delete(key[0]);
            } else {
                redisTemplate.delete(CollectionUtils.arrayToList(key));
            }
        }
    }

    //============================String=============================

    @Override
    public Object get(String key) {
        return key == null ? null : redisTemplate.opsForValue().get(key);
    }

    @Override
    public boolean set(String key, Object value) {
        try {
            redisTemplate.opsForValue().set(key, value);
            return true;
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return false;
        }

    }

    @Override
    public boolean set(String key, Object value, long time) {
        return set(key, value, time, TimeUnit.SECONDS);
    }

    @Override
    public boolean set(String key, Object value, long time, TimeUnit unit) {
        try {
            if (time > 0) {
                redisTemplate.opsForValue().set(key, value, time, unit);
            } else {
                set(key, value);
            }
            return true;
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return false;
        }
    }

    @Override
    public long incr(String key, long delta) {
        if (delta < 0) {
            throw new RuntimeException("递增因子必须大于0");
        }
        return redisTemplate.opsForValue().increment(key, delta);
    }

    @Override
    public long decr(String key, long delta) {
        if (delta < 0) {
            throw new RuntimeException("递减因子必须大于0");
        }
        return redisTemplate.opsForValue().increment(key, -delta);
    }

    //================================Map=================================

    @Override
    public Object hget(String key, String item) {
        return redisTemplate.opsForHash().get(key, item);
    }

    @Override
    public Map<Object, Object> hmget(String key) {
        return redisTemplate.opsForHash().entries(key);
    }

    @Override
    public boolean hmset(String key, Map<String, Object> map) {
        try {
            redisTemplate.opsForHash().putAll(key, map);
            return true;
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return false;
        }
    }

    @Override
    public boolean hmset(String key, Map<String, Object> map, long time) {
        try {
            redisTemplate.opsForHash().putAll(key, map);
            if (time > 0) {
                expire(key, time);
            }
            return true;
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return false;
        }
    }

    @Override
    public boolean hset(String key, String item, Object value) {
        try {
            redisTemplate.opsForHash().put(key, item, value);
            return true;
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return false;
        }
    }

    @Override
    public boolean hset(String key, String item, Object value, long time) {
        try {
            redisTemplate.opsForHash().put(key, item, value);
            if (time > 0) {
                expire(key, time);
            }
            return true;
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return false;
        }
    }

    @Override
    public void hdel(String key, Object... item) {
        redisTemplate.opsForHash().delete(key, item);
    }

    @Override
    public boolean hHasKey(String key, String item) {
        return redisTemplate.opsForHash().hasKey(key, item);
    }

    @Override
    public double hincr(String key, String item, double by) {
        return redisTemplate.opsForHash().increment(key, item, by);
    }

    @Override
    public double hdecr(String key, String item, double by) {
        return redisTemplate.opsForHash().increment(key, item, -by);
    }

    //============================set=============================

    @Override
    public Set<Object> sMembers(String key) {
        try {
            return redisTemplate.opsForSet().members(key);
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return null;
        }
    }

    @Override
    public boolean sHasKey(String key, Object value) {
        try {
            return redisTemplate.opsForSet().isMember(key, value);
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return false;
        }
    }

    @Override
    public long sAdd(String key, Object... values) {
        try {
            return redisTemplate.opsForSet().add(key, values);
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return 0;
        }
    }

    @Override
    public long sSetAndTime(String key, long time, Object... values) {
        try {
            Long count = redisTemplate.opsForSet().add(key, values);
            if (time > 0) expire(key, time);
            return count;
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return 0;
        }
    }

    @Override
    public long sGetSetSize(String key) {
        try {
            return redisTemplate.opsForSet().size(key);
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return 0;
        }
    }

    @Override
    public long sRem(String key, Object... values) {
        try {
            Long count = redisTemplate.opsForSet().remove(key, values);
            return count;
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return 0;
        }
    }
    //===============================list=================================

    @Override
    public List<Object> lGet(String key, long start, long end) {
        try {
            return redisTemplate.opsForList().range(key, start, end);
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return null;
        }
    }

    @Override
    public long lGetListSize(String key) {
        try {
            return redisTemplate.opsForList().size(key);
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return 0;
        }
    }

    @Override
    public Object lGetIndex(String key, long index) {
        try {
            return redisTemplate.opsForList().index(key, index);
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return null;
        }
    }

    @Override
    public boolean lSet(String key, Object value) {
        try {
            redisTemplate.opsForList().rightPush(key, value);
            return true;
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return false;
        }
    }

    @Override
    public boolean lSet(String key, Object value, long time) {
        try {
            redisTemplate.opsForList().rightPush(key, value);
            if (time > 0) expire(key, time);
            return true;
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return false;
        }
    }

    @Override
    public boolean lSet(String key, List<Object> value) {
        try {
            redisTemplate.opsForList().rightPushAll(key, value);
            return true;
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return false;
        }
    }

    @Override
    public boolean lSet(String key, List<Object> value, long time) {
        try {
            redisTemplate.opsForList().rightPushAll(key, value);
            if (time > 0) expire(key, time);
            return true;
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return false;
        }
    }

    @Override
    public boolean lUpdateIndex(String key, long index, Object value) {
        try {
            redisTemplate.opsForList().set(key, index, value);
            return true;
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return false;
        }
    }

    @Override
    public long lRemove(String key, long count, Object value) {
        try {
            Long remove = redisTemplate.opsForList().remove(key, count, value);
            return remove;
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return 0;
        }
    }

    @Override
    public boolean rPush(String key, Object value) {
        try {
            return redisTemplate.opsForList().rightPush(key, value) > 0;
        } catch(Exception e) {
            log.error(e.getMessage(), e);
            return false;
        }
    }

    @Override
    public Object lPop(String key) {
        try {
            return redisTemplate.opsForList().leftPop(key);
        } catch(Exception e) {
            log.error(e.getMessage(), e);
            return null;
        }
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/cache/MethodCaches.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.cache;

import com.mmc.dubbo.doe.model.MethodModel;
import com.mmc.dubbo.doe.dto.MethodModelDTO;
import com.mmc.dubbo.doe.util.MD5Util;
import com.mmc.dubbo.doe.util.StringUtil;

import javax.validation.constraints.NotNull;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;

/**
 * @author Joey
 * @date 2018/6/15 14:55
 */
public class MethodCaches {

    private final static Map<String, MethodModel> map = new ConcurrentHashMap<>();

    /**
     * cache the method object so we can get them next time quickly.
     *
     * @param interfaceName
     * @param methods
     * @return
     */
    public static List<MethodModelDTO> cache(final String interfaceName, Method[] methods) {

        List<MethodModelDTO> ret = new ArrayList<>();

        Arrays.stream(methods).forEach(m -> {

            String key = generateMethodKey(m, interfaceName);

            MethodModel model = new MethodModel(key, m);

            ret.add(new MethodModelDTO(model));

            map.putIfAbsent(key, model); // add to cache

        });


        return ret;
    }

    private static String generateMethodKey(Method method, String interfaceName) {
        return StringUtil.format("{}#{}", interfaceName, MD5Util.encrypt(method.toGenericString()));
    }

    public static MethodModel get(@NotNull String key) {
        return map.get(key);
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/cache/RedisConfiguration.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.cache;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.mmc.dubbo.doe.context.Const;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.*;
import org.springframework.cache.interceptor.KeyGenerator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.cache.RedisCacheWriter;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.RedisSerializationContext;
import org.springframework.data.redis.serializer.StringRedisSerializer;

import java.lang.reflect.Method;
import java.time.Duration;
import java.util.HashMap;
import java.util.Map;

/**
 * redis cache configuration.
 *
 * @author Joey
 * @date 2018/6/17 11:20
 */
@Configuration
@EnableAutoConfiguration
@EnableCaching
public class RedisConfiguration extends CachingConfigurerSupport {

    @Bean
    public RedisTemplate<?, ?> getRedisTemplate(RedisConnectionFactory connectionFactory) {
        RedisTemplate<?, ?> template = new StringRedisTemplate(connectionFactory);
        template.setKeySerializer(new StringRedisSerializer());
        Jackson2JsonRedisSerializer<?> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<>(Object.class);
        ObjectMapper om = new ObjectMapper();
        om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
        om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
        jackson2JsonRedisSerializer.setObjectMapper(om);
        template.setValueSerializer(jackson2JsonRedisSerializer);
        template.setHashValueSerializer(jackson2JsonRedisSerializer);
        return template;
    }

    // 缓存管理器
    @Bean
    public CacheManager cacheManager(RedisConnectionFactory connectionFactory) {

        // 生成一个默认配置,通过config对象即可对缓存进行自定义配置
        RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig()
                .entryTtl(Duration.ofMinutes(1)) // 设置缓存的默认过期时间,也是使用Duration设置
                .serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer()))
                .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(createJacksonRedisSerializer()))
                .disableCachingNullValues(); // 不缓存空值

        // 对每个缓存空间应用不同的配置
        Map<String, RedisCacheConfiguration> redisCacheConfigurationMap = new HashMap<>();
        redisCacheConfigurationMap.put(Const.DOE_CACHE_PREFIX, config);

        // 初始化一个RedisCacheWriter
        RedisCacheWriter redisCacheWriter = RedisCacheWriter.nonLockingRedisCacheWriter(connectionFactory);

        // 初始化RedisCacheManager
        RedisCacheManager cacheManager = new RedisCacheManager(redisCacheWriter, config, redisCacheConfigurationMap);
        return cacheManager;

//        RedisCacheManager cacheManager = RedisCacheManager.builder(redisConnectionFactory)     // 使用自定义的缓存配置初始化一个cacheManager
//                .initialCacheNames(cacheNames)  // 注意这两句的调用顺序,一定要先调用该方法设置初始化的缓存名,再初始化相关的配置
//                .withInitialCacheConfigurations(configMap)
//                .build();

    }

    private Jackson2JsonRedisSerializer createJacksonRedisSerializer() {
        Jackson2JsonRedisSerializer<?> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<>(Object.class);
        ObjectMapper om = new ObjectMapper();
        om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
        om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
        jackson2JsonRedisSerializer.setObjectMapper(om);
        return jackson2JsonRedisSerializer;
    }

    @Bean
    public KeyGenerator keyGenerator() {
        return new KeyGenerator() {
            @Override
            public Object generate(Object target, Method method, Object... params) {
                StringBuilder sb = new StringBuilder();
                String[] value = new String[1];
                Cacheable cacheable = method.getAnnotation(Cacheable.class);
                if (cacheable != null) {
                    value = cacheable.value();
                }
                CachePut cachePut = method.getAnnotation(CachePut.class);
                if (cachePut != null) {
                    value = cachePut.value();
                }
                CacheEvict cacheEvict = method.getAnnotation(CacheEvict.class);
                if (cacheEvict != null) {
                    value = cacheEvict.value();
                }
                sb.append(value[0]);
                for (Object obj : params) {
                    sb.append(":")
                            .append(obj.toString());
                }
                return sb.toString();
            }
        };
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/cache/RedisResolver.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */

package com.mmc.dubbo.doe.cache;

import org.springframework.data.redis.core.RedisTemplate;

import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;

/**
 * @author Joey
 * @date 2018/6/17 18:13
 */
public interface RedisResolver {

    /**
     * 获取模板.
     *
     * @return
     */
    RedisTemplate<String, Object> getRedisTemplate();

    /**
     * 指定缓存失效时间
     *
     * @param key  键
     * @param time 时间(秒)
     * @return
     */
    boolean expire(String key, long time);

    /**
     * 根据key 获取过期时间
     *
     * @param key 键 不能为null
     * @return 时间(秒) 返回0代表为永久有效
     */
    long getExpire(String key);

    /**
     * 判断key是否存在
     *
     * @param key 键
     * @return true 存在 false不存在
     */
    boolean hasKey(String key);

    /**
     * 删除缓存
     *
     * @param key 可以传一个值 或多个
     */
    @SuppressWarnings("unchecked")
    void del(String... key);

    /**
     * 普通缓存获取
     *
     * @param key 键
     * @return 值
     */
    Object get(String key);

    /**
     * 普通缓存放入
     *
     * @param key   键
     * @param value 值
     * @return true成功 false失败
     */
    boolean set(String key, Object value);

    /**
     * 普通缓存放入并设置时间.
     *
     * @param key   键
     * @param value 值
     * @param time  时间(秒) time要大于0 如果time小于等于0 将设置无限期
     * @return true成功 false 失败
     */
    boolean set(String key, Object value, long time);

    /**
     *  普通缓存放入并设置时间.
     * @param key
     * @param value
     * @param time
     * @param unit
     * @return
     */
    boolean set(String key, Object value, long time, TimeUnit unit);

    /**
     * 递增
     * @param key 键
     * @param delta 要增加几(大于0)
     * @return
     */
    long incr(String key, long delta);

    /**
     * 递减
     * @param key 键
     * @param delta 要减少几(大于0)
     * @return
     */
    long decr(String key, long delta);

    /**
     * HashGet
     *
     * @param key  键 不能为null
     * @param item 项 不能为null
     * @return 值
     */
    Object hget(String key, String item);

    /**
     * 获取hashKey对应的所有键值
     *
     * @param key 键
     * @return 对应的多个键值
     */
    Map<Object, Object> hmget(String key);

    /**
     * HashSet
     *
     * @param key 键
     * @param map 对应多个键值
     * @return true 成功 false 失败
     */
    boolean hmset(String key, Map<String, Object> map);

    /**
     * HashSet 并设置时间
     *
     * @param key  键
     * @param map  对应多个键值
     * @param time 时间(秒)
     * @return true成功 false失败
     */
    boolean hmset(String key, Map<String, Object> map, long time);

    /**
     * 向一张hash表中放入数据,如果不存在将创建
     *
     * @param key   键
     * @param item  项
     * @param value 值
     * @return true 成功 false失败
     */
    boolean hset(String key, String item, Object value);

    /**
     * 向一张hash表中放入数据,如果不存在将创建
     *
     * @param key   键
     * @param item  项
     * @param value 值
     * @param time  时间(秒)  注意:如果已存在的hash表有时间,这里将会替换原有的时间
     * @return true 成功 false失败
     */
    boolean hset(String key, String item, Object value, long time);

    /**
     * 删除hash表中的值
     *
     * @param key  键 不能为null
     * @param item 项 可以使多个 不能为null
     */
    void hdel(String key, Object... item);

    /**
     * 判断hash表中是否有该项的值
     *
     * @param key  键 不能为null
     * @param item 项 不能为null
     * @return true 存在 false不存在
     */
    boolean hHasKey(String key, String item);

    /**
     * hash递增 如果不存在,就会创建一个 并把新增后的值返回
     *
     * @param key  键
     * @param item 项
     * @param by   要增加几(大于0)
     * @return
     */
    double hincr(String key, String item, double by);

    /**
     * hash递减
     *
     * @param key  键
     * @param item 项
     * @param by   要减少记(小于0)
     * @return
     */
    double hdecr(String key, String item, double by);

    /**
     * 根据key获取Set中的所有值
     *
     * @param key 键
     * @return
     */
    Set<Object> sMembers(String key);

    /**
     * 根据value从一个set中查询,是否存在
     *
     * @param key   键
     * @param value 值
     * @return true 存在 false不存在
     */
    boolean sHasKey(String key, Object value);

    /**
     * 将数据放入set缓存
     *
     * @param key    键
     * @param values 值 可以是多个
     * @return 成功个数
     */
    long sAdd(String key, Object... values);

    /**
     * 将set数据放入缓存
     *
     * @param key    键
     * @param time   时间(秒)
     * @param values 值 可以是多个
     * @return 成功个数
     */
    long sSetAndTime(String key, long time, Object... values);

    /**
     * 获取set缓存的长度
     *
     * @param key 键
     * @return
     */
    long sGetSetSize(String key);

    /**
     * 移除值为value的
     *
     * @param key    键
     * @param values 值 可以是多个
     * @return 移除的个数
     */
    long sRem(String key, Object... values);

    /**
     * 获取list缓存的内容
     *
     * @param key   键
     * @param start 开始
     * @param end   结束  0 到 -1代表所有值
     * @return
     */
    List<Object> lGet(String key, long start, long end);

    /**
     * 获取list缓存的长度
     *
     * @param key 键
     * @return
     */
    long lGetListSize(String key);

    /**
     * 通过索引 获取list中的值
     *
     * @param key   键
     * @param index 索引  index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推
     * @return
     */
    Object lGetIndex(String key, long index);

    /**
     * 将list放入缓存.
     * @param key
     * @param value
     * @return
     */
    boolean lSet(String key, Object value);

    /**
     * 将list放入缓存
     *
     * @param key   键
     * @param value 值
     * @param time  时间(秒)
     * @return
     */
    boolean lSet(String key, Object value, long time);

    /**
     * 将list放入缓存.
     * @param key
     * @param value
     * @return
     */
    boolean lSet(String key, List<Object> value);

    /**
     * 将list放入缓存
     *
     * @param key   键
     * @param value 值
     * @param time  时间(秒)
     * @return
     */
    boolean lSet(String key, List<Object> value, long time);

    /**
     * 根据索引修改list中的某条数据
     *
     * @param key   键
     * @param index 索引
     * @param value 值
     * @return
     */
    boolean lUpdateIndex(String key, long index, Object value);

    /**
     * 移除N个值为value
     *
     * @param key   键
     * @param count 移除多少个
     * @param value 值
     * @return 移除的个数
     */
    long lRemove(String key, long count, Object value);

    /**
     * 从右边加入队列.
     * @param key
     * @param value
     * @return
     */
    boolean rPush(String key, Object value);

    /**
     * 从左边出队.
     * @param key
     * @return
     */
    Object lPop(String key);
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/cache/UrlCaches.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.cache;

import com.alibaba.dubbo.common.URL;
import com.mmc.dubbo.doe.model.UrlModel;
import com.mmc.dubbo.doe.util.StringUtil;

import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;

/**
 * @author Joey
 * @date 2018/6/15 17:59
 */
public class UrlCaches {

    private final static Map<String, UrlModel> map = new ConcurrentHashMap<>();

    /**
     * cache all providers by unique key.
     *
     * @param interfaceName
     * @param urls
     * @return
     */
    public static List<UrlModel> cache(String interfaceName, List<URL> urls) {

        List<UrlModel> ret = new ArrayList<>();

        for (int i = 0; i < urls.size(); i++) {

            URL url = urls.get(i);
            String key = generateUrlKey(interfaceName, url.getHost(), url.getPort());
            UrlModel model = new UrlModel(key, url);
            ret.add(model);

            map.put(model.getKey(), model); // 存入缓存
        }

        return ret;
    }

    private static String generateUrlKey(String interfaceName, String host, int port) {
        return StringUtil.format("{}#{}#{}#", interfaceName, host, port);
    }

    public static UrlModel get(@NotNull String key) {
        return map.get(key);
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/channel/NettyChannel.java
================================================
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.mmc.dubbo.doe.channel;

import com.alibaba.dubbo.common.Constants;
import com.alibaba.dubbo.common.URL;
import com.alibaba.dubbo.common.logger.Logger;
import com.alibaba.dubbo.common.logger.LoggerFactory;
import com.alibaba.dubbo.remoting.ChannelHandler;
import com.alibaba.dubbo.remoting.RemotingException;
import com.alibaba.dubbo.remoting.transport.AbstractChannel;
import org.jboss.netty.channel.ChannelFuture;

import java.net.InetSocketAddress;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

/**
 * NettyChannel.
 */
public class NettyChannel extends AbstractChannel {

    private static final Logger logger = LoggerFactory.getLogger(NettyChannel.class);

    private static final ConcurrentMap<org.jboss.netty.channel.Channel, NettyChannel> channelMap = new ConcurrentHashMap<org.jboss.netty.channel.Channel, NettyChannel>();

    private final org.jboss.netty.channel.Channel channel;

    private final Map<String, Object> attributes = new ConcurrentHashMap<String, Object>();

    private NettyChannel(org.jboss.netty.channel.Channel channel, URL url, ChannelHandler handler) {
        super(url, handler);
        if (channel == null) {
            throw new IllegalArgumentException("netty channel == null;");
        }
        this.channel = channel;
    }

    public static NettyChannel getOrAddChannel(org.jboss.netty.channel.Channel ch, URL url, ChannelHandler handler) {
        if (ch == null) {
            return null;
        }
        NettyChannel ret = channelMap.get(ch);
        if (ret == null) {
            NettyChannel nc = new NettyChannel(ch, url, handler);
            if (ch.isConnected()) {
                ret = channelMap.putIfAbsent(ch, nc);
            }
            if (ret == null) {
                ret = nc;
            }
        }
        return ret;
    }

    public static void removeChannelIfDisconnected(org.jboss.netty.channel.Channel ch) {
        if (ch != null && !ch.isConnected()) {
            channelMap.remove(ch);
        }
    }

    public InetSocketAddress getLocalAddress() {
        return (InetSocketAddress) channel.getLocalAddress();
    }

    public InetSocketAddress getRemoteAddress() {
        return (InetSocketAddress) channel.getRemoteAddress();
    }

    public boolean isConnected() {
        return channel.isConnected();
    }

    public void send(Object message, boolean sent) throws RemotingException {
        super.send(message, sent);

        boolean success = true;
        int timeout = 0;
        try {
            ChannelFuture future = channel.write(message);
            if (sent) {
                timeout = getUrl().getPositiveParameter(Constants.TIMEOUT_KEY, Constants.DEFAULT_TIMEOUT);
                success = future.await(timeout);
            }
            Throwable cause = future.getCause();
            if (cause != null) {
                throw cause;
            }
        } catch (Throwable e) {
            throw new RemotingException(this, "Failed to send message " + message + " to " + getRemoteAddress() + ", cause: " + e.getMessage(), e);
        }

        if (!success) {
            throw new RemotingException(this, "Failed to send message " + message + " to " + getRemoteAddress()
                    + "in timeout(" + timeout + "ms) limit");
        }
    }

    public void close() {
        try {
            super.close();
        } catch (Exception e) {
            logger.warn(e.getMessage(), e);
        }
        try {
            removeChannelIfDisconnected(channel);
        } catch (Exception e) {
            logger.warn(e.getMessage(), e);
        }
        try {
            attributes.clear();
        } catch (Exception e) {
            logger.warn(e.getMessage(), e);
        }
        try {
            if (logger.isInfoEnabled()) {
                logger.info("Close netty channel " + channel);
            }
            channel.close();
        } catch (Exception e) {
            logger.warn(e.getMessage(), e);
        }
    }

    public boolean hasAttribute(String key) {
        return attributes.containsKey(key);
    }

    public Object getAttribute(String key) {
        return attributes.get(key);
    }

    public void setAttribute(String key, Object value) {
        if (value == null) { // The null value unallowed in the ConcurrentHashMap.
            attributes.remove(key);
        } else {
            attributes.put(key, value);
        }
    }

    public void removeAttribute(String key) {
        attributes.remove(key);
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((channel == null) ? 0 : channel.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;
        if (getClass() != obj.getClass()) return false;
        NettyChannel other = (NettyChannel) obj;
        if (channel == null) {
            if (other.channel != null) return false;
        } else if (!channel.equals(other.channel)) return false;
        return true;
    }

    @Override
    public String toString() {
        return "com.mmc.dubbo.test.NettyChannel [channel=" + channel + "]";
    }

}

================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/client/DoeClient.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.client;

import com.alibaba.dubbo.common.URL;
import com.alibaba.dubbo.remoting.RemotingException;
import com.alibaba.dubbo.remoting.exchange.Request;
import com.mmc.dubbo.doe.channel.NettyChannel;
import com.mmc.dubbo.doe.handler.SendReceiveHandler;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelFuture;

import java.util.concurrent.TimeUnit;


/**
 * @author Joey
 * @date 2018/6/7 10:42
 */
public class DoeClient extends TransportClient {


    public DoeClient(URL url) {
        super(url, new SendReceiveHandler());
    }

    public void doConnect() {
        ChannelFuture future = bootstrap.connect(getConnectAddress());
        boolean ret = future.awaitUninterruptibly(timeout, TimeUnit.MILLISECONDS);
        if (ret && future.isSuccess()) {
            Channel newChannel = future.getChannel();
            newChannel.setInterestOps(Channel.OP_READ_WRITE);
            DoeClient.this.channel = future.getChannel();
        } else {
            throw new RuntimeException("can't not connect to server.");
        }
    }

    public void send(Request req) throws RemotingException {

        NettyChannel ch = NettyChannel.getOrAddChannel(this.channel, url, handler);

        ch.send(req);

    }


}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/client/ProcessClient.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.client;

import com.mmc.dubbo.doe.cache.RedisResolver;
import com.mmc.dubbo.doe.context.Const;
import com.mmc.dubbo.doe.context.TaskContainer;
import com.mmc.dubbo.doe.dto.PomDTO;
import com.mmc.dubbo.doe.handler.StreamHandler;
import com.mmc.dubbo.doe.util.StringUtil;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
import java.util.Properties;
import java.util.concurrent.TimeUnit;

/**
 * @author Joey
 * @date 2018/6/17 23:43
 */
@Slf4j
public class ProcessClient extends Thread {

    private final String libPath;
    private final RedisResolver redisResolver;
    private final PomDTO dto;
    private final String pomXml;
    private long timeout = 20;
    private volatile boolean done;

    public ProcessClient(PomDTO dto, RedisResolver redisResolver, String pomXml, String libPath) {
        this.dto = dto;
        this.redisResolver = redisResolver;
        this.pomXml = pomXml;
        this.libPath = libPath;
    }

    @Override
    public void run() {

        log.info("begin to download the jars.");

        // set running flag
        this.putFlag();

        // make the command depends on the OS.
        String command = makeCommand(pomXml);

        log.info("begin to exec the command {}", command);
        Process ps = null;
        try {
            ps = Runtime.getRuntime().exec(command);
        } catch (IOException e) {
            log.error(StringUtil.format("can't execute the command {}", command), e);
            return;
        }

        // 再开线程执行
        TaskContainer.getTaskContainer().execute(new StreamHandler(ps, redisResolver, dto.getRequestId(), libPath));

        // no longer than default 20 minutes.
        try {
            ps.waitFor(timeout, TimeUnit.MINUTES);
        } catch (InterruptedException e) {
            log.error("waiting too long...", e);
        }

        // remove the key
        this.removeFlag();

        // set complete normally flag
        this.done = true;

    }

    private void putFlag() {
        // set the key mark as the running flag and the longest lifetime of task was one hour.
        log.info("set the key to mark as the running flag and the longest lifetime of task was one hour");
        redisResolver.set(Const.DOE_DOWNLOAD_JAR_TASK, Const.RUNNING_FlAG, 1, TimeUnit.HOURS);
    }

    /**
     * remove the running flag.
     */
    private void removeFlag() {
        log.info("remove the running flag.");
        redisResolver.del(Const.DOE_DOWNLOAD_JAR_TASK);
    }
    /**
     * get the cmd code.
     *
     * @param pomXml
     * @return
     */
    private String makeCommand(String pomXml) {

        if (isOSLinux()) {
            return StringUtil.format("/bin/bash -c  mvn dependency:copy-dependencies -DoutputDirectory={} -DincludeScope=compile -f {}", libPath, pomXml);
        } else if (isOSMac()){
            return StringUtil.format("mvn dependency:copy-dependencies -DoutputDirectory={} -DincludeScope=compile -f {}", libPath, pomXml);
        }else {
            return StringUtil.format("cmd /c  mvn dependency:copy-dependencies -DoutputDirectory=lib -DincludeScope=compile -f {}", pomXml);
        }
    }

    /**
     * judge if linux os.
     *
     * @return
     */
    public static boolean isOSLinux() {
        Properties prop = System.getProperties();

        String os = prop.getProperty("os.name");
        if (os != null && os.toLowerCase().contains("linux")) {
            return true;
        } else {
            return false;
        }
    }

    /**
     * judge if mac os.
     *
     * @return
     */
    public static boolean isOSMac() {
        Properties prop = System.getProperties();

        String os = prop.getProperty("os.name");
        if (os != null && os.toLowerCase().contains("mac")) {
            return true;
        } else {
            return false;
        }
    }


    public boolean isDone() {
        return done;
    }

    public boolean isRunning() {

        if (redisResolver.hasKey(Const.DOE_DOWNLOAD_JAR_TASK)) {
            log.warn("some task was already running at background, please try again for a few minutes later.");
            return true;
        }
        return false;
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/client/TransportClient.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.client;

import com.alibaba.dubbo.common.Constants;
import com.alibaba.dubbo.common.URL;
import com.alibaba.dubbo.common.extension.ExtensionLoader;
import com.alibaba.dubbo.common.utils.NamedThreadFactory;
import com.alibaba.dubbo.common.utils.NetUtils;
import com.alibaba.dubbo.remoting.Codec2;
import com.alibaba.dubbo.remoting.buffer.DynamicChannelBuffer;
import com.alibaba.dubbo.remoting.transport.netty.NettyHandler;
import com.mmc.dubbo.doe.channel.NettyChannel;
import org.jboss.netty.bootstrap.ClientBootstrap;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.channel.*;
import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory;
import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.concurrent.Executors;

/**
 * @author Joey
 * @date 2018/6/15 11:26
 */
public class TransportClient {


    protected static final ChannelFactory channelFactory = new NioClientSocketChannelFactory(
            Executors.newCachedThreadPool(new NamedThreadFactory("NettyClientBoss", true)),
            Executors.newCachedThreadPool(new NamedThreadFactory("NettyClientWorker", true)),
            Constants.DEFAULT_IO_THREADS);

    protected ClientBootstrap bootstrap = new ClientBootstrap(channelFactory);

    protected int bufferSize = Constants.DEFAULT_BUFFER_SIZE;
    protected int timeout = Constants.DEFAULT_TIMEOUT;
    protected final Codec2 codec;
    protected final URL url;
    protected volatile Channel channel; // volatile, please copy reference to use
    protected com.alibaba.dubbo.remoting.ChannelHandler handler;

    public TransportClient(URL url, com.alibaba.dubbo.remoting.ChannelHandler handler) {

        this.url = url;
        this.handler = handler;
        this.codec = getChannelCodec(url);

        bootstrap.setOption("keepAlive", true);
        bootstrap.setOption("tcpNoDelay", true);
        bootstrap.setOption("connectTimeoutMillis", timeout);

        final NettyHandler nettyHandler = new NettyHandler(url, handler);
        bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
            public ChannelPipeline getPipeline() {

                ChannelPipeline pipeline = Channels.pipeline();
                pipeline.addLast("decoder", getDecoder());
                pipeline.addLast("encoder", getEncoder());
                pipeline.addLast("handler", nettyHandler);
                return pipeline;
            }
        });
    }

    protected static Codec2 getChannelCodec(URL url) {
        String codecName = url.getParameter(Constants.CODEC_KEY, "telnet");
        return ExtensionLoader.getExtensionLoader(Codec2.class).getExtension(codecName);
    }

    protected SocketAddress getConnectAddress() {
        return new InetSocketAddress(NetUtils.filterLocalHost(url.getHost()), url.getPort());
    }

    private org.jboss.netty.channel.ChannelHandler getEncoder() {
        return new InternalEncoder();
    }

    private org.jboss.netty.channel.ChannelHandler getDecoder() {
        return new InternalDecoder();
    }

    private class InternalEncoder extends OneToOneEncoder {

        @Override
        protected Object encode(ChannelHandlerContext ctx, Channel ch, Object msg) throws Exception {
            com.alibaba.dubbo.remoting.buffer.ChannelBuffer buffer =
                    com.alibaba.dubbo.remoting.buffer.ChannelBuffers.dynamicBuffer(1024);
            NettyChannel channel = NettyChannel.getOrAddChannel(ch, url, handler);
            try {
                codec.encode(channel, buffer, msg);
            } finally {
                NettyChannel.removeChannelIfDisconnected(ch);
            }
            return ChannelBuffers.wrappedBuffer(buffer.toByteBuffer());
        }
    }
    private class InternalDecoder extends SimpleChannelUpstreamHandler {

        private com.alibaba.dubbo.remoting.buffer.ChannelBuffer buffer =
                com.alibaba.dubbo.remoting.buffer.ChannelBuffers.EMPTY_BUFFER;

        @Override
        public void messageReceived(ChannelHandlerContext ctx, MessageEvent event) throws Exception {
            Object o = event.getMessage();
            if (!(o instanceof ChannelBuffer)) {
                ctx.sendUpstream(event);
                return;
            }

            ChannelBuffer input = (ChannelBuffer) o;
            int readable = input.readableBytes();
            if (readable <= 0) {
                return;
            }

            com.alibaba.dubbo.remoting.buffer.ChannelBuffer message;
            if (buffer.readable()) {
                if (buffer instanceof DynamicChannelBuffer) {
                    buffer.writeBytes(input.toByteBuffer());
                    message = buffer;
                } else {
                    int size = buffer.readableBytes() + input.readableBytes();
                    message = com.alibaba.dubbo.remoting.buffer.ChannelBuffers.dynamicBuffer(
                            size > bufferSize ? size : bufferSize);
                    message.writeBytes(buffer, buffer.readableBytes());
                    message.writeBytes(input.toByteBuffer());
                }
            } else {
                message = com.alibaba.dubbo.remoting.buffer.ChannelBuffers.wrappedBuffer(
                        input.toByteBuffer());
            }

            NettyChannel channel = NettyChannel.getOrAddChannel(ctx.getChannel(), url, handler);
            Object msg;
            int saveReaderIndex;

            try {
                // decode object.
                do {
                    saveReaderIndex = message.readerIndex();
                    try {
                        msg = codec.decode(channel, message);
                    } catch (IOException e) {
                        buffer = com.alibaba.dubbo.remoting.buffer.ChannelBuffers.EMPTY_BUFFER;
                        throw e;
                    }
                    if (msg == Codec2.DecodeResult.NEED_MORE_INPUT) {
                        message.readerIndex(saveReaderIndex);
                        break;
                    } else {
                        if (saveReaderIndex == message.readerIndex()) {
                            buffer = com.alibaba.dubbo.remoting.buffer.ChannelBuffers.EMPTY_BUFFER;
                            throw new IOException("Decode without read data.");
                        }
                        if (msg != null) {
                            Channels.fireMessageReceived(ctx, msg, event.getRemoteAddress());
                        }
                    }
                } while (message.readable());
            } finally {
                if (message.readable()) {
                    message.discardReadBytes();
                    buffer = message;
                } else {
                    buffer = com.alibaba.dubbo.remoting.buffer.ChannelBuffers.EMPTY_BUFFER;
                }
                NettyChannel.removeChannelIfDisconnected(ctx.getChannel());
            }
        }

        @Override
        public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception {
            ctx.sendUpstream(e);
        }
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/context/ApplicationReadyEventListener.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.context;

import com.mmc.dubbo.doe.service.PomService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.ConfigurableApplicationContext;

import java.net.MalformedURLException;

/**
 * @author Joey
 * @date 2018/6/22 13:55
 */
@Slf4j
public class ApplicationReadyEventListener implements ApplicationListener<ApplicationReadyEvent> {


    /**
     * Handle an application event.
     *
     * @param event the event to respond to
     */
    @Override
    public void onApplicationEvent(ApplicationReadyEvent event) {

        log.info("ApplicationReadyEventListener.onApplicationEvent()");
        ConfigurableApplicationContext applicationContext = event.getApplicationContext();

        PomService pomService = applicationContext.getBean("pomService", PomService.class);
        try {
            log.info("begin auto to load jars.");
            pomService.loadJars("");
            log.info("finished load jars.");
        } catch (NoSuchMethodException | MalformedURLException e) {
            log.error("fail to load jars.", e);
        }

    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/context/Const.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.context;

/**
 * @author Joey
 * @date 2018/6/17 18:38
 */
public class Const {

    /**
     * download task key.
     */
    public static final String DOE_DOWNLOAD_JAR_TASK = "doe:download:jar:task";
    /**
     * when the task was running.
     */
    public static final int RUNNING_FlAG = 1;
    /**
     * when the task has completed.
     */
    public static final int COMPLETE_FLAG = 2;
    /**
     * download task real time message key.
     */
    public static final String DOE_DOWNLOAD_JAR_MESSAGE = "doe:download:jar:msg:{}";

    /**
     * the project cache namespace.
     */
    public static final String DOE_CACHE_PREFIX = "doe:cache";
    /**
     * use case key.
     */
    public static final String DOE_CASE_KEY = "doe:case";
    /**
     * all config of zk address key.
     */
    public static final String DOE_REGISTRY_KEY = "doe:registry:list";
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/context/DoeClassLoader.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.context;

import com.alibaba.dubbo.common.utils.StringUtils;
import com.mmc.dubbo.doe.exception.DoeException;
import com.mmc.dubbo.doe.util.StringUtil;
import lombok.extern.slf4j.Slf4j;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Enumeration;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;

/**
 * 自定义类加载器,做沙箱隔离.
 *
 * @author Joey
 * @date 2019/6/28 14:20
 */
@Slf4j
public class DoeClassLoader extends ClassLoader {


    private final String path;

    private static Map<String, byte[]> classMap = new ConcurrentHashMap<>();


    /**
     * destroy the Parental Entrustment.
     */
    public DoeClassLoader(String path) {
        super(null);
        this.path = path;
    }


    private void scanJarFile(File file) throws Exception {

        JarFile jar = new JarFile(file);

        Enumeration<JarEntry> en = jar.entries();
        while (en.hasMoreElements()) {
            JarEntry je = en.nextElement();
            je.getName();
            String name = je.getName();
            if (name.endsWith(".class")) {

                String className = makeClassName(name);

                try (InputStream input = jar.getInputStream(je); ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
                    int bufferSize = 1024;
                    byte[] buffer = new byte[bufferSize];
                    int bytesNumRead;
                    while ((bytesNumRead = input.read(buffer)) != -1) {
                        baos.write(buffer, 0, bytesNumRead);
                    }
                    addClass(className, baos.toByteArray());
                }
            }
        }
        jar.close();
    }

    private String makeClassName(String name) {
        String ret = name.replace("\\", ".")
                .replace("/", ".")
                .replace(".class", "");
        return ret;
    }

    /**
     * load jars from the Specified path.
     */
    public void loadJars() throws Exception {

        if (StringUtils.isEmpty(path)) {
            throw new DoeException(StringUtil.format("can't found the path {}", path));
        }

        File libPath = new File(path);
        if (!libPath.exists()) {
            throw new DoeException(StringUtil.format("the path[{}] is not exists.", path));
        }

        File[] files = libPath.listFiles((dir, name) -> name.endsWith(".jar") || name.endsWith(".zip"));

        if (files != null) {
            for (File file : files) {
                scanJarFile(file);
            }
        }
    }

    /**
     * Add one class dynamically.
     */
    public static boolean addClass(String className, byte[] byteCode) {
        if (!classMap.containsKey(className)) {
            classMap.put(className, byteCode);
            return true;
        }
        return false;
    }

    @Override
    protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {

        name = makeClassName(name);

        byte[] stream = get(name);

        if (null != stream) {

            return defineClass(name, stream, 0, stream.length);
        }

        return super.loadClass(name, resolve);

    }

    /**
     * Get class in our classloader rather than system classloader.
     */
    public static Class<?> getClass(String name) throws ClassNotFoundException {
        return new DoeClassLoader("").loadClass(name, false);
    }

    private static byte[] get(String className) {
        return classMap.getOrDefault(className, null);
    }

    private void scanClassFile(File file) {
        if (file.exists()) {
            if (file.isFile() && file.getName().endsWith(".class")) {
                try {
                    byte[] byteCode = Files.readAllBytes(Paths.get(file.getAbsolutePath()));
                    String className = file.getAbsolutePath().replace(this.path, "")
                            .replace(File.separator, ".");

                    className = makeClassName(className);

                    addClass(className, byteCode);
                } catch (IOException e) {
                    e.printStackTrace();
                }
            } else if (file.isDirectory()) {
                for (File f : Objects.requireNonNull(file.listFiles())) {
                    scanClassFile(f);
                }
            }
        }
    }

    /**
     * load classes from the Specified path.
     */
    public void loadClassFile() {
        File[] files = new File(path).listFiles();
        if (files != null) {
            for (File file : files) {
                scanClassFile(file);
            }
        }
    }

    /**
     * clear the class cache.
     */
    public void clearCache() {
        classMap.clear();
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/context/ResponseDispatcher.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.context;

import com.alibaba.dubbo.remoting.exchange.Request;
import com.alibaba.dubbo.remoting.exchange.Response;
import com.alibaba.dubbo.rpc.RpcResult;

import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author Joey
 * @date 2018/6/11 12:33
 */
public class ResponseDispatcher {

    private Map<Long, CompletableFuture> futures = new ConcurrentHashMap<>();

    private ResponseDispatcher() {

    }

    @SuppressWarnings("uncheck")
    public CompletableFuture<RpcResult> getFuture(Request req) {
        return futures.get(req.getId());
    }

    public void register(Request req) {

        CompletableFuture future = new CompletableFuture();
        futures.put(req.getId(), future);
    }

    public void dispatch(Response res) {

        CompletableFuture future = futures.get(res.getId());
        if (null == future) {
            throw new RuntimeException();
        }
        future.complete(res.getResult());
    }

    public CompletableFuture removeFuture(Request req) {
        return futures.remove(req.getId());
    }

    static class ResponseDispatcherHolder {
        static final ResponseDispatcher instance = new ResponseDispatcher();
    }

    public static ResponseDispatcher getDispatcher() {
        return ResponseDispatcherHolder.instance;
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/context/TaskContainer.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.context;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.*;

/**
 * @author Joey
 * @date 2018/6/29 20:00
 */
@Slf4j
public class TaskContainer {

    // 获取当前的cpu核心数
    private static final int CPU_COUNT = Runtime.getRuntime().availableProcessors();
    // 线程池最大容量
    public static final int MAXIMUM_POOL_SIZE = CPU_COUNT;
    // 线程池核心容量
    private static final int CORE_POOL_SIZE = CPU_COUNT;
    // 线程池
    private final ThreadPoolExecutor poolExecutor;
    // 判断是否关闭
    protected volatile boolean isShutdown;
    // 任务计数器
    protected CountDownLatch watch;

    private TaskContainer() {

        // 创建任务池
        poolExecutor = new ThreadPoolExecutor(2, MAXIMUM_POOL_SIZE, 1,
                TimeUnit.HOURS, new ArrayBlockingQueue<Runnable>(CORE_POOL_SIZE), new RejectedExecutionHandler() {
            @Override
            public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
                try {
                    // 核心改造点,由blocking queue的offer改成put阻塞方法
                    executor.getQueue().put(r);
                } catch (InterruptedException e) {
                    log.error("任务进入队列出错:", e);
                }
            }
        });

    }

    public static TaskContainer getTaskContainer() {
        return TaskContainerHolder.instance;
    }

    /**
     * execute task.
     *
     * @param task
     */
    public void execute(Runnable task) {
        poolExecutor.execute(task);
    }

    static class TaskContainerHolder {
        static final TaskContainer instance = new TaskContainer();
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/crontroller/CaseController.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.crontroller;

import com.alibaba.fastjson.JSON;
import com.mmc.dubbo.doe.dto.CaseModelDTO;
import com.mmc.dubbo.doe.dto.ResultDTO;
import com.mmc.dubbo.doe.model.CaseModel;
import com.mmc.dubbo.doe.service.CaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author Joey
 * @date 2018/6/29 15:57
 */
@RestController
@RequestMapping("/doe/case")
@Slf4j
public class CaseController {

    @Autowired
    private CaseService caseService;


    @RequestMapping("/doSave")
    public ResultDTO<CaseModel> doSave(@NotNull CaseModelDTO dto) {

        log.info("CaseController.doSave({})", JSON.toJSONString(dto));

        ResultDTO<CaseModel> resultDTO;

        try {

            CaseModel model = new CaseModel();
            BeanUtils.copyProperties(dto, model);
            resultDTO = caseService.save(model);

        } catch(Exception e) {

            resultDTO = ResultDTO.createExceptionResult(e, CaseModel.class);
        }

        return resultDTO;
    }

    @RequestMapping("/doList")
    public String doList(CaseModelDTO dto) {

        log.info("CaseController.doList({})", JSON.toJSONString(dto));

        try {

            List<Object> list = caseService.listAll();

            List<CaseModel> ret = list.stream().map(l -> {
                CaseModel model = new CaseModel();
                BeanUtils.copyProperties(l, model);
                return model;
            }).collect(Collectors.toList());

            return JSON.toJSONString(ret);

        } catch(Exception e) {

            return "[]";
        }
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/crontroller/DubboController.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.crontroller;

import com.alibaba.fastjson.JSON;
import com.mmc.dubbo.doe.dto.ConnectDTO;
import com.mmc.dubbo.doe.dto.ResultDTO;
import com.mmc.dubbo.doe.dto.MethodModelDTO;
import com.mmc.dubbo.doe.dto.UrlModelDTO;
import com.mmc.dubbo.doe.model.ServiceModel;
import com.mmc.dubbo.doe.service.ClassService;
import com.mmc.dubbo.doe.service.ConnectService;
import com.mmc.dubbo.doe.service.TelnetService;
import com.mmc.dubbo.doe.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author Joey
 * @date 2018/6/18 17:07
 */
@RestController
@RequestMapping("/doe/dubbo")
@Slf4j
public class DubboController {

    @Autowired
    private ConnectService connectService;

    @Autowired
    private ClassService classService;

    @Autowired
    private TelnetService telnetService;

    @RequestMapping("/doSendWithTelnet")
    public ResultDTO<String> doSendWithTelnet(@NotNull ConnectDTO dto) {

        log.info("DubboController.doSendWithTelnet({})", JSON.toJSONString(dto));

        ResultDTO<String> resultDTO;

        try {

            resultDTO = telnetService.send(dto);

        } catch(Exception e) {

            resultDTO = ResultDTO.createExceptionResult(e, String.class);
        }

        return resultDTO;
    }

    @RequestMapping("/doSend")
    public ResultDTO<String> doSend(@NotNull ConnectDTO dto) {

        log.info("DubboController.doSend({})", JSON.toJSONString(dto));

        ResultDTO<String> resultDTO;

        try {

            resultDTO = connectService.send(dto);

        } catch(Exception e) {

            resultDTO = ResultDTO.createExceptionResult(e, String.class);
        }

        return resultDTO;
    }

    @RequestMapping("/doListParams")
    public ResultDTO<String> doListParams(@NotNull MethodModelDTO dto) {

        log.info("DubboController.doListParams({})", JSON.toJSONString(dto));

        ResultDTO<String> resultDTO;

        try {

            resultDTO = classService.generateMethodParamsJsonString(dto);

        } catch(Exception e) {

            resultDTO = ResultDTO.createExceptionResult(e, String.class);
        }


        return resultDTO;
    }

    @RequestMapping("/doListMethods")
    public ResultDTO<Object> doListMethods(@NotNull ConnectDTO dto) {

        log.info("DubboController.doListMethods({})", dto.getProviderKey());

        ResultDTO<Object> resultDTO = new ResultDTO<>();

        try {

            List<MethodModelDTO> models = classService.listMethods(dto);
            if (CollectionUtils.isEmpty(models)) {

                resultDTO = ResultDTO.createErrorResult(StringUtil.format("no methods for {}.",
                        dto.getServiceName()), Object.class);

            } else {

                log.info("methods: {}", JSON.toJSONString(models));
                resultDTO.setData(models);
                resultDTO.setSuccess(true);

            }

        } catch(Exception e) {

            resultDTO = ResultDTO.createExceptionResult(e, Object.class);
            resultDTO.setMsg("occur an error when get methods : " + resultDTO.getMsg());
        }

        return resultDTO;
    }

    @RequestMapping("/doListProviders")
    public ResultDTO<Object> doListProviders(@NotNull ConnectDTO dto) {

        log.info("DubboController.doListProviders({} {} {})", dto.getServiceName(), dto.getVersion(), dto.getGroup());

        ResultDTO<Object> resultDTO = new ResultDTO<>();

        try {


            List<UrlModelDTO> models = connectService.listProviders(dto);
            if (CollectionUtils.isEmpty(models)) {

                resultDTO = ResultDTO.createErrorResult(StringUtil.format("no provider for {} in this zookeeper registry.",
                        dto.getServiceName()), Object.class);

            } else {

                log.info("providers: {}", JSON.toJSONString(models));
                resultDTO.setData(models);
                resultDTO.setSuccess(true);

            }

        } catch(Exception e) {

            resultDTO = ResultDTO.createExceptionResult(e, Object.class);
            resultDTO.setMsg("occur an error when get provider : " + resultDTO.getMsg());
        }

        return resultDTO;
    }

    @RequestMapping("/doConnect")
    public ResultDTO<Object> doConnect(@NotNull String conn) {

        log.debug("DubboController.doConnect({})", conn);

        ResultDTO<Object> resultDTO = new ResultDTO<>();

        try {

            List<ServiceModel> models = connectService.connect(conn);
            if (CollectionUtils.isEmpty(models)) {

                resultDTO = ResultDTO.createErrorResult("no provider for this this zookeeper registry.", Object.class);

            } else {

                resultDTO.setData(models);
                resultDTO.setSuccess(true);

            }

        } catch(Exception e) {

            resultDTO = ResultDTO.createExceptionResult(e, Object.class);
        }

        return resultDTO;

    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/crontroller/HomeController.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.crontroller;

import com.mmc.dubbo.doe.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author Joey
 * @date 2018/6/16 11:57
 */
@Controller
@RequestMapping("/doe/home")
public class HomeController {

    @Autowired
    private MenuService menuService;

    @RequestMapping("/index")
    public String index(Model model) {

        // open easyCnt page defaultly.
        return index("f16001100", model);
    }

    @RequestMapping("/main")
    public String index(String mid, Model model) {

        // you can do something here, such as auth validation,,,
        Integer menuId = Integer.valueOf(mid.substring(1));
        String path = menuService.getUrl(menuId);
        String menuHtml = menuService.getHtml();

        model.addAttribute("mid", mid);
        model.addAttribute("menuHtml", menuHtml);

        return path;

    }


    @RequestMapping("/normalCnt")
    public String openNormalPage() {

        return "/pages/v3/normalCnt.html";
    }

    @RequestMapping("/caseCnt")
    public String openCasePage() {

        return "/pages/v3/caseCnt.html";
    }

    @RequestMapping("/easyCnt")
    public String openEasyPage() {

        return "/pages/v3/easyCnt.html";
    }

    @RequestMapping("/addJar")
    public String openAddJarPage() {

        return "/pages/v3/addJar.html";
    }

    @RequestMapping("/listJar")
    public String openListJarPage() {

        return "/pages/v3/listJar.html";
    }
    @RequestMapping("/editPom")
    public String openEditPomPage() {

        return "/pages/v3/editPom.html";
    }

    @RequestMapping("/listZk")
    public String openListZkPage() {

        return "/pages/v3/listZk.html";
    }

    @RequestMapping("/sys")
    public String openSysPage() {

        return "/pages/v3/sys.html";
    }

}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/crontroller/PomController.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.crontroller;

import com.alibaba.dubbo.common.utils.StringUtils;
import com.alibaba.fastjson.JSON;
import com.mmc.dubbo.doe.dto.PomDTO;
import com.mmc.dubbo.doe.dto.ResultDTO;
import com.mmc.dubbo.doe.exception.DoeException;
import com.mmc.dubbo.doe.model.PomModel;
import com.mmc.dubbo.doe.service.PomService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Dependency controller.
 * @author Joey
 * @date 2018/6/17 8:53
 */
@RestController
@RequestMapping("/doe/pom")
@Slf4j
public class PomController {


    @Autowired
    private PomService pomService;

    /**
     * load jars.
     *
     * @return
     */
    @RequestMapping("/doLoad")
    public ResultDTO<String> doLoad() {

        log.info("PomController.doLoad");

        ResultDTO<String> resultDTO = null;

        try {

            resultDTO = pomService.loadJars("");

        } catch(Exception e) {

            resultDTO = ResultDTO.createExceptionResult(e, String.class);
        }

        return resultDTO;

    }

    /**
     * parse the upload content to pom model and fork another process to invoke cmd/shell command to download the jars at background.
     *
     * @param pom
     * @return
     */
    @RequestMapping("/doParse")
    public ResultDTO<PomDTO> doParse(String pom) {

        log.info("PomController.doParse({})", pom);

        ResultDTO<PomDTO> resultDTO;

        try {

            if (StringUtils.isEmpty(pom)) {
                throw new DoeException("the pom content can't be blank.");
            }
            // convert the pom
            pom = org.apache.commons.text.StringEscapeUtils.unescapeXml(pom);
            log.debug("pom after escape was {}", pom);

            PomDTO dto = new PomDTO();
            dto.setPom(pom);

            resultDTO = pomService.invoke(dto);

        } catch(Exception e) {

            resultDTO = ResultDTO.createExceptionResult(e, PomDTO.class);
        }

        return resultDTO;

    }

    /**
     * invoke the mvn command to download the jars again.
     *
     * @return
     */
    @RequestMapping("/doReparse")
    public ResultDTO<PomDTO> doReparse() {

        log.info("PomController.doReparse({})");

        ResultDTO<PomDTO> resultDTO;

        try {

            resultDTO = pomService.invoke();

        } catch(Exception e) {

            resultDTO = ResultDTO.createExceptionResult(e, PomDTO.class);
        }

        return resultDTO;

    }

    @RequestMapping("/doMsg")
    public ResultDTO<String> getRealTimeMsg(String requestId) {

        log.info("PomController.getRealTimeMsg({})", requestId);

        ResultDTO<String> resultDTO;

        try {

            if (StringUtils.isEmpty(requestId)) {
                resultDTO = ResultDTO.createErrorResult("ERROR", String.class);
            } else {
                resultDTO = pomService.getRealTimeMsg(requestId);
            }

        } catch(Exception e) {

            resultDTO = ResultDTO.createExceptionResult(e, String.class);
        }

        return resultDTO;
    }

    @RequestMapping("/doListJars")
    public String doListJars(PomDTO dto) {

        log.info("PomController.doListJars({})", JSON.toJSONString(dto));

        String result;

        try {

            List<PomModel> models = pomService.listJars(dto);
            result = JSON.toJSONString(models);

        } catch(Exception e) {

            result = "[]";
        }

        return result;
    }

    @RequestMapping("/doLoadPomFile")
    public ResultDTO<String> doLoadPomFile() {

        log.info("PomController.doLoadPomFile");

        ResultDTO<String> resultDTO;

        try {

            String content = pomService.loadPomFile(null);

            resultDTO = ResultDTO.handleSuccess("SUCCESS", content);

        } catch(Exception e) {

            resultDTO = ResultDTO.createExceptionResult(e, String.class);
        }

        return resultDTO;
    }

    @RequestMapping("/doOverridePomFile")
    public ResultDTO<Boolean> doOverridePomFile(String content) {

        log.info("PomController.doOverridePomFile");

        ResultDTO<Boolean> resultDTO;

        try {

            Boolean flag = pomService.overridePomFile("", content);

            resultDTO = ResultDTO.handleSuccess("SUCCESS", flag);

        } catch(Exception e) {

            resultDTO = ResultDTO.createExceptionResult(e, Boolean.class);
        }

        return resultDTO;
    }

}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/crontroller/RegistryController.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.crontroller;

import com.alibaba.fastjson.JSON;
import com.mmc.dubbo.doe.dto.ResultDTO;
import com.mmc.dubbo.doe.model.RegistryModel;
import com.mmc.dubbo.doe.service.ConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author Joey
 * @date 2018/7/9 19:39
 */
@RestController
@RequestMapping("/doe/zk")
@Slf4j
public class RegistryController {

    @Autowired
    private ConfigService configService;

    @RequestMapping("/doListZk")
    public String doListZk() {

        log.info("RegistryController.doListZk()");

        String result;

        try {

            List<RegistryModel> models = configService.listRegistry();
            result = JSON.toJSONString(models);

        } catch (Exception e) {

            result = "[]";
        }

        return result;
    }


    @RequestMapping("/doListRegistry")
    public ResultDTO<Object> doListRegistry() {

        log.info("RegistryController.doListRegistry()");

        ResultDTO<Object> resultDTO = new ResultDTO<>();

        try {

            List<RegistryModel> models = configService.listRegistry();
            resultDTO.setData(models);
            resultDTO.setSuccess(true);

        } catch (Exception e) {

            resultDTO = ResultDTO.createExceptionResult("occur an error when list registry address : ", e, Object.class);
        }

        return resultDTO;
    }

    @RequestMapping("/addRegistry")
    public ResultDTO<RegistryModel> addRegistry(@NotNull RegistryModel dto) {

        log.info("RegistryController.addRegistry({})", JSON.toJSONString(dto));

        ResultDTO<RegistryModel> resultDTO;

        try {

            resultDTO = configService.addRegistry(dto);

        } catch (Exception e) {

            resultDTO = ResultDTO.createExceptionResult(e, RegistryModel.class);
        }

        return resultDTO;
    }

    @RequestMapping("/delRegistry")
    public ResultDTO<RegistryModel> delRegistry(@NotNull RegistryModel dto) {

        log.info("RegistryController.delRegistry({})", JSON.toJSONString(dto));

        ResultDTO<RegistryModel> resultDTO;

        try {

            resultDTO = configService.delRegistry(dto);

        } catch (Exception e) {

            resultDTO = ResultDTO.createExceptionResult(e, RegistryModel.class);
        }

        return resultDTO;
    }


}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/crontroller/SysConfController.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.crontroller;

import com.mmc.dubbo.doe.dto.ResultDTO;
import com.mmc.dubbo.doe.service.PomService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.net.MalformedURLException;

/**
 * @author Joey
 * @date 2018/10/30 16:28
 */
@Slf4j
@RestController
@RequestMapping("/doe/sys")
public class SysConfController {

    @Value("${doe.watchdog.url}")
    private String url;

    @Resource
    private PomService pomService;

    @RequestMapping("/doReload")
    public ResultDTO<String> doReload(HttpServletResponse response) {

        log.info("SysConfController.doReload");

        try {

            return pomService.loadJars("");

        } catch (NoSuchMethodException | MalformedURLException e) {

            return ResultDTO.handleException(null, null, e);
        }

    }

    @RequestMapping("/doRepublish")
    public ResultDTO<String> doRepublish(HttpServletResponse response) {

        log.info("SysConfController.doRepublish");

        return pomService.deleteJars("");

    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dao/CaseDAO.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.dao;

import com.mmc.dubbo.doe.model.CaseModel;

import java.util.List;

/**
 * @author Joey
 * @date 2018/6/29 15:36
 */
public interface CaseDAO {

    /**
     * save the case.
     *
     * @param model
     * @return
     */
    int save(CaseModel model);

    /**
     * list all model.
     * @return
     */
    List<CaseModel> listAll();

}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/BaseDTO.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.dto;

import java.util.concurrent.atomic.AtomicLong;

/**
 * @author Joey
 * @date 2018/6/17 10:11
 */
public class BaseDTO {

    private static final AtomicLong counter = new AtomicLong();

    private final String requestId;

    public BaseDTO() {

        this.requestId = String.valueOf(counter.getAndAdd(1));
    }

    public String getRequestId() {
        return requestId;
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/CaseModelDTO.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.dto;

import com.mmc.dubbo.doe.model.CaseModel;

/**
 * @author Joey
 * @date 2018/6/29 15:58
 */
public class CaseModelDTO extends CaseModel {

}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/ConnectDTO.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.dto;

import lombok.Data;

/**
 * @author Joey
 * @date 2018/6/18 19:10
 */
@Data
public class ConnectDTO extends BaseDTO {

    /**
     * ip and port.
     */
    private String conn;
    /**
     * interface name;
     */
    private String serviceName;
    /**
     * the provider cache key.
     */
    private String providerKey;
    /**
     * method key.
     */
    private String methodKey;
    /**
     * method name.
     */
    private String methodName;
    /**
     * method params.
     */
    private String json;
    /**
     * timeout of waiting for result.
     */
    private int timeout;
    /**
     * interface version number, eg: 1.0.0
     */
    private String version;
    /**
     * the group of interface, eg: mmcgroup
     */
    private String group;
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/MethodModelDTO.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.dto;

import com.mmc.dubbo.doe.model.MethodModel;
import lombok.Data;

/**
 * @author Joey
 * @date 2018/6/18 21:49
 */
@Data
public class MethodModelDTO {

    /**
     * the name of interface which the method belong to.
     */
    private String interfaceName;
    /**
     * the cache key.
     */
    private String methodKey;
    /**
     * just only the method name.
     */
    private String methodName;
    /**
     * show on the web.
     */
    private String methodText;

    public MethodModelDTO() {

    }

    public MethodModelDTO(MethodModel model) {

        this.methodKey = model.getKey();
        this.methodName = model.getMethod().getName();
        this.methodText = model.getMethodText();
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/PomDTO.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.dto;

import lombok.Data;

/**
 * @author Joey
 * @date 2018/6/17 10:03
 */
@Data
public class PomDTO extends BaseDTO {

    /**
     * the pom xml content.
     */
    private String pom;

    /**
     * the path of pom file.
     */
    private String path;

}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/ResultDTO.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.dto;

import com.alibaba.dubbo.common.utils.StringUtils;
import lombok.Data;

/**
 * common result.
 *
 * @author Joey
 * @date 2018/6/17 9:30
 */
@Data
public class ResultDTO<T> {

    private static final long serialVersionUID = 1789151585L;
    private static final int DEFAULT_EXCEPTION_CODE = -1; // 默认异常码
    private static final int DEFAULT_SUCCESS_CODE = 1; // 默认成功吗
    private static final int DEFAULT_ERROR_CODE = 0; // 默认错误吗

    private int code; // 响应码
    private boolean success; // 执行结果标识
    private String msg; // 消息
    private String remark; // 备注
    private T data; // 附带数据
    private Throwable exception; // 异常

    public static <T> ResultDTO<T> handleSuccess(String msg, T data) {

        ResultDTO<T> ret = new ResultDTO<>();
        ret.setCode(DEFAULT_SUCCESS_CODE);
        ret.setSuccess(true);
        ret.setMsg(msg);
        ret.setRemark("success");
        ret.setData(data);
        ret.setException(null);
        return ret;

    }
    public static <T> ResultDTO<T> handleError(String msg, T data) {
        ResultDTO<T> ret = new ResultDTO<>();
        ret.setCode(DEFAULT_ERROR_CODE);
        ret.setMsg(msg);
        ret.setSuccess(false);
        ret.setRemark("occur an error");
        ret.setData(data);
        ret.setException(null);
        return ret;
    }
    public static <T> ResultDTO<T> handleException(String msg, T data, Throwable e) {
        ResultDTO<T> ret = new ResultDTO<>();
        ret.setCode(DEFAULT_EXCEPTION_CODE);
        ret.setSuccess(false);
        ret.setMsg(null == msg ? e.getMessage() : msg);
        ret.setRemark("occur an exception");
        ret.setData(data);
        ret.setException(e);
        return ret;

    }

    public static <T> ResultDTO<T> createExceptionResult(Throwable e, Class<T> clazz) {

        return createExceptionResult("", e, clazz);
    }

    public static <T> ResultDTO<T> createExceptionResult(String msg, Throwable e, Class<T> clazz) {

        ResultDTO<T> ret = new ResultDTO<>();
        ret.setCode(DEFAULT_EXCEPTION_CODE);
        ret.setSuccess(false);
        ret.setMsg(StringUtils.isEmpty(msg) ? e.getMessage() : msg);
        ret.setRemark("occur an exception");
        ret.setData(null);
        ret.setException(e);
        return ret;
    }

    public static <T> ResultDTO<T> createErrorResult(String msg, Class<T> clazz) {
        ResultDTO<T> ret = new ResultDTO<>();
        ret.setCode(DEFAULT_ERROR_CODE);
        ret.setMsg(msg);
        ret.setSuccess(false);
        ret.setRemark("occur an error");
        ret.setData(null);
        ret.setException(null);
        return ret;
    }

    public static <T> ResultDTO<T> createSuccessResult(String msg, Class<T> clazz) {
       return createSuccessResult(msg, null, clazz);
    }

    public static <T> ResultDTO<T> createSuccessResult(String msg, T data, Class<T> clazz) {
        ResultDTO<T> ret = new ResultDTO<>();
        ret.setCode(DEFAULT_SUCCESS_CODE);
        ret.setSuccess(true);
        ret.setMsg(msg);
        ret.setRemark("success");
        ret.setData(data);
        ret.setException(null);
        return ret;
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/UrlModelDTO.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.dto;

import lombok.Data;

/**
 * @author Joey
 * @date 2018/6/18 21:19
 */
@Data
public class UrlModelDTO {

    private String key;
    private String host;
    private Integer port;

}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/exception/DoeException.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.exception;

/**
 * @author Joey
 * @date 2018/6/13 19:29
 */
public class DoeException extends RuntimeException {

    public DoeException(String message) {
        super(message);
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/handler/CuratorHandler.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.handler;

import com.alibaba.dubbo.common.Constants;
import com.alibaba.dubbo.common.URL;
import com.alibaba.dubbo.common.utils.StringUtils;
import com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry;
import com.alibaba.dubbo.remoting.zookeeper.ZookeeperClient;
import com.alibaba.dubbo.remoting.zookeeper.curator.CuratorZookeeperTransporter;
import com.mmc.dubbo.doe.cache.MethodCaches;
import com.mmc.dubbo.doe.cache.UrlCaches;
import com.mmc.dubbo.doe.dto.ConnectDTO;
import com.mmc.dubbo.doe.dto.MethodModelDTO;
import com.mmc.dubbo.doe.exception.DoeException;
import com.mmc.dubbo.doe.model.ServiceModel;
import com.mmc.dubbo.doe.model.UrlModel;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Joey
 * @date 2018/6/15 10:21
 */
public class CuratorHandler {

    private final String protocol;
    private final String host;
    private final int port;
    private ZookeeperClient zkClient;
    private ZookeeperRegistry registry;
    private String root = "/dubbo";

    public CuratorHandler(String protocol, String host, int port) {
        this.protocol = protocol;
        this.host = host;
        this.port = port;
    }

    public void doConnect() throws NoSuchFieldException, IllegalAccessException {

        CuratorZookeeperTransporter zookeeperTransporter = new CuratorZookeeperTransporter();
        URL url = new URL(protocol, host, port);

        registry = new ZookeeperRegistry(url, zookeeperTransporter);

        Field field = registry.getClass().getDeclaredField("zkClient");
        field.setAccessible(true);
        zkClient = (ZookeeperClient) field.get(registry);

    }

    public List<ServiceModel> getInterfaces() {
        List<ServiceModel> ret = new ArrayList<>();
        List<String> list = zkClient.getChildren(root);
        for (int i = 0; i < list.size(); i++) {
            ServiceModel model = new ServiceModel();
            model.setServiceName(list.get(i));
            ret.add(model);
        }

        return ret;
    }

    public List<UrlModel> getProviders(ConnectDTO dto) {

        if (null == dto) {
            throw new DoeException("dto can't be null.");
        }
        if (StringUtils.isEmpty(dto.getServiceName())) {
            throw new DoeException("service name can't be null.");
        }

        Map<String, String> map = new HashMap<>();
        map.put(Constants.INTERFACE_KEY, dto.getServiceName());

        if (StringUtils.isNotEmpty(dto.getVersion())) {
            map.put(Constants.VERSION_KEY, dto.getVersion());
        }
        if (StringUtils.isNotEmpty(dto.getGroup())) {
            map.put(Constants.GROUP_KEY, dto.getGroup());
        }

        URL url = new URL(protocol, host, port, map);
        List<URL> list = registry.lookup(url);

        return UrlCaches.cache(dto.getServiceName(), list);
    }

    public List<MethodModelDTO> getMethods(String interfaceName) throws ClassNotFoundException {

        Class<?> clazz = Class.forName(interfaceName);
        Method[] methods = clazz.getMethods();

        return MethodCaches.cache(interfaceName, methods); // 缓存一份,方便下次调用

    }

    public void close() {
        registry.destroy();
    }

    public boolean isAvailable() {
        return registry.isAvailable();
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/handler/SendReceiveHandler.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.handler;

import com.alibaba.dubbo.remoting.Channel;
import com.alibaba.dubbo.remoting.ChannelHandler;
import com.alibaba.dubbo.remoting.RemotingException;
import com.alibaba.dubbo.remoting.TimeoutException;
import com.alibaba.dubbo.remoting.exchange.Request;
import com.alibaba.dubbo.remoting.exchange.Response;
import com.alibaba.dubbo.rpc.RpcResult;
import com.alibaba.fastjson.JSON;
import com.mmc.dubbo.doe.context.ResponseDispatcher;
import lombok.extern.slf4j.Slf4j;

/**
 * nio event listener.
 * @author Joey
 * @date 2018/6/7 10:55
 */
@Slf4j
public class SendReceiveHandler implements ChannelHandler {


    @Override
    public void connected(Channel channel) throws RemotingException {
        log.info("SendReceiveHandler.connected");
    }

    @Override
    public void disconnected(Channel channel) throws RemotingException {
        log.info("SendReceiveHandler.disconnected");
    }

    @Override
    public void sent(Channel channel, Object message) throws RemotingException {

        log.info("SendReceiveHandler.sent");

        if (message instanceof Request) {

            Request req = (Request) message;
            ResponseDispatcher.getDispatcher().register(req);

        }
    }

    @Override
    public void received(Channel channel, Object message) {

        log.info("SendReceiveHandler.received({})", JSON.toJSONString(message));

        if (message instanceof Response) {

            Response res = (Response) message;

            if (res.getStatus() == Response.OK) {
                try {

                    if (res.getResult() instanceof RpcResult) {
                        ResponseDispatcher.getDispatcher().dispatch(res);
                    }

                } catch (Exception e) {
                    log.error("callback invoke error .result:" + res.getResult() + ",url:" + channel.getUrl(), e);
                }
            } else if (res.getStatus() == Response.CLIENT_TIMEOUT || res.getStatus() == Response.SERVER_TIMEOUT) {
                try {
                    TimeoutException te = new TimeoutException(res.getStatus() == Response.SERVER_TIMEOUT, channel, res.getErrorMessage());
//                    callbackCopy.caught(te);
                } catch (Exception e) {
                    log.error("callback invoke error ,url:" + channel.getUrl(), e);
                }
            } else {
                try {
                    RuntimeException re = new RuntimeException(res.getErrorMessage());
//                    callbackCopy.caught(re);
                } catch (Exception e) {
                    log.error("callback invoke error ,url:" + channel.getUrl(), e);
                }
            }
        }
    }

    @Override
    public void caught(Channel channel, Throwable exception) throws RemotingException {
        log.error("SendReceiveHandler.caught", exception);
    }

}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/handler/StreamHandler.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.handler;

import com.alibaba.dubbo.common.utils.StringUtils;
import com.mmc.dubbo.doe.cache.RedisResolver;
import com.mmc.dubbo.doe.context.Const;
import com.mmc.dubbo.doe.dto.PomDTO;
import com.mmc.dubbo.doe.util.StringUtil;
import lombok.extern.slf4j.Slf4j;

import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
 * @author Joey
 * @date 2018/6/29 20:20
 */
@Slf4j
public class StreamHandler implements Runnable {

    private final String libPath;
    private final RedisResolver redisResolver;
    private final String requestId;
    private final Process ps;

    public StreamHandler(Process ps, RedisResolver redisResolver, String requestId, String libPath) {
        this.ps = ps;
        this.redisResolver = redisResolver;
        this.requestId = requestId;
        this.libPath = libPath;
    }

    /**
     * When an object implementing interface <code>Runnable</code> is used
     * to create a thread, starting the thread causes the object's
     * <code>run</code> method to be called in that separately executing
     * thread.
     * <p>
     * The general contract of the method <code>run</code> is that it may
     * take any action whatsoever.
     *
     * @see Thread#run()
     */
    @Override
    public void run() {

        log.info("begin to put the message into redis.");

        // 获取标准输出
        BufferedReader readStdout = new BufferedReader(new InputStreamReader(ps.getInputStream()));
        // 获取错误输出
        BufferedReader readStderr = new BufferedReader(new InputStreamReader(ps.getErrorStream()));
        try {

            // auto expire
            String key = StringUtil.format(Const.DOE_DOWNLOAD_JAR_MESSAGE, requestId);
            redisResolver.rPush(key, "");
            redisResolver.expire(key, 15 * 60); // ten minute

            String successLine;
            String errorLine = null;
            while (null != (successLine = readStdout.readLine()) || (errorLine = readStderr.readLine()) != null) {

                if (StringUtils.isNotEmpty(successLine)) {
                    putToRedis(requestId, successLine);
                }
                if (StringUtils.isNotEmpty(errorLine)) {
                    putToRedis(requestId, errorLine);
                }
            }

            log.info("finish download the jars to the path {}.", libPath);

        } catch (Exception e) {

            log.error("occur something wrong when download the jars.", e);

        } finally {

            try {

                readStdout.close();
                readStderr.close();

            } catch (Exception e) {
                log.error("occur something wrong when close resources", e);
            }
        }
    }

    private void putToRedis(String requestId, String message) {

        log.info("{}|{}", requestId, message);

        String key = StringUtil.format(Const.DOE_DOWNLOAD_JAR_MESSAGE, requestId);

        redisResolver.rPush(key, message);

    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/CaseModel.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.model;

import lombok.Data;

import java.util.Date;
import java.util.Map;

/**
 * @author Joey
 * @date 2018/6/28 10:42
 */
@Data
public class CaseModel {

    /**
     * case Id.
     */
    private long caseId;
    /**
     * case group.
     */
    private String caseGroup;
    private String caseName;
    private String caseDesc;
    private String insertTime;
    /**
     * provider address.
     */
    private String address;
    private String interfaceName;
    /**
     * the method name with parameters.
     */
    private String methodText;
    private String providerKey;
    private String methodKey;
    /**
     * parameters.
     */
    private String json;
    /**
     * assert condition.
     */
    private String condition;
    /**
     * expected result.
     */
    private String expect;

}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/MethodModel.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.model;

import com.alibaba.dubbo.common.utils.StringUtils;
import com.mmc.dubbo.doe.util.StringUtil;

import java.lang.reflect.Method;
import java.lang.reflect.Parameter;

/**
 * @author Joey
 * @date 2018/6/15 14:54
 */
public class MethodModel {

    private final Method method;
    private final String key;

    public String getKey() {
        return key;
    }

    public Method getMethod() {
        return method;
    }

    public MethodModel(String key, Method method) {
        this.key = key;
        this.method = method;
    }

    @Override
    public String toString() {

        StringBuilder sb = new StringBuilder();
        sb.append(method.getName());
        sb.append("(");

        for (Parameter param : method.getParameters()) {
            sb.append(param.getType().getName());
            sb.append(" ");
            sb.append(param.getName());
            sb.append(", ");
        }
        sb.delete(sb.length() - 2, sb.length());
        sb.append(")");

        return sb.toString();

    }

    public String getMethodText() {
        StringBuilder sb = new StringBuilder();
        sb.append(method.getName());
        sb.append("(");

        for (Parameter param : method.getParameters()) {
            sb.append(getShortType(param.getType().getName()));
            sb.append(" ");
            sb.append(param.getName());
            sb.append(", ");
        }
        sb.delete(sb.length() - 2, sb.length());
        sb.append(")");

        return sb.toString();
    }

    private String getShortType(String name) {

        if (StringUtils.isEmpty(name)) {
            return name;
        }
        int index = name.lastIndexOf(".");
        if (index > 0 && index < name.length()) {
            name = name.substring(index + 1);
        }
        return name;
    }

}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/PointModel.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.model;

import lombok.Data;

/**
 * ip and port.
 *
 * @author Joey
 * @date 2018/7/18 10:17
 */
@Data
public class PointModel {

    private String ip;
    private int port;

    public PointModel(String host, Integer port) {
        this.ip = host;
        this.port = port;
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/PomModel.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.model;

import com.alibaba.dubbo.common.utils.StringUtils;

/**
 * @author Joey
 * @date 2018/6/16 9:55
 */
public class PomModel {

    private String groupId;
    private String artifactId;
    private String version;
    private String scope;

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String getArtifactId() {
        return artifactId;
    }

    public void setArtifactId(String artifactId) {
        this.artifactId = artifactId;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getScope() {
        return scope;
    }

    public void setScope(String scope) {
        this.scope = scope;
    }

    public boolean isBroken() {
        return StringUtils.isEmpty(groupId) || StringUtils.isEmpty(artifactId) || StringUtils.isEmpty(version);
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/RegistryModel.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.model;

import lombok.Data;

/**
 * @author Joey
 * @date 2018/7/9 19:42
 */
@Data
public class RegistryModel {

    private String registryKey;
    private String registryDesc;

}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/ServiceModel.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.model;

import lombok.Data;

/**
 * interface wrapper.
 *
 * @author Joey
 * @date 2018/6/18 17:51
 */
@Data
public class ServiceModel {

    private String serviceName;
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/UrlModel.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.model;

import com.alibaba.dubbo.common.URL;

/**
 * @author Joey
 * @date 2018/6/15 17:56
 */
public class UrlModel {

    private final String key;
    private final URL url;

    public UrlModel(String key, URL url) {
        this.key = key;
        this.url = url;
    }

    public String getKey() {
        return key;
    }

    public URL getUrl() {
        return url;
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/CaseService.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */

package com.mmc.dubbo.doe.service;

import com.mmc.dubbo.doe.dto.ResultDTO;
import com.mmc.dubbo.doe.model.CaseModel;

import java.util.List;

/**
 * @author Joey
 * @date 2018/6/29 15:21
 */
public interface CaseService {

    /**
     * save the case.
     *
     * @param model
     * @return
     */
    ResultDTO<CaseModel> save(CaseModel model);

    /**
     * list all case.
     *
     * @return
     */
    List<Object> listAll();

}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/ClassService.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */

package com.mmc.dubbo.doe.service;

import com.mmc.dubbo.doe.dto.ConnectDTO;
import com.mmc.dubbo.doe.dto.MethodModelDTO;
import com.mmc.dubbo.doe.dto.ResultDTO;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author Joey
 * @date 2018/6/28 11:28
 */
public interface ClassService {

    /**
     * generate the simple json string of the method parameters.
     *
     * @param dto
     * @return
     */
    ResultDTO<String> generateMethodParamsJsonString(@NotNull MethodModelDTO dto) throws ClassNotFoundException, InstantiationException, IllegalAccessException;

    /**
     * get all methods from the given interface.
     *
     * @param dto
     * @return
     */
    List<MethodModelDTO> listMethods(ConnectDTO dto);

}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/ConfigService.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */

package com.mmc.dubbo.doe.service;

import com.mmc.dubbo.doe.dto.ResultDTO;
import com.mmc.dubbo.doe.model.RegistryModel;

import java.util.List;

/**
 * @author Joey
 * @date 2018/7/9 19:40
 */
public interface ConfigService {

    /**
     * list all registry.
     *
     * @return
     */
    List<RegistryModel> listRegistry();

    /**
     * add registry.
     *
     * @return
     */
    ResultDTO<RegistryModel> addRegistry(RegistryModel model);

    /**
     * load zk config.
     */
    void loadZkConfigFromResource();

    /**
     * delete registry.
     *
     * @param model
     * @return
     */
    ResultDTO<RegistryModel> delRegistry(RegistryModel model);
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/ConnectService.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.service;

import com.mmc.dubbo.doe.dto.ConnectDTO;
import com.mmc.dubbo.doe.dto.ResultDTO;
import com.mmc.dubbo.doe.dto.MethodModelDTO;
import com.mmc.dubbo.doe.dto.UrlModelDTO;
import com.mmc.dubbo.doe.model.ServiceModel;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author Joey
 * @date 2018/6/18 17:10
 */
public interface ConnectService {

    /**
     * connect to zk and get all providers.
     *
     * @param conn
     * @return
     */
    List<ServiceModel> connect(@NotNull String conn) throws NoSuchFieldException, IllegalAccessException;

    /**
     * list providers of service.
     *
     * @param connect
     * @return
     */
    List<UrlModelDTO> listProviders(@NotNull ConnectDTO connect) throws NoSuchFieldException, IllegalAccessException;

    /**
     * send request to the real dubbo server.
     *
     * @param dto
     * @return
     */
    ResultDTO<String> send(ConnectDTO dto) throws Exception;
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/MenuService.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.service;

/**
 * @author Joey
 * @date 2018/11/26 16:20
 */
public interface MenuService {

    /**
     * get url map to the mid.
     *
     * @param mid menuId
     * @return the menu mrl
     */
    String getUrl(Integer mid);

    /**
     * get the menu text.
     * @return
     */
    String getHtml();
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/PomService.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */

package com.mmc.dubbo.doe.service;

import com.mmc.dubbo.doe.dto.PomDTO;
import com.mmc.dubbo.doe.dto.ResultDTO;
import com.mmc.dubbo.doe.model.PomModel;
import org.xml.sax.SAXException;

import javax.validation.constraints.NotNull;
import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.List;

/**
 * @author Joey
 * @date 2018/6/17 9:41
 */
public interface PomService {

    /**
     * download jar, push message to redis.
     * <br>
     *     it's a backdoor.
     *
     * @return
     */
    ResultDTO<PomDTO> invoke() throws Exception;

    /**
     * parse pom, download jar, push message to redis.
     *
     * @param dto
     * @return
     */
    ResultDTO<PomDTO> invoke(PomDTO dto) throws Exception;

    /**
     * do parse pom.
     *
     * @param xml
     * @return
     * @throws IOException
     * @throws SAXException
     */
    List<PomModel> parsePom(@NotNull String xml) throws IOException, SAXException;

    /**
     * do append content to the end of pom.xml.
     *
     * @param models
     * @param pomXml
     * @throws Exception
     */
    void appendPom(List<PomModel> models, @NotNull String pomXml) throws Exception;

    /**
     * get the real time message from redis.
     *
     * @param requestId
     * @return
     */
    ResultDTO<String> getRealTimeMsg(@NotNull String requestId);

    /**
     * load jars.
     *
     * @param libPath the lib full path.
     * @return
     */
    ResultDTO<String> loadJars(String libPath) throws NoSuchMethodException, MalformedURLException;

    /**
     * list all dependency.
     *
     * @param dto
     * @return
     */
    List<PomModel> listJars(PomDTO dto) throws ParserConfigurationException, IOException, SAXException;

    /**
     * read the content from pom xml.
     *
     * @param pomXmlPath the path of pom xml file
     * @return the pom content
     */
    String loadPomFile(String pomXmlPath);

    /**
     * override the content of pom xml.
     *
     * @param pomXmlPath the path of pom xml file
     * @param content text
     */
    Boolean overridePomFile(String pomXmlPath, String content);

    /**
     * delete all jars in the specifiy path.
     */
    ResultDTO<String> deleteJars(String path);
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/TelnetService.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */

package com.mmc.dubbo.doe.service;

import com.mmc.dubbo.doe.dto.ConnectDTO;
import com.mmc.dubbo.doe.dto.ResultDTO;

import javax.validation.constraints.NotNull;

/**
 * @author Joey
 * @date 2018/7/17 15:10
 */
public interface TelnetService {

    /**
     * send message with telnet client.
     * @param dto
     * @return
     */
    ResultDTO<String> send(@NotNull ConnectDTO dto);
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/impl/CaseServiceImpl.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.service.impl;

import com.alibaba.dubbo.common.Constants;
import com.alibaba.dubbo.common.utils.StringUtils;
import com.mmc.dubbo.doe.cache.MethodCaches;
import com.mmc.dubbo.doe.cache.RedisResolver;
import com.mmc.dubbo.doe.cache.UrlCaches;
import com.mmc.dubbo.doe.context.Const;
import com.mmc.dubbo.doe.dto.ResultDTO;
import com.mmc.dubbo.doe.exception.DoeException;
import com.mmc.dubbo.doe.model.CaseModel;
import com.mmc.dubbo.doe.service.CaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;

/**
 * @author Joey
 * @date 2018/6/29 15:20
 */
@Service("caseService")
public class CaseServiceImpl implements CaseService {

    @Autowired
    private RedisResolver redisResolver;

    private static final AtomicLong counter = new AtomicLong();

    /**
     * save the case.
     *
     * @param model
     * @return
     */
    @Override
    public ResultDTO<CaseModel> save(@NotNull CaseModel model) {

        if (StringUtils.isEmpty(model.getProviderKey())) {
            throw new DoeException("获取不到提供者!");
        }
        if (StringUtils.isEmpty(model.getMethodKey())) {
            throw new DoeException("获取不到方法!");
        }

        model.setAddress(UrlCaches.get(model.getProviderKey()).getUrl().getAddress());
        model.setInterfaceName(UrlCaches.get(model.getProviderKey()).getUrl().getParameter(Constants.INTERFACE_KEY ));
        model.setMethodText(MethodCaches.get(model.getMethodKey()).getMethodText());
        model.setCaseId(counter.getAndAdd(1));
        model.setInsertTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));

        redisResolver.rPush(Const.DOE_CASE_KEY, model);

        // TODO
        // save to db.

        return ResultDTO.createSuccessResult("SUCCESS", model, CaseModel.class);
    }

    /**
     * list all case.
     *
     * @return
     */
    @Override
    public List<Object> listAll() {

        List<Object> list = redisResolver.lGet(Const.DOE_CASE_KEY, 0, -1);

        if (CollectionUtils.isEmpty(list)) {

            // TODO
            // get from db and put them to cache.

        }

        return list;
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/impl/ClassServiceImpl.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.service.impl;

import com.alibaba.dubbo.common.Constants;
import com.alibaba.dubbo.common.utils.StringUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.mmc.dubbo.doe.cache.MethodCaches;
import com.mmc.dubbo.doe.cache.UrlCaches;
import com.mmc.dubbo.doe.context.Const;
import com.mmc.dubbo.doe.context.DoeClassLoader;
import com.mmc.dubbo.doe.dto.ConnectDTO;
import com.mmc.dubbo.doe.dto.MethodModelDTO;
import com.mmc.dubbo.doe.dto.ResultDTO;
import com.mmc.dubbo.doe.exception.DoeException;
import com.mmc.dubbo.doe.model.MethodModel;
import com.mmc.dubbo.doe.model.UrlModel;
import com.mmc.dubbo.doe.service.ClassService;
import com.mmc.dubbo.doe.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomUtils;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.util.ReflectionUtils;

import javax.validation.constraints.NotNull;
import java.lang.reflect.*;
import java.util.*;

/**
 * @author Joey
 * @date 2018/6/28 11:32
 */
@Service("classService")
@Slf4j
public class ClassServiceImpl implements ClassService {


    @Override
    @Cacheable(value = Const.DOE_CACHE_PREFIX, key = "#dto.serviceName")
    public List<MethodModelDTO> listMethods(ConnectDTO dto) {

        log.info("begin to invoke listMethods({})", JSON.toJSONString(dto));

        String interfaceName = dto.getServiceName();

        if (StringUtils.isEmpty(interfaceName)) {

            // get provider
            UrlModel provider = UrlCaches.get(dto.getProviderKey());
            if (null == provider) {
                throw new DoeException(StringUtil.format("can't found the provider key {}.", dto.getProviderKey()));
            }
            interfaceName = provider.getUrl().getParameter(Constants.INTERFACE_KEY);
        }

        if (StringUtils.isEmpty(interfaceName)) {
            throw new DoeException("interface name and provider cache key can't both be blank.");
        }

        try {

            // show only public method
            // Class<?> clazz = Class.forName(interfaceName);
            // load classes without affect system class since v1.2.0
            Class<?> clazz = DoeClassLoader.getClass(interfaceName);
            Method[] methods = clazz.getMethods();
            // convert and cache method object associate witch the unique key
            return MethodCaches.cache(interfaceName, methods);

        } catch (ClassNotFoundException e) {
            throw new DoeException("can't found the interface from classpath, please add the dependency first.");
        }

    }

    /**
     * generate the simple json string of the method parameters.
     *
     * @param dto
     * @return
     */
    @Override
    public ResultDTO<String> generateMethodParamsJsonString(@NotNull MethodModelDTO dto) throws ClassNotFoundException, InstantiationException, IllegalAccessException {

        Method method = null;

        // get method from cache
        if (StringUtils.isNotEmpty(dto.getMethodKey())) {
            MethodModel model = MethodCaches.get(dto.getMethodKey());
            method = (null == model) ? null : model.getMethod();
        }
        // search from classpath
        if (null == method && StringUtils.isNotEmpty(dto.getInterfaceName()) && StringUtils.isNotEmpty(dto.getMethodName())) {
            method = getMethodByName(dto.getInterfaceName(), dto.getMethodName());
        }
        if (null == method) {
            return ResultDTO.createErrorResult(
                    StringUtil.format("can't find the method[{}] in the interface[{}]",
                            dto.getInterfaceName(), dto.getMethodName()), String.class);
        }

        List<Object> objects = new ArrayList<>();
        for (Parameter param : method.getParameters()) {

            objects.add(initObject(param.getType(), param.getParameterizedType()));

        }

        String json = JSON.toJSONString(objects, SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue, SerializerFeature.WriteDateUseDateFormat);
        return ResultDTO.createSuccessResult("SUCCESS", json, String.class);
    }

    /**
     * we must to make sure we have one no parameter constructor in our class.
     *
     * @param clazz
     * @param type
     * @return
     */
    private Object initObject(Class<?> clazz, Type type) throws IllegalAccessException, InstantiationException {

        log.debug("begin to init {}", clazz.getTypeName());

        if (clazz == Integer.class || clazz == int.class) {

            return RandomUtils.nextInt(0, 1000);

        } else if (clazz == String.class) {

            String base = UUID.randomUUID().toString();
            return base.substring(RandomUtils.nextInt(1, base.length()));

        } else if (clazz == Long.class || clazz == long.class) {

            return RandomUtils.nextLong(0, 1000);

        } else if (clazz == Short.class || clazz == short.class) {

            return RandomUtils.nextInt(0, 100);

        } else if (clazz == Date.class) {

            return new Date();

        } else if (clazz == List.class) {

            if (null != type) {
                return initArrayList(type);
            }

        } else if (clazz == Map.class) {

            return new HashMap<>();

        } else if (clazz == Set.class) {

            return new HashSet<>();

        }

        Object ret;
        try {
            ret = clazz.newInstance();
        } catch (InstantiationException | IllegalAccessException e) {
            log.debug("you should define one no parameter constructor.", e);
            return new Object();
        }

        List<Field> fields = new ArrayList<>();
        ReflectionUtils.doWithFields(clazz, fields::add);
        for (Field field : fields) {

            field.setAccessible(true);
            boolean isStatic = Modifier.isStatic(field.getModifiers());
            if(isStatic) {
                continue;
            }
            try {
                field.set(ret, initObject(field.getType(), field.getGenericType()));
            } catch (Exception e) {
                log.debug("can't set value for the field, you should complete the method initObject(Class<?> clazz, Type type) later.", e);
            }
        }

        return ret;
    }

    private List<Object> initArrayList(Type genericType) throws InstantiationException, IllegalAccessException {

        List<Object> list = new ArrayList<>();

        if (genericType == null) {
            return list;
        }
        // 如果是泛型参数的类型
        if (genericType instanceof ParameterizedType) {
            ParameterizedType pt = (ParameterizedType) genericType;
            // 得到泛型里的class类型对象
            Class<?> genericClazz = (Class<?>) pt.getActualTypeArguments()[0];
            list.add(initObject(genericClazz, null)); // too deep...
        }
        return list;
    }

    /**
     * we will get wrong result if there are overload method in the interface.
     *
     * @param interfaceName
     * @param methodName
     * @return
     * @throws ClassNotFoundException
     */
    private Method getMethodByName(String interfaceName, String methodName) throws ClassNotFoundException {

        Class<?> clazz = Class.forName(interfaceName);

        for (Method method : clazz.getDeclaredMethods()) {
            if (methodName.equals(method.getName())) {
                return method;
            }
        }
        return null;
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/impl/ConfigServiceImpl.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.service.impl;

import com.alibaba.dubbo.common.utils.CollectionUtils;
import com.alibaba.dubbo.common.utils.StringUtils;
import com.alibaba.fastjson.JSON;
import com.mmc.dubbo.doe.cache.RedisResolver;
import com.mmc.dubbo.doe.context.Const;
import com.mmc.dubbo.doe.dto.ResultDTO;
import com.mmc.dubbo.doe.exception.DoeException;
import com.mmc.dubbo.doe.model.RegistryModel;
import com.mmc.dubbo.doe.service.ConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * @author Joey
 * @date 2018/7/9 19:41
 */
@Service("configService")
@Slf4j
public class ConfigServiceImpl implements ConfigService {

    @Autowired
    private RedisResolver redisResolver;

    @Value("classpath:registry.json")
    private Resource resource;

    /**
     * list all registry.
     *
     * @return
     */
    @Override
    public List<RegistryModel> listRegistry() {

        List<RegistryModel> ret = new ArrayList<>();
        Set<Object> list = redisResolver.sMembers(Const.DOE_REGISTRY_KEY);

        if (CollectionUtils.isNotEmpty(list)) {
            ret = list.stream().map(l -> {
                RegistryModel model = new RegistryModel();
                BeanUtils.copyProperties(l, model);
                return model;
            }).collect(Collectors.toList());
        }

        return ret;
    }

    /**
     * add registry.
     *
     * @param model
     * @return
     */
    @Override
    public ResultDTO<RegistryModel> addRegistry(RegistryModel model) {


        if (null == model) {
            throw new DoeException("the paramter can't be null.");
        }
        if (StringUtils.isEmpty(model.getRegistryKey())) {
            throw new DoeException("the registryKey can not be null.");
        }
        if (StringUtils.isEmpty(model.getRegistryDesc())) {
            throw new DoeException("the registryDesc can not be null.");
        }

        boolean flag = redisResolver.sAdd(Const.DOE_REGISTRY_KEY, model) > 0;
        if (flag) {
            return ResultDTO.createSuccessResult("success to add registry.", RegistryModel.class);
        } else {
            return ResultDTO.createErrorResult("fail to add registry, check whether if duplicate configuration or not.", RegistryModel.class);
        }
    }

    @Override
    public ResultDTO<RegistryModel> delRegistry(RegistryModel model) {

        if (null == model) {
            throw new DoeException("the paramter can't be null.");
        }
        if (StringUtils.isEmpty(model.getRegistryKey())) {
            throw new DoeException("the registryKey can not be null.");
        }
        if (StringUtils.isEmpty(model.getRegistryDesc())) {
            throw new DoeException("the registryDesc can not be null.");
        }

        boolean flag = redisResolver.sRem(Const.DOE_REGISTRY_KEY, model) > 0;
        if (flag) {
            return ResultDTO.createSuccessResult("success to delete registry.", RegistryModel.class);
        } else {
            return ResultDTO.createErrorResult("fail to delete registry, check whether if the configuration exists or not.", RegistryModel.class);
        }
    }

    @PostConstruct
    public void loadConfig() {

        log.info("ConfigServiceImpl.loadConfig()");

        loadZkConfigFromResource();

    }

    @Override
    public void loadZkConfigFromResource() {

        try {

            BufferedReader tBufferedReader = new BufferedReader(new InputStreamReader(resource.getInputStream()));

            StringBuilder sb = new StringBuilder();

            String sTempOneLine;

            while ((sTempOneLine = tBufferedReader.readLine()) != null) {

                sb.append(sTempOneLine);

            }

            List<RegistryModel> list = JSON.parseArray(sb.toString(), RegistryModel.class);
            redisResolver.sAdd(Const.DOE_REGISTRY_KEY,list.toArray());


        } catch (Exception e) {

            log.error("occur an error when reading zk address configuration.", e);

        }
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/impl/ConnectServiceImpl.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.service.impl;

import com.alibaba.dubbo.common.Constants;
import com.alibaba.dubbo.common.URL;
import com.alibaba.dubbo.remoting.exchange.Request;
import com.alibaba.dubbo.rpc.RpcInvocation;
import com.alibaba.dubbo.rpc.RpcResult;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.mmc.dubbo.doe.cache.CuratorCaches;
import com.mmc.dubbo.doe.cache.MethodCaches;
import com.mmc.dubbo.doe.cache.UrlCaches;
import com.mmc.dubbo.doe.client.DoeClient;
import com.mmc.dubbo.doe.context.ResponseDispatcher;
import com.mmc.dubbo.doe.dto.ConnectDTO;
import com.mmc.dubbo.doe.dto.ResultDTO;
import com.mmc.dubbo.doe.dto.UrlModelDTO;
import com.mmc.dubbo.doe.exception.DoeException;
import com.mmc.dubbo.doe.handler.CuratorHandler;
import com.mmc.dubbo.doe.model.MethodModel;
import com.mmc.dubbo.doe.model.ServiceModel;
import com.mmc.dubbo.doe.model.UrlModel;
import com.mmc.dubbo.doe.service.ConnectService;
import com.mmc.dubbo.doe.util.ParamUtil;
import com.mmc.dubbo.doe.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;

/**
 * @author Joey
 * @date 2018/6/18 17:10
 */
@Service("connectService")
@Slf4j
public class ConnectServiceImpl implements ConnectService {

    @Override
    public ResultDTO<String> send(@NotNull ConnectDTO dto) throws Exception {

        log.info("begin to send {} .", JSON.toJSONString(dto));

        // get provider url
        URL url = UrlCaches.get(dto.getProviderKey()).getUrl();
        // get method
        MethodModel methodModel = MethodCaches.get(dto.getMethodKey());
        // parse parameter
        Object[] params = ParamUtil.parseJson(dto.getJson(), methodModel.getMethod());


        url = url.addParameter(Constants.CODEC_KEY, "dubbo"); // 非常重要,必须要设置编码器协议类型
        DoeClient client = new DoeClient(url);
        client.doConnect();

        // set the path variables
        Map<String, String> map = ParamUtil.getAttachmentFromUrl(url);

        // create request.
        Request req = new Request();
        req.setVersion("2.0.0");
        req.setTwoWay(true);
        req.setData(new RpcInvocation(methodModel.getMethod(), params, map));

        client.send(req);

        int timeout = (0 == dto.getTimeout()) ? 10 : dto.getTimeout(); // send timeout
        CompletableFuture<RpcResult> future = ResponseDispatcher.getDispatcher().getFuture(req);
        RpcResult result = future.get(timeout, TimeUnit.SECONDS);
        ResponseDispatcher.getDispatcher().removeFuture(req);

        return ResultDTO.createSuccessResult("SUCCESS",
                JSON.toJSONString(result.getValue(), SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue, SerializerFeature.WriteDateUseDateFormat),
                String.class);
    }

    @Override
    public List<UrlModelDTO> listProviders(@NotNull ConnectDTO connect) throws NoSuchFieldException, IllegalAccessException {

        // get client
        CuratorHandler client = CuratorCaches.getHandler(connect.getConn());

        if (null == client) {
            throw new DoeException("the cache is validate, please reconnect to zk againt.");
        }

        List<UrlModel> providers = client.getProviders(connect);

        // throw fast json error if you don't convert simple pojo
        // I have no idea why the UrlModel object will throw stack over flow exception.
        List<UrlModelDTO> ret = new ArrayList<>();
        providers.forEach(p -> {
            UrlModelDTO m = new UrlModelDTO();
            m.setKey(p.getKey());
            m.setHost(p.getUrl().getHost());
            m.setPort(p.getUrl().getPort());

            ret.add(m);
        });

        return ret;

    }

    /**
     * connect to zk and get all providers.
     *
     * @param conn
     * @return
     */
    @Override
    public List<ServiceModel> connect(@NotNull String conn) throws NoSuchFieldException, IllegalAccessException {

        // get client
        CuratorHandler client = CuratorCaches.getHandler(conn);

        if (!client.isAvailable()) {
            throw new DoeException(StringUtil.format("can't connect to {}", conn));
        }

        // get providers
        List<ServiceModel> list = client.getInterfaces();


        return list;
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/impl/MenuServiceImpl.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.service.impl;

import com.mmc.dubbo.doe.auth.MenuNode;
import com.mmc.dubbo.doe.auth.MenuTree;
import com.mmc.dubbo.doe.service.MenuService;
import com.mmc.dubbo.doe.util.JsonFileUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import javax.annotation.PostConstruct;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.MessageFormat;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author Joey
 * @date 2018/11/26 16:21
 */
@Service("menuService")
@Slf4j
public class MenuServiceImpl implements MenuService {

    /**
     * 用户静态资源文件路径.
     */
    private static final String STATIC_MENU_PATH = "templates/pages/v3/";

    @Value("classpath:menu.json")
    private Resource resource;

    /**
     * cache urls.
     */
    private Map<Integer, String> cacheMap;
    /**
     * the html text.
     */
    private String html;

    @Override
    public String getHtml() {
        return html;
    }

    @Override
    public String getUrl(Integer mid) {

        return cacheMap.get(mid);
    }

    private void cacheMenu(List<MenuNode> tree) {

        if (CollectionUtils.isEmpty(tree)) {
            return;
        }
        cacheMap = tree.stream().collect(Collectors.toMap(MenuNode::getMenuId, MenuTree::getMenuUrl));
    }

    /**
     * 真正生成文件方法.
     */
    @PostConstruct
    private void createFile() throws IOException {

        List<MenuNode> tree = JsonFileUtil.readList(resource.getInputStream(), MenuNode.class);
        MenuNode root = null;

        cacheMenu(tree);

        try {
            root = buildTree(tree, -1);
        } catch (Exception e) {
            log.error("fail to build the menu tree:", e);
            return;
        }
        String html = toHtml("", root);
        String projectRealPath = getProjectRealPath();
        try {
            createFile(projectRealPath, html);
        } catch (Exception e) {
            log.error("fail to create the menu file:", e);
        }
    }



    private String getProjectRealPath() throws FileNotFoundException {

        // useless when you run doe in the jar way, so comment these code.
//        String path = ResourceUtils.getURL("classpath:").getPath();
        String path = "/app/doe/";
        path = path + STATIC_MENU_PATH;
        return path;
    }

    private void createFile(String projectRealPath, String html) throws Exception {

        // 创建目录
        File path = new File(projectRealPath);
        if (!path.exists()) {
            path.mkdirs();
        }

        // 删除旧文件
        File file = new File(path, "menu.html");
        if (file.exists()) {
            file.delete();
        }

        // 写入权限菜单
        PrintWriter out = new PrintWriter(file);
        String content = ""
//                + "<div th:fragment=\"lefter\" xmlns:th=\"http://www.thymeleaf.org\">"
                + "\n<div class=\"sidebar\" id=\"sidebar\" >                                                                                        \n"
                + "\n    <script type=\"text/javascript\">                                                                                         \n"
                + "\n        try{ace.settings.check('sidebar' , 'fixed')}catch(e){}                                                                \n"
                + "\n    </script>                                                                                                                 \n"
                + "\n    <div id=\"NoraMenuTree\">                                                                                                 \n"
                + html
                + "\n    </div>                                                                                                                    \n"
                + "\n                                                                                                                              \n"
                + "\n    <div class=\"sidebar-collapse\" id=\"sidebar-collapse\">                                                                  \n"
                + "\n        <i class=\"icon-double-angle-left\" data-icon1=\"icon-double-angle-left\" data-icon2=\"icon-double-angle-right\"></i> \n"
                + "\n    </div>                                                                                                                    \n"
                + "\n                                                                                                                              \n"
                + "\n    <script type=\"text/javascript\">                                                                                         \n"
                + "\n        try{ace.settings.check('sidebar' , 'collapsed')}catch(e){}                                                            \n"
                + "\n    </script>                                                                                                                 \n"
//                + "\n</div>"
                + "</div>";

        this.html = content;
        out.append(content);
        out.flush();
        out.close();

    }

    private MenuNode buildTree(List<MenuNode> menuList, int pMenuId) {
        MenuNode result = new MenuNode();
        MenuNode temp = new MenuNode();
        for (int i = 0; i < menuList.size(); i++) {
            if (menuList.get(i).getPmenuId() == pMenuId) {
                result.getChildren().add(menuList.get(i));
                temp = buildTree(menuList, menuList.get(i).getMenuId());
                if (temp.getChildren().size() > 0) {
                    menuList.get(i).setChildren(temp.getChildren());
                }
            }
        }
        return result;
    }

    private String toHtml(String elementId, MenuNode root) {

        StringBuilder sb = new StringBuilder();
        boolean useCache = true; // 判断是否使用缓存

        for (MenuNode item : root.getChildren()) {

            if (null != item && item.getChildren().size() > 0) {
                if (item.getPmenuId() == -1) {
                    String html = "\n<ul id=\"{0}\" class=\"nav nav-list\">\n";
                    html = MessageFormat.format(html, item.getMenuId().toString());
                    sb.append(html);
                    sb.append(toHtml(null, item));
                    sb.append("</ul>");
                } else {

                    String html = "\n"
                            + "<li id=\"f{0}\" class=\"nr-pmenu\">                 \n"
                            + "    <a href=\"#\" class=\"dropdown-toggle\">    \n"
                            + "    <i class=\"{1}\"></i>                       \n"
                            + "    <span class=\"menu-text\"> {2} </span>      \n"
                            + "    <b class=\"arrow icon-angle-down\"></b>     \n"
                            + "    </a>                                        \n"
                            + "    <ul id=\"{0}\" class=\"submenu\">           \n"
                            + "\n";
                    html = MessageFormat.format(html, item.getMenuId().toString(), item.getMenuStyle(), item.getMenuName());

                    sb.append(html);
                    sb.append(toHtml(null, item));
                    sb.append("</ul></li>");
                }
            } else {
                String html = "\n"
                        + "<li id=\"f{0}\">        \n"
                        + "<a href=\"{4}?mid=f{0}\" data-url=\"{1}\">        \n"
                        + "<i class=\"{2}\"></i>   \n"
                        + "{3}                     \n"
                        + "</a>                    \n"
                        + "</li>                   \n"
                        + "\n";
                if (useCache) {
                    html = MessageFormat.format(html, item.getMenuId().toString(), item.getMenuUrl(), item.getMenuStyle(), item.getMenuName(), "main");
                } else {
                    html = MessageFormat.format(html, item.getMenuId().toString(), item.getMenuUrl(), item.getMenuStyle(), item.getMenuName(), item.getMenuUrl());
                }
                sb.append(html);
            }
        }

        return sb.toString();
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/impl/PomServiceImpl.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.service.impl;

import com.alibaba.dubbo.common.utils.StringUtils;
import com.alibaba.fastjson.JSON;
import com.mmc.dubbo.doe.cache.RedisResolver;
import com.mmc.dubbo.doe.client.ProcessClient;
import com.mmc.dubbo.doe.context.Const;
import com.mmc.dubbo.doe.context.DoeClassLoader;
import com.mmc.dubbo.doe.context.TaskContainer;
import com.mmc.dubbo.doe.dto.PomDTO;
import com.mmc.dubbo.doe.dto.ResultDTO;
import com.mmc.dubbo.doe.exception.DoeException;
import com.mmc.dubbo.doe.model.PomModel;
import com.mmc.dubbo.doe.service.PomService;
import com.mmc.dubbo.doe.util.DOMUtil;
import com.mmc.dubbo.doe.util.FileUtil;
import com.mmc.dubbo.doe.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.tomcat.util.http.fileupload.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

import javax.validation.constraints.NotNull;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import java.io.*;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Collectors;

/**
 * dependency service.
 *
 * @author Joey
 * @date 2018/6/17 9:42
 */
@Service("pomService")
@Slf4j
public class PomServiceImpl implements PomService {

    private Lock locker = new ReentrantLock();

    @Value("${doe.dependency.pom}")
    private String pomXml;

    @Value("${doe.dependency.lib}")
    private String libPath = null;

    @Autowired
    private RedisResolver redisResolver;

    @Override
    public ResultDTO<PomDTO> invoke() {

        PomDTO dto = new PomDTO();
        ProcessClient processClient = new ProcessClient(dto, redisResolver, pomXml, libPath);

        // just can only invoke one task to downloaded the jars.
        // we can invoke more task after we have finished all code actually.
        if (processClient.isRunning()) {
            return ResultDTO.createErrorResult("some task was already running at background, please try again for a few minutes later.", PomDTO.class);
        }

        try {

            locker.lock();

            // clear old directory
            deleteJars(libPath);

            // download jars asynchronously
            log.info("fork another thread to download jars.");
            TaskContainer.getTaskContainer().execute(processClient);
            log.info("success fork another thread to download jars.");

        } catch (Exception e) {
            throw e;
        } finally {
            locker.unlock();
        }

        // return the success signal and redirect another url to get real time information.
        return ResultDTO.createSuccessResult("the download task is running at background, please wait...", dto, PomDTO.class);
    }

    @Override
    public ResultDTO<PomDTO> invoke(@NotNull PomDTO dto) throws Exception {

        ProcessClient processClient = new ProcessClient(dto, redisResolver, pomXml, libPath);

        // just can only invoke one task to downloaded the jars.
        // we can invoke more task after we have finished all code actually.
        if (processClient.isRunning()) {
            return ResultDTO.createErrorResult("some task was already running at background, please try again for a few minutes later.", PomDTO.class);
        }

        // parse the pom
        log.info("begin to parse the pom.");
        List<PomModel> models = parsePom(dto.getPom());

        // check the model is good or not
        checkModels(models);

        // check maven configuration
        checkMaven(models);

        try {

            locker.lock();

            // append the parse content to the end of real pom.xml.
            log.info("begin to append the parse content to the end of {}.", pomXml);
            appendPom(models, pomXml);

            // download jars asynchronously
            log.info("fork another thread to download jars.");
            TaskContainer.getTaskContainer().execute(processClient);
            log.info("success fork another thread to download jars.");

        } catch (Exception e) {
            throw e;
        } finally {
            locker.unlock();
        }

        // return the success signal and redirect another url to get real time information.
        return ResultDTO.createSuccessResult("the download task is running at background, please wait...", dto, PomDTO.class);
    }

    // the mvn environment variable must be set.
    private void checkMaven(List<PomModel> models) {

    }

    @Override
    public void appendPom(List<PomModel> models, @NotNull String pomXml) throws Exception {

        File file = new File(pomXml);

        // 1.得到DOM解析器的工厂实例
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        // 2.从DOM工厂里获取DOM解析器
        DocumentBuilder db = dbf.newDocumentBuilder();
        // 3.解析XML文档,得到document,即DOM树
        Document doc = db.parse(file);
        // root
        Element rootDependency = (Element) doc.getElementsByTagName("dependencies").item(0);

        for (PomModel model : models) {

            // 创建节点
            Element dependencyElement = doc.createElement("dependency");
            // 创建group节点
            Element groupElement = doc.createElement("groupId");
            groupElement.appendChild(doc.createTextNode(model.getGroupId()));
            // 创建artifactId节点
            Element artifactIdElement = doc.createElement("artifactId");
            artifactIdElement.appendChild(doc.createTextNode(model.getArtifactId()));
            // 创建version节点
            Element versionElement = doc.createElement("version");
            versionElement.appendChild(doc.createTextNode(model.getVersion()));
            // 添加父子关系
            dependencyElement.appendChild(groupElement);
            dependencyElement.appendChild(artifactIdElement);
            dependencyElement.appendChild(versionElement);
            // 追加节点
            rootDependency.appendChild(dependencyElement);
        }
        // 保存xml文件
        TransformerFactory transformerFactory = TransformerFactory.newInstance();
        Transformer transformer = transformerFactory.newTransformer();
        // 格式化
        transformer.setOutputProperty(OutputKeys.INDENT, "yes");
        transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
        // 设置编码类型
        transformer.setOutputProperty(OutputKeys.ENCODING, "GB2312");
        DOMSource domSource = new DOMSource(doc);
        StreamResult result = new StreamResult(new FileOutputStream(file));
        // 把DOM树转换为xml文件
        transformer.transform(domSource, result);
    }

    private void checkModels(List<PomModel> models) {

        if (CollectionUtils.isEmpty(models)) {
            throw new DoeException("Can't parse any dependency, please check your pom before you execute the do parse request.");
        }
        models.forEach(m -> {
            if (m.isBroken()) {
                throw new DoeException(StringUtil.format("The content of pom is Incomplete.[{}]", JSON.toJSONString(m)));
            }
        });

    }

    @Override
    public List<PomModel> parsePom(@NotNull String xml) throws IOException, SAXException {

        List<PomModel> models = new ArrayList<>();

        xml = "<root>" + xml + "</root>";

        Document document = DOMUtil.parse(xml);
        Node root = document.getElementsByTagName("root").item(0);

        for (int i = 0; i < root.getChildNodes().getLength(); i++) {
            Node dependencyNode = root.getChildNodes().item(i);
            String nodeName = dependencyNode.getNodeName();

            if ("dependency".equals(nodeName)) {

                PomModel model = new PomModel();
                for (int j = 0; j < dependencyNode.getChildNodes().getLength(); j++) {
                    Node childNode = dependencyNode.getChildNodes().item(j);
                    if (childNode.getNodeType() == Node.ELEMENT_NODE) {

                        Element element = (Element) childNode;

                        if ("groupId".equals(element.getNodeName())) {
                            model.setGroupId(element.getFirstChild().getNodeValue());
                        } else if ("artifactId".equals(element.getNodeName())) {
                            model.setArtifactId(element.getFirstChild().getNodeValue());
                        } else if ("version".equals(element.getNodeName())) {
                            model.setVersion(element.getFirstChild().getNodeValue());
                        }
                    }
                }
                models.add(model);
            }
        }
        return models;
    }

    @Override
    public ResultDTO<String> getRealTimeMsg(@NotNull String requestId) {

        String key = StringUtil.format(Const.DOE_DOWNLOAD_JAR_MESSAGE, requestId);

        ResultDTO<String> ret = ResultDTO.createSuccessResult("SUCCESS", String.class);

        boolean isRunning = redisResolver.hasKey(Const.DOE_DOWNLOAD_JAR_TASK);

        if (!isRunning) {

            // if the task was done, get all message prevent the task running too fast.
            List<Object> list = redisResolver.lGet(key, 0, -1);
            String data = list.stream().map(l -> l.toString()).collect(Collectors.joining("\r\n"));

            ret.setMsg("download completed!");
            ret.setData(data);
            ret.setCode(Const.COMPLETE_FLAG);

        } else {

            // loop time of queue length
            long size = redisResolver.lGetListSize(key);
            StringBuilder sb = new StringBuilder();
            while (--size > 0) {
                String value = (String) redisResolver.lPop(key);
                sb.append("\r\n");
                sb.append(value);
            }

            ret.setData(sb.toString());
            ret.setCode(Const.RUNNING_FlAG); // tell the jquery continue to ask message.
        }

        return ret;
    }

    @Override
    public ResultDTO<String> loadJars(String path) {

        String realPath = (StringUtils.isEmpty(path)) ? this.libPath : path;
        DoeClassLoader classLoader = new DoeClassLoader(realPath);
        try {
            classLoader.clearCache();
            classLoader.loadJars();
            return ResultDTO.createSuccessResult("load jars completely and successfully", String.class);
        } catch (Exception e) {
            return ResultDTO.handleException("occur an error when load jars", null, e);
        }

    }

    @Deprecated // since v1.1.0
    public ResultDTO<String> loadJars$$(String path) throws NoSuchMethodException, MalformedURLException {

        String fullLibPath = StringUtils.isEmpty(path) ? this.libPath : path;

        if (StringUtils.isEmpty(fullLibPath)) {
            return ResultDTO.createErrorResult(StringUtil.format("can't found the path {}", fullLibPath), String.class);
        }

        if (!new File(fullLibPath).exists()) {
            throw new DoeException(StringUtil.format("the path[{}] is not exists.", fullLibPath));
        }

        log.info("begin to load jars from {}.", fullLibPath);

        // check for changes prevent to do useless job.
        checkForChanges();

        // 系统类库路径
        File libPath = new File(fullLibPath);

        // 获取所有的.jar和.zip文件
        File[] jarFiles = libPath.listFiles((dir, name) -> name.endsWith(".jar") || name.endsWith(".zip"));

        if (jarFiles != null) {
            // 从URLClassLoader类中获取类所在文件夹的方法
            // 对于jar文件,可以理解为一个存放class文件的文件夹
            Method method = URLClassLoader.class.getDeclaredMethod("addURL", URL.class);
            boolean accessible = method.isAccessible();     // 获取方法的访问权限
            try {
                if (!accessible) {
                    method.setAccessible(true);     // 设置方法的访问权限
                }
                // 获取系统类加载器
                URLClassLoader classLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
                for (File file : jarFiles) {
                    URL url = file.toURI().toURL();
                    try {
                        method.invoke(classLoader, url);
                        log.debug("读取jar文件[name={}]", file.getName());
                    } catch (Exception e) {
                        log.error("读取jar文件[name={}]失败", file.getName());
                    }
                }
                return ResultDTO.createSuccessResult("load jars completely and successfully", String.class);

            } finally {
                method.setAccessible(accessible);
            }
        } else {
            return ResultDTO.createErrorResult(StringUtil.format("Can't found any jars from {}.", fullLibPath), String.class);
        }

    }

    /**
     * list all dependency.
     *
     * @param dto
     * @return
     */
    @Override
    public List<PomModel> listJars(PomDTO dto) throws ParserConfigurationException, IOException, SAXException {

        List<PomModel> result = new ArrayList<>();

        String pomPath = (StringUtils.isEmpty(dto.getPath())) ? pomXml : dto.getPath();
        File file = new File(pomPath);

        // 1.得到DOM解析器的工厂实例
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        // 2.从DOM工厂里获取DOM解析器
        DocumentBuilder db = dbf.newDocumentBuilder();
        // 3.解析XML文档,得到document,即DOM树
        Document doc = db.parse(file);
        // list
        NodeList list = doc.getElementsByTagName("dependency");

        for (int i = 0; i < list.getLength(); i++) {

            Node node = list.item(i);
            if (node.getNodeType() == Node.ELEMENT_NODE) {

                Element element = (Element) node;
                PomModel model = new PomModel();
                model.setGroupId(element.getElementsByTagName("groupId").item(0).getTextContent());
                model.setArtifactId(element.getElementsByTagName("artifactId").item(0).getTextContent());
                model.setVersion(element.getElementsByTagName("version").item(0).getTextContent());

                result.add(model);
            }
        }

        return result;
    }

    private void checkForChanges() {

        // TODO
        // check if any changes
    }

    @Override
    public String loadPomFile(String pomXmlPath) {

        String pomPath = StringUtils.isEmpty(pomXmlPath) ? pomXml : pomXmlPath;
        return FileUtil.readToString(pomPath);

    }

    @Override
    public Boolean overridePomFile(String pomXmlPath, String content) {

        String pomPath = StringUtils.isEmpty(pomXmlPath) ? pomXml : pomXmlPath;

        FileUtil.WriteStringToFile(pomPath, content);

        return true;

    }

    @Override
    public ResultDTO<String> deleteJars(String path) {

        String realPath = (StringUtils.isEmpty(path)) ? this.libPath : path;

        if (StringUtils.isEmpty(realPath)) {
            throw new DoeException(StringUtil.format("can't found the path {}", path));
        }

        File libPath = new File(realPath);
        if (!libPath.exists()) {
            throw new DoeException(StringUtil.format("the path[{}] is not exists.", path));
        }

        File[] jarFiles = libPath.listFiles((dir, name) -> name.endsWith(".jar") || name.endsWith(".zip"));

        if (jarFiles != null) {
            for (File file : jarFiles) {
                log.info("begin to delete file {}.", file.getAbsolutePath());
                boolean ret = file.delete();
                if (!ret) {
                    try {
                        log.info("begin to force to delete file {}.", file.getAbsolutePath());
                        FileUtils.forceDelete(file);
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }
        }
        return ResultDTO.handleSuccess("delete sucess!", path);
    }


}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/impl/TelnetServiceImpl.java
================================================
/*
 * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of
 * Founder. You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the agreements
 * you entered into with Founder.
 *
 */
package com.mmc.dubbo.doe.service.impl;

import com.alibaba.dubbo.common.utils.StringUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.mmc.dubbo.doe.dto.ConnectDTO;
import com.mmc.dubbo.doe.dto.ResultDTO;
import com.mmc.dubbo.doe.model.PointModel;
import com.mmc.dubbo.doe.service.TelnetService;
import com.mmc.dubbo.doe.util.ParamUtil;
import com.mmc.dubbo.doe.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.net.telnet.TelnetClient;
import org.springframework.stereotype.Service;

import javax.validation.constraints.NotNull;
import java.io.BufferedInputStream;
import java.io.InputStream;
import java.io.PrintStream;

/**
 * @author Joey
 * @date 2018/7/17 19:43
 */
@Slf4j
@Service("telnetService")
public class TelnetServiceImpl implements TelnetService {

    /**
     * send message with telnet client.
     *
     * @param dto
     * @return
     */
    @Override
    public ResultDTO<String> send(@NotNull ConnectDTO dto) {

        PointModel model = ParamUtil.parsePointModel(dto.getConn());

        TelnetClient telnetClient = null;
        try {
            telnetClient = new TelnetClient("VT220");  // 指明Telnet终端类型,否则会返回来的数据中文会乱码
            telnetClient.setDefaultTimeout(dto.getTimeout() <= 0 ? 5000 : dto.getTimeout()); // socket延迟时间:5000ms
            telnetClient.connect(model.getIp(), model.getPort());  // 建立一个连接,默认端口是23
            InputStream in = telnetClient.getInputStream(); // 读取命令的流
            PrintStream out = new PrintStream(telnetClient.getOutputStream());  // 写命令的流

            String command = makeCommand(dto.getServiceName(), dto.getMethodName(), dto.getJson());
            log.info("send: {}", command);

            out.println("\r\n");
            out.println(command);
            out.println("\r\n");
            out.flush();

            // handle inputStream
            StringBuilder sb = new StringBuilder();
            BufferedInputStream bi = new BufferedInputStream(in);

            while (true) {
                byte[] buffer = new byte[1024];
                int len = bi.read(buffer);
                if (len <= -1) {
                    break;
                }

                String msg = new String(buffer, 0, len, "GBK");
                sb.append(msg);
                if (msg.endsWith("dubbo>")) {
                    break;
                }
            }

            out.println("exit"); // 写命令
            out.flush(); // 将命令发送到telnet Server
            telnetClient.disconnect();

            String ret = sb.toString();
            String lineSeparator = System.getProperty("line.separator", "\n");
            if (StringUtils.isNotEmpty(ret)) {
                ret = ret.split(lineSeparator)[0];
            }
            log.info("receive: {}", ret);

            // format the json string
            String result = JSON.toJSONString(JSON.parse(ret), SerializerFeature.PrettyFormat, SerializerFeature.WriteMapNullValue, SerializerFeature.WriteDateUseDateFormat);
            return ResultDTO.createSuccessResult("SUCCESS", result, String.class);

        } catch (Exception e) {

            log.error("occur an error when sending message with telnet client.", e);
            return ResultDTO.createExceptionResult(e, String.class);

        } finally {
            try {
                if (null != telnetClient) {
                    telnetClient.disconnect();
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    private String makeCommand(String serviceName, String methodName, String json) {

        return StringUtil.format("invoke {}.{}({})", serviceName, methodName, json);
    }
}


================================================
FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/util/DOMUtil.java
================================================
package com.mmc.dubbo.doe.util;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
import java.util.Vector;

import javax.naming.ConfigurationException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSour
Download .txt
gitextract_eeqj_19b/

├── .gitattributes
├── .gitignore
├── README.md
├── UPGRADE.md
├── deploy/
│   ├── SimpleHttpServer.py
│   ├── deploy.sh
│   ├── pom.xml
│   └── pom.xml.backup
├── mmc-dubbo-api/
│   ├── .gitignore
│   ├── pom.xml
│   └── src/
│       └── main/
│           └── java/
│               └── com/
│                   └── mmc/
│                       └── dubbo/
│                           └── api/
│                               └── user/
│                                   ├── GenericReq.java
│                                   ├── GenericResp.java
│                                   ├── UserFact.java
│                                   └── UserService.java
├── mmc-dubbo-doe/
│   ├── .gitignore
│   ├── pom.xml
│   └── src/
│       ├── main/
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── mmc/
│       │   │           └── dubbo/
│       │   │               └── doe/
│       │   │                   ├── DubboDoeApplication.java
│       │   │                   ├── auth/
│       │   │                   │   ├── MenuNode.java
│       │   │                   │   └── MenuTree.java
│       │   │                   ├── cache/
│       │   │                   │   ├── CuratorCaches.java
│       │   │                   │   ├── DoeRedisResolver.java
│       │   │                   │   ├── MethodCaches.java
│       │   │                   │   ├── RedisConfiguration.java
│       │   │                   │   ├── RedisResolver.java
│       │   │                   │   └── UrlCaches.java
│       │   │                   ├── channel/
│       │   │                   │   └── NettyChannel.java
│       │   │                   ├── client/
│       │   │                   │   ├── DoeClient.java
│       │   │                   │   ├── ProcessClient.java
│       │   │                   │   └── TransportClient.java
│       │   │                   ├── context/
│       │   │                   │   ├── ApplicationReadyEventListener.java
│       │   │                   │   ├── Const.java
│       │   │                   │   ├── DoeClassLoader.java
│       │   │                   │   ├── ResponseDispatcher.java
│       │   │                   │   └── TaskContainer.java
│       │   │                   ├── crontroller/
│       │   │                   │   ├── CaseController.java
│       │   │                   │   ├── DubboController.java
│       │   │                   │   ├── HomeController.java
│       │   │                   │   ├── PomController.java
│       │   │                   │   ├── RegistryController.java
│       │   │                   │   └── SysConfController.java
│       │   │                   ├── dao/
│       │   │                   │   └── CaseDAO.java
│       │   │                   ├── dto/
│       │   │                   │   ├── BaseDTO.java
│       │   │                   │   ├── CaseModelDTO.java
│       │   │                   │   ├── ConnectDTO.java
│       │   │                   │   ├── MethodModelDTO.java
│       │   │                   │   ├── PomDTO.java
│       │   │                   │   ├── ResultDTO.java
│       │   │                   │   └── UrlModelDTO.java
│       │   │                   ├── exception/
│       │   │                   │   └── DoeException.java
│       │   │                   ├── handler/
│       │   │                   │   ├── CuratorHandler.java
│       │   │                   │   ├── SendReceiveHandler.java
│       │   │                   │   └── StreamHandler.java
│       │   │                   ├── model/
│       │   │                   │   ├── CaseModel.java
│       │   │                   │   ├── MethodModel.java
│       │   │                   │   ├── PointModel.java
│       │   │                   │   ├── PomModel.java
│       │   │                   │   ├── RegistryModel.java
│       │   │                   │   ├── ServiceModel.java
│       │   │                   │   └── UrlModel.java
│       │   │                   ├── service/
│       │   │                   │   ├── CaseService.java
│       │   │                   │   ├── ClassService.java
│       │   │                   │   ├── ConfigService.java
│       │   │                   │   ├── ConnectService.java
│       │   │                   │   ├── MenuService.java
│       │   │                   │   ├── PomService.java
│       │   │                   │   ├── TelnetService.java
│       │   │                   │   └── impl/
│       │   │                   │       ├── CaseServiceImpl.java
│       │   │                   │       ├── ClassServiceImpl.java
│       │   │                   │       ├── ConfigServiceImpl.java
│       │   │                   │       ├── ConnectServiceImpl.java
│       │   │                   │       ├── MenuServiceImpl.java
│       │   │                   │       ├── PomServiceImpl.java
│       │   │                   │       └── TelnetServiceImpl.java
│       │   │                   └── util/
│       │   │                       ├── DOMUtil.java
│       │   │                       ├── FileUtil.java
│       │   │                       ├── JsonFileUtil.java
│       │   │                       ├── MD5Util.java
│       │   │                       ├── ParamUtil.java
│       │   │                       └── StringUtil.java
│       │   └── resources/
│       │       ├── application-dev.yml
│       │       ├── application-prd.yml
│       │       ├── application.yml
│       │       ├── logback-spring.xml
│       │       ├── menu.json
│       │       ├── registry.json
│       │       ├── static/
│       │       │   └── v3/
│       │       │       ├── assets/
│       │       │       │   ├── css/
│       │       │       │   │   ├── bootstrap-editable.css
│       │       │       │   │   ├── bootstrap-timepicker.css
│       │       │       │   │   ├── chosen.css
│       │       │       │   │   ├── colorbox.css
│       │       │       │   │   ├── colorpicker.css
│       │       │       │   │   ├── datepicker.css
│       │       │       │   │   ├── daterangepicker.css
│       │       │       │   │   ├── dropzone.css
│       │       │       │   │   ├── fullcalendar.css
│       │       │       │   │   ├── jquery.gritter.css
│       │       │       │   │   ├── multiple-select.css
│       │       │       │   │   ├── select2.css
│       │       │       │   │   └── ui.jqgrid.css
│       │       │       │   ├── font/
│       │       │       │   │   └── fonts.googleapis.com.css
│       │       │       │   └── js/
│       │       │       │       ├── fuelux/
│       │       │       │       │   └── data/
│       │       │       │       │       └── fuelux.tree-sampledata.js
│       │       │       │       ├── html5shiv.js
│       │       │       │       ├── jqGrid/
│       │       │       │       │   ├── i18n/
│       │       │       │       │   │   └── grid.locale-en.js
│       │       │       │       │   └── jquery.jqGrid.src.js
│       │       │       │       ├── jquery.colorbox-min.js
│       │       │       │       ├── jquery.dataTables.bootstrap.js
│       │       │       │       ├── jquery.form.js
│       │       │       │       └── multiple-select.js
│       │       │       └── js/
│       │       │           ├── JGridUtils.js
│       │       │           ├── Nora.js
│       │       │           ├── core.js
│       │       │           ├── echartUtils.js
│       │       │           ├── jquery.jsonEdit.js
│       │       │           └── pom.js
│       │       └── templates/
│       │           ├── index.html
│       │           └── pages/
│       │               ├── tpl/
│       │               │   ├── bread.html
│       │               │   ├── foot.html
│       │               │   ├── head.html
│       │               │   ├── left.html
│       │               │   └── top.html
│       │               └── v3/
│       │                   ├── addJar.html
│       │                   ├── caseCnt.html
│       │                   ├── easyCnt.html
│       │                   ├── editPom.html
│       │                   ├── listJar.html
│       │                   ├── listZk.html
│       │                   ├── normalCnt.html
│       │                   └── sys.html
│       └── test/
│           ├── java/
│           │   └── com/
│           │       └── mmc/
│           │           └── dubbo/
│           │               └── doe/
│           │                   ├── DubboDoeApplicationTests.java
│           │                   └── test/
│           │                       ├── TestCaseService.java
│           │                       ├── TestClassService.java
│           │                       ├── TestConfigService.java
│           │                       ├── TestConnectService.java
│           │                       ├── TestCuratorHandler.java
│           │                       ├── TestDemo.java
│           │                       ├── TestDoeClassLoader.java
│           │                       ├── TestDoeClient.java
│           │                       ├── TestFuture.java
│           │                       ├── TestLogback.java
│           │                       ├── TestNumber.java
│           │                       ├── TestParam.java
│           │                       ├── TestPomService.java
│           │                       ├── TestProcessClient.java
│           │                       ├── TestRedisResolver.java
│           │                       ├── TestRedisTemplate.java
│           │                       ├── TestTelnetService.java
│           │                       └── TestTime.java
│           └── resources/
│               ├── logback-spring.xml
│               └── test-pom.xml
└── mmc-dubbo-provider/
    ├── .gitignore
    ├── pom.xml
    └── src/
        └── main/
            ├── java/
            │   └── com/
            │       └── mmc/
            │           └── dubbo/
            │               └── provider/
            │                   ├── DubboProviderApplication.java
            │                   └── user/
            │                       ├── UserFeedbackServiceImpl.java
            │                       └── UserMemberServiceImpl.java
            └── resources/
                └── application.yml
Download .txt
SYMBOL INDEX (566 symbols across 97 files)

FILE: deploy/SimpleHttpServer.py
  class SimpleHttpServerHandler (line 27) | class SimpleHttpServerHandler(BaseHTTPRequestHandler):
    method log (line 29) | def log(self, msg):
    method do_GET (line 34) | def do_GET(self):
  function run (line 76) | def run():

FILE: mmc-dubbo-api/src/main/java/com/mmc/dubbo/api/user/GenericReq.java
  class GenericReq (line 18) | public class GenericReq<T> implements Serializable {
    method getName (line 25) | public String getName() {
    method setName (line 29) | public void setName(String name) {
    method getData (line 33) | public T getData() {
    method setData (line 37) | public void setData(T data) {

FILE: mmc-dubbo-api/src/main/java/com/mmc/dubbo/api/user/GenericResp.java
  class GenericResp (line 18) | public class GenericResp<T> implements Serializable {
    method getData (line 24) | public T getData() {
    method setData (line 28) | public void setData(T data) {
    method getName (line 32) | public String getName() {
    method setName (line 36) | public void setName(String name) {

FILE: mmc-dubbo-api/src/main/java/com/mmc/dubbo/api/user/UserFact.java
  class UserFact (line 18) | public class UserFact implements Serializable {
    method getId (line 26) | public long getId() {
    method setId (line 30) | public void setId(long id) {
    method getName (line 34) | public String getName() {
    method setName (line 38) | public void setName(String name) {
    method getSex (line 42) | public int getSex() {
    method setSex (line 46) | public void setSex(int sex) {
    method getHeight (line 50) | public int getHeight() {
    method setHeight (line 54) | public void setHeight(int height) {

FILE: mmc-dubbo-api/src/main/java/com/mmc/dubbo/api/user/UserService.java
  type UserService (line 17) | public interface UserService {
    method getCurrentById (line 24) | UserFact getCurrentById(long id);
    method insert (line 33) | UserFact insert(UserFact u, String name, int sex);
    method echo (line 40) | GenericResp<UserFact> echo(GenericReq<UserFact> user);

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/DubboDoeApplication.java
  class DubboDoeApplication (line 7) | @SpringBootApplication
    method main (line 10) | public static void main(String[] args) {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/auth/MenuNode.java
  class MenuNode (line 23) | public class MenuNode extends MenuTree{
    method getChildren (line 32) | public List<MenuNode> getChildren() {
    method setChildren (line 36) | public void setChildren(List<MenuNode> children) {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/auth/MenuTree.java
  class MenuTree (line 22) | public class MenuTree implements Serializable{
    method getuId (line 40) | public Integer getuId() {
    method setuId (line 43) | public void setuId(Integer uId) {
    method getMenuId (line 46) | public Integer getMenuId() {
    method setMenuId (line 49) | public void setMenuId(Integer menuId) {
    method getPmenuId (line 52) | public Integer getPmenuId() {
    method setPmenuId (line 55) | public void setPmenuId(Integer pmenuId) {
    method getMenuName (line 58) | public String getMenuName() {
    method setMenuName (line 61) | public void setMenuName(String menuName) {
    method getMenuUrl (line 64) | public String getMenuUrl() {
    method setMenuUrl (line 67) | public void setMenuUrl(String menuUrl) {
    method getMenuStyle (line 70) | public String getMenuStyle() {
    method setMenuStyle (line 73) | public void setMenuStyle(String menuStyle) {
    method getMlevel (line 76) | public Integer getMlevel() {
    method setMlevel (line 79) | public void setMlevel(Integer mlevel) {
    method getMleft (line 82) | public Integer getMleft() {
    method setMleft (line 85) | public void setMleft(Integer mleft) {
    method getMright (line 88) | public Integer getMright() {
    method setMright (line 91) | public void setMright(Integer mright) {
    method getRoleId (line 94) | public Integer getRoleId() {
    method setRoleId (line 97) | public void setRoleId(Integer roleId) {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/cache/CuratorCaches.java
  class CuratorCaches (line 28) | public class CuratorCaches {
    method getHandler (line 32) | public static CuratorHandler getHandler(@NotNull String conn) throws N...

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/cache/DoeRedisResolver.java
  class DoeRedisResolver (line 27) | @Service("redisResolver")
    method getRedisTemplate (line 34) | public RedisTemplate<String, Object> getRedisTemplate() {
    method expire (line 40) | @Override
    method getExpire (line 53) | @Override
    method hasKey (line 58) | @Override
    method del (line 68) | @Override
    method get (line 82) | @Override
    method set (line 87) | @Override
    method set (line 99) | @Override
    method set (line 104) | @Override
    method incr (line 119) | @Override
    method decr (line 127) | @Override
    method hget (line 137) | @Override
    method hmget (line 142) | @Override
    method hmset (line 147) | @Override
    method hmset (line 158) | @Override
    method hset (line 172) | @Override
    method hset (line 183) | @Override
    method hdel (line 197) | @Override
    method hHasKey (line 202) | @Override
    method hincr (line 207) | @Override
    method hdecr (line 212) | @Override
    method sMembers (line 219) | @Override
    method sHasKey (line 229) | @Override
    method sAdd (line 239) | @Override
    method sSetAndTime (line 249) | @Override
    method sGetSetSize (line 261) | @Override
    method sRem (line 271) | @Override
    method lGet (line 283) | @Override
    method lGetListSize (line 293) | @Override
    method lGetIndex (line 303) | @Override
    method lSet (line 313) | @Override
    method lSet (line 324) | @Override
    method lSet (line 336) | @Override
    method lSet (line 347) | @Override
    method lUpdateIndex (line 359) | @Override
    method lRemove (line 370) | @Override
    method rPush (line 381) | @Override
    method lPop (line 391) | @Override

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/cache/MethodCaches.java
  class MethodCaches (line 30) | public class MethodCaches {
    method cache (line 41) | public static List<MethodModelDTO> cache(final String interfaceName, M...
    method generateMethodKey (line 61) | private static String generateMethodKey(Method method, String interfac...
    method get (line 65) | public static MethodModel get(@NotNull String key) {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/cache/RedisConfiguration.java
  class RedisConfiguration (line 43) | @Configuration
    method getRedisTemplate (line 48) | @Bean
    method cacheManager (line 63) | @Bean
    method createJacksonRedisSerializer (line 91) | private Jackson2JsonRedisSerializer createJacksonRedisSerializer() {
    method keyGenerator (line 100) | @Bean

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/cache/RedisResolver.java
  type RedisResolver (line 24) | public interface RedisResolver {
    method getRedisTemplate (line 31) | RedisTemplate<String, Object> getRedisTemplate();
    method expire (line 40) | boolean expire(String key, long time);
    method getExpire (line 48) | long getExpire(String key);
    method hasKey (line 56) | boolean hasKey(String key);
    method del (line 63) | @SuppressWarnings("unchecked")
    method get (line 72) | Object get(String key);
    method set (line 81) | boolean set(String key, Object value);
    method set (line 91) | boolean set(String key, Object value, long time);
    method set (line 101) | boolean set(String key, Object value, long time, TimeUnit unit);
    method incr (line 109) | long incr(String key, long delta);
    method decr (line 117) | long decr(String key, long delta);
    method hget (line 126) | Object hget(String key, String item);
    method hmget (line 134) | Map<Object, Object> hmget(String key);
    method hmset (line 143) | boolean hmset(String key, Map<String, Object> map);
    method hmset (line 153) | boolean hmset(String key, Map<String, Object> map, long time);
    method hset (line 163) | boolean hset(String key, String item, Object value);
    method hset (line 174) | boolean hset(String key, String item, Object value, long time);
    method hdel (line 182) | void hdel(String key, Object... item);
    method hHasKey (line 191) | boolean hHasKey(String key, String item);
    method hincr (line 201) | double hincr(String key, String item, double by);
    method hdecr (line 211) | double hdecr(String key, String item, double by);
    method sMembers (line 219) | Set<Object> sMembers(String key);
    method sHasKey (line 228) | boolean sHasKey(String key, Object value);
    method sAdd (line 237) | long sAdd(String key, Object... values);
    method sSetAndTime (line 247) | long sSetAndTime(String key, long time, Object... values);
    method sGetSetSize (line 255) | long sGetSetSize(String key);
    method sRem (line 264) | long sRem(String key, Object... values);
    method lGet (line 274) | List<Object> lGet(String key, long start, long end);
    method lGetListSize (line 282) | long lGetListSize(String key);
    method lGetIndex (line 291) | Object lGetIndex(String key, long index);
    method lSet (line 299) | boolean lSet(String key, Object value);
    method lSet (line 309) | boolean lSet(String key, Object value, long time);
    method lSet (line 317) | boolean lSet(String key, List<Object> value);
    method lSet (line 327) | boolean lSet(String key, List<Object> value, long time);
    method lUpdateIndex (line 337) | boolean lUpdateIndex(String key, long index, Object value);
    method lRemove (line 347) | long lRemove(String key, long count, Object value);
    method rPush (line 355) | boolean rPush(String key, Object value);
    method lPop (line 362) | Object lPop(String key);

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/cache/UrlCaches.java
  class UrlCaches (line 27) | public class UrlCaches {
    method cache (line 38) | public static List<UrlModel> cache(String interfaceName, List<URL> url...
    method generateUrlKey (line 55) | private static String generateUrlKey(String interfaceName, String host...
    method get (line 59) | public static UrlModel get(@NotNull String key) {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/channel/NettyChannel.java
  class NettyChannel (line 36) | public class NettyChannel extends AbstractChannel {
    method NettyChannel (line 46) | private NettyChannel(org.jboss.netty.channel.Channel channel, URL url,...
    method getOrAddChannel (line 54) | public static NettyChannel getOrAddChannel(org.jboss.netty.channel.Cha...
    method removeChannelIfDisconnected (line 71) | public static void removeChannelIfDisconnected(org.jboss.netty.channel...
    method getLocalAddress (line 77) | public InetSocketAddress getLocalAddress() {
    method getRemoteAddress (line 81) | public InetSocketAddress getRemoteAddress() {
    method isConnected (line 85) | public boolean isConnected() {
    method send (line 89) | public void send(Object message, boolean sent) throws RemotingException {
    method close (line 114) | public void close() {
    method hasAttribute (line 140) | public boolean hasAttribute(String key) {
    method getAttribute (line 144) | public Object getAttribute(String key) {
    method setAttribute (line 148) | public void setAttribute(String key, Object value) {
    method removeAttribute (line 156) | public void removeAttribute(String key) {
    method hashCode (line 160) | @Override
    method equals (line 168) | @Override
    method toString (line 180) | @Override

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/client/DoeClient.java
  class DoeClient (line 27) | public class DoeClient extends TransportClient {
    method DoeClient (line 30) | public DoeClient(URL url) {
    method doConnect (line 34) | public void doConnect() {
    method send (line 46) | public void send(Request req) throws RemotingException {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/client/ProcessClient.java
  class ProcessClient (line 28) | @Slf4j
    method ProcessClient (line 38) | public ProcessClient(PomDTO dto, RedisResolver redisResolver, String p...
    method run (line 45) | @Override
    method putFlag (line 83) | private void putFlag() {
    method removeFlag (line 92) | private void removeFlag() {
    method makeCommand (line 102) | private String makeCommand(String pomXml) {
    method isOSLinux (line 118) | public static boolean isOSLinux() {
    method isOSMac (line 134) | public static boolean isOSMac() {
    method isDone (line 146) | public boolean isDone() {
    method isRunning (line 150) | public boolean isRunning() {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/client/TransportClient.java
  class TransportClient (line 37) | public class TransportClient {
    method TransportClient (line 54) | public TransportClient(URL url, com.alibaba.dubbo.remoting.ChannelHand...
    method getChannelCodec (line 77) | protected static Codec2 getChannelCodec(URL url) {
    method getConnectAddress (line 82) | protected SocketAddress getConnectAddress() {
    method getEncoder (line 86) | private org.jboss.netty.channel.ChannelHandler getEncoder() {
    method getDecoder (line 90) | private org.jboss.netty.channel.ChannelHandler getDecoder() {
    class InternalEncoder (line 94) | private class InternalEncoder extends OneToOneEncoder {
      method encode (line 96) | @Override
    class InternalDecoder (line 109) | private class InternalDecoder extends SimpleChannelUpstreamHandler {
      method messageReceived (line 114) | @Override
      method exceptionCaught (line 183) | @Override

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/context/ApplicationReadyEventListener.java
  class ApplicationReadyEventListener (line 25) | @Slf4j
    method onApplicationEvent (line 34) | @Override

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/context/Const.java
  class Const (line 16) | public class Const {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/context/DoeClassLoader.java
  class DoeClassLoader (line 36) | @Slf4j
    method DoeClassLoader (line 48) | public DoeClassLoader(String path) {
    method scanJarFile (line 54) | private void scanJarFile(File file) throws Exception {
    method makeClassName (line 81) | private String makeClassName(String name) {
    method loadJars (line 91) | public void loadJars() throws Exception {
    method addClass (line 114) | public static boolean addClass(String className, byte[] byteCode) {
    method loadClass (line 122) | @Override
    method getClass (line 141) | public static Class<?> getClass(String name) throws ClassNotFoundExcep...
    method get (line 145) | private static byte[] get(String className) {
    method scanClassFile (line 149) | private void scanClassFile(File file) {
    method loadClassFile (line 174) | public void loadClassFile() {
    method clearCache (line 186) | public void clearCache() {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/context/ResponseDispatcher.java
  class ResponseDispatcher (line 24) | public class ResponseDispatcher {
    method ResponseDispatcher (line 28) | private ResponseDispatcher() {
    method getFuture (line 32) | @SuppressWarnings("uncheck")
    method register (line 37) | public void register(Request req) {
    method dispatch (line 43) | public void dispatch(Response res) {
    method removeFuture (line 52) | public CompletableFuture removeFuture(Request req) {
    class ResponseDispatcherHolder (line 56) | static class ResponseDispatcherHolder {
    method getDispatcher (line 60) | public static ResponseDispatcher getDispatcher() {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/context/TaskContainer.java
  class TaskContainer (line 20) | @Slf4j
    method TaskContainer (line 36) | private TaskContainer() {
    method getTaskContainer (line 54) | public static TaskContainer getTaskContainer() {
    method execute (line 63) | public void execute(Runnable task) {
    class TaskContainerHolder (line 67) | static class TaskContainerHolder {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/crontroller/CaseController.java
  class CaseController (line 33) | @RestController
    method doSave (line 42) | @RequestMapping("/doSave")
    method doList (line 63) | @RequestMapping("/doList")

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/crontroller/DubboController.java
  class DubboController (line 35) | @RestController
    method doSendWithTelnet (line 49) | @RequestMapping("/doSendWithTelnet")
    method doSend (line 68) | @RequestMapping("/doSend")
    method doListParams (line 87) | @RequestMapping("/doListParams")
    method doListMethods (line 107) | @RequestMapping("/doListMethods")
    method doListProviders (line 139) | @RequestMapping("/doListProviders")
    method doConnect (line 172) | @RequestMapping("/doConnect")

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/crontroller/HomeController.java
  class HomeController (line 22) | @Controller
    method index (line 29) | @RequestMapping("/index")
    method index (line 36) | @RequestMapping("/main")
    method openNormalPage (line 52) | @RequestMapping("/normalCnt")
    method openCasePage (line 58) | @RequestMapping("/caseCnt")
    method openEasyPage (line 64) | @RequestMapping("/easyCnt")
    method openAddJarPage (line 70) | @RequestMapping("/addJar")
    method openListJarPage (line 76) | @RequestMapping("/listJar")
    method openEditPomPage (line 81) | @RequestMapping("/editPom")
    method openListZkPage (line 87) | @RequestMapping("/listZk")
    method openSysPage (line 93) | @RequestMapping("/sys")

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/crontroller/PomController.java
  class PomController (line 31) | @RestController
    method doLoad (line 45) | @RequestMapping("/doLoad")
    method doParse (line 71) | @RequestMapping("/doParse")
    method doReparse (line 106) | @RequestMapping("/doReparse")
    method getRealTimeMsg (line 126) | @RequestMapping("/doMsg")
    method doListJars (line 149) | @RequestMapping("/doListJars")
    method doLoadPomFile (line 169) | @RequestMapping("/doLoadPomFile")
    method doOverridePomFile (line 190) | @RequestMapping("/doOverridePomFile")

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/crontroller/RegistryController.java
  class RegistryController (line 28) | @RestController
    method doListZk (line 36) | @RequestMapping("/doListZk")
    method doListRegistry (line 57) | @RequestMapping("/doListRegistry")
    method addRegistry (line 78) | @RequestMapping("/addRegistry")
    method delRegistry (line 97) | @RequestMapping("/delRegistry")

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/crontroller/SysConfController.java
  class SysConfController (line 27) | @Slf4j
    method doReload (line 38) | @RequestMapping("/doReload")
    method doRepublish (line 54) | @RequestMapping("/doRepublish")

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dao/CaseDAO.java
  type CaseDAO (line 20) | public interface CaseDAO {
    method save (line 28) | int save(CaseModel model);
    method listAll (line 34) | List<CaseModel> listAll();

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/BaseDTO.java
  class BaseDTO (line 18) | public class BaseDTO {
    method BaseDTO (line 24) | public BaseDTO() {
    method getRequestId (line 29) | public String getRequestId() {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/CaseModelDTO.java
  class CaseModelDTO (line 18) | public class CaseModelDTO extends CaseModel {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/ConnectDTO.java
  class ConnectDTO (line 18) | @Data

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/MethodModelDTO.java
  class MethodModelDTO (line 19) | @Data
    method MethodModelDTO (line 39) | public MethodModelDTO() {
    method MethodModelDTO (line 43) | public MethodModelDTO(MethodModel model) {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/PomDTO.java
  class PomDTO (line 18) | @Data

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/ResultDTO.java
  class ResultDTO (line 21) | @Data
    method handleSuccess (line 36) | public static <T> ResultDTO<T> handleSuccess(String msg, T data) {
    method handleError (line 48) | public static <T> ResultDTO<T> handleError(String msg, T data) {
    method handleException (line 58) | public static <T> ResultDTO<T> handleException(String msg, T data, Thr...
    method createExceptionResult (line 70) | public static <T> ResultDTO<T> createExceptionResult(Throwable e, Clas...
    method createExceptionResult (line 75) | public static <T> ResultDTO<T> createExceptionResult(String msg, Throw...
    method createErrorResult (line 87) | public static <T> ResultDTO<T> createErrorResult(String msg, Class<T> ...
    method createSuccessResult (line 98) | public static <T> ResultDTO<T> createSuccessResult(String msg, Class<T...
    method createSuccessResult (line 102) | public static <T> ResultDTO<T> createSuccessResult(String msg, T data,...

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/UrlModelDTO.java
  class UrlModelDTO (line 18) | @Data

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/exception/DoeException.java
  class DoeException (line 16) | public class DoeException extends RuntimeException {
    method DoeException (line 18) | public DoeException(String message) {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/handler/CuratorHandler.java
  class CuratorHandler (line 37) | public class CuratorHandler {
    method CuratorHandler (line 46) | public CuratorHandler(String protocol, String host, int port) {
    method doConnect (line 52) | public void doConnect() throws NoSuchFieldException, IllegalAccessExce...
    method getInterfaces (line 65) | public List<ServiceModel> getInterfaces() {
    method getProviders (line 77) | public List<UrlModel> getProviders(ConnectDTO dto) {
    method getMethods (line 102) | public List<MethodModelDTO> getMethods(String interfaceName) throws Cl...
    method close (line 111) | public void close() {
    method isAvailable (line 115) | public boolean isAvailable() {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/handler/SendReceiveHandler.java
  class SendReceiveHandler (line 28) | @Slf4j
    method connected (line 32) | @Override
    method disconnected (line 37) | @Override
    method sent (line 42) | @Override
    method received (line 55) | @Override
    method caught (line 92) | @Override

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/handler/StreamHandler.java
  class StreamHandler (line 26) | @Slf4j
    method StreamHandler (line 34) | public StreamHandler(Process ps, RedisResolver redisResolver, String r...
    method run (line 52) | @Override
    method putToRedis (line 99) | private void putToRedis(String requestId, String message) {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/CaseModel.java
  class CaseModel (line 21) | @Data

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/MethodModel.java
  class MethodModel (line 22) | public class MethodModel {
    method getKey (line 27) | public String getKey() {
    method getMethod (line 31) | public Method getMethod() {
    method MethodModel (line 35) | public MethodModel(String key, Method method) {
    method toString (line 40) | @Override
    method getMethodText (line 60) | public String getMethodText() {
    method getShortType (line 77) | private String getShortType(String name) {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/PointModel.java
  class PointModel (line 20) | @Data
    method PointModel (line 26) | public PointModel(String host, Integer port) {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/PomModel.java
  class PomModel (line 18) | public class PomModel {
    method getGroupId (line 25) | public String getGroupId() {
    method setGroupId (line 29) | public void setGroupId(String groupId) {
    method getArtifactId (line 33) | public String getArtifactId() {
    method setArtifactId (line 37) | public void setArtifactId(String artifactId) {
    method getVersion (line 41) | public String getVersion() {
    method setVersion (line 45) | public void setVersion(String version) {
    method getScope (line 49) | public String getScope() {
    method setScope (line 53) | public void setScope(String scope) {
    method isBroken (line 57) | public boolean isBroken() {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/RegistryModel.java
  class RegistryModel (line 18) | @Data

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/ServiceModel.java
  class ServiceModel (line 20) | @Data

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/UrlModel.java
  class UrlModel (line 18) | public class UrlModel {
    method UrlModel (line 23) | public UrlModel(String key, URL url) {
    method getKey (line 28) | public String getKey() {
    method getUrl (line 32) | public URL getUrl() {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/CaseService.java
  type CaseService (line 22) | public interface CaseService {
    method save (line 30) | ResultDTO<CaseModel> save(CaseModel model);
    method listAll (line 37) | List<Object> listAll();

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/ClassService.java
  type ClassService (line 24) | public interface ClassService {
    method generateMethodParamsJsonString (line 32) | ResultDTO<String> generateMethodParamsJsonString(@NotNull MethodModelD...
    method listMethods (line 40) | List<MethodModelDTO> listMethods(ConnectDTO dto);

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/ConfigService.java
  type ConfigService (line 22) | public interface ConfigService {
    method listRegistry (line 29) | List<RegistryModel> listRegistry();
    method addRegistry (line 36) | ResultDTO<RegistryModel> addRegistry(RegistryModel model);
    method loadZkConfigFromResource (line 41) | void loadZkConfigFromResource();
    method delRegistry (line 49) | ResultDTO<RegistryModel> delRegistry(RegistryModel model);

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/ConnectService.java
  type ConnectService (line 25) | public interface ConnectService {
    method connect (line 33) | List<ServiceModel> connect(@NotNull String conn) throws NoSuchFieldExc...
    method listProviders (line 41) | List<UrlModelDTO> listProviders(@NotNull ConnectDTO connect) throws No...
    method send (line 49) | ResultDTO<String> send(ConnectDTO dto) throws Exception;

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/MenuService.java
  type MenuService (line 16) | public interface MenuService {
    method getUrl (line 24) | String getUrl(Integer mid);
    method getHtml (line 30) | String getHtml();

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/PomService.java
  type PomService (line 28) | public interface PomService {
    method invoke (line 37) | ResultDTO<PomDTO> invoke() throws Exception;
    method invoke (line 45) | ResultDTO<PomDTO> invoke(PomDTO dto) throws Exception;
    method parsePom (line 55) | List<PomModel> parsePom(@NotNull String xml) throws IOException, SAXEx...
    method appendPom (line 64) | void appendPom(List<PomModel> models, @NotNull String pomXml) throws E...
    method getRealTimeMsg (line 72) | ResultDTO<String> getRealTimeMsg(@NotNull String requestId);
    method loadJars (line 80) | ResultDTO<String> loadJars(String libPath) throws NoSuchMethodExceptio...
    method listJars (line 88) | List<PomModel> listJars(PomDTO dto) throws ParserConfigurationExceptio...
    method loadPomFile (line 96) | String loadPomFile(String pomXmlPath);
    method overridePomFile (line 104) | Boolean overridePomFile(String pomXmlPath, String content);
    method deleteJars (line 109) | ResultDTO<String> deleteJars(String path);

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/TelnetService.java
  type TelnetService (line 22) | public interface TelnetService {
    method send (line 29) | ResultDTO<String> send(@NotNull ConnectDTO dto);

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/impl/CaseServiceImpl.java
  class CaseServiceImpl (line 37) | @Service("caseService")
    method save (line 51) | @Override
    method listAll (line 80) | @Override

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/impl/ClassServiceImpl.java
  class ClassServiceImpl (line 42) | @Service("classService")
    method listMethods (line 47) | @Override
    method generateMethodParamsJsonString (line 91) | @Override
    method initObject (line 129) | private Object initObject(Class<?> clazz, Type type) throws IllegalAcc...
    method initArrayList (line 197) | private List<Object> initArrayList(Type genericType) throws Instantiat...
    method getMethodByName (line 222) | private Method getMethodByName(String interfaceName, String methodName...

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/impl/ConfigServiceImpl.java
  class ConfigServiceImpl (line 40) | @Service("configService")
    method listRegistry (line 55) | @Override
    method addRegistry (line 78) | @Override
    method delRegistry (line 100) | @Override
    method loadConfig (line 121) | @PostConstruct
    method loadZkConfigFromResource (line 130) | @Override

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/impl/ConnectServiceImpl.java
  class ConnectServiceImpl (line 49) | @Service("connectService")
    method send (line 53) | @Override
    method listProviders (line 91) | @Override
    method connect (line 125) | @Override

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/impl/MenuServiceImpl.java
  class MenuServiceImpl (line 36) | @Service("menuService")
    method getHtml (line 57) | @Override
    method getUrl (line 62) | @Override
    method cacheMenu (line 68) | private void cacheMenu(List<MenuNode> tree) {
    method createFile (line 79) | @PostConstruct
    method getProjectRealPath (line 104) | private String getProjectRealPath() throws FileNotFoundException {
    method createFile (line 113) | private void createFile(String projectRealPath, String html) throws Ex...
    method buildTree (line 156) | private MenuNode buildTree(List<MenuNode> menuList, int pMenuId) {
    method toHtml (line 171) | private String toHtml(String elementId, MenuNode root) {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/impl/PomServiceImpl.java
  class PomServiceImpl (line 65) | @Service("pomService")
    method invoke (line 80) | @Override
    method invoke (line 114) | @Override
    method checkMaven (line 159) | private void checkMaven(List<PomModel> models) {
    method appendPom (line 163) | @Override
    method checkModels (line 211) | private void checkModels(List<PomModel> models) {
    method parsePom (line 224) | @Override
    method getRealTimeMsg (line 262) | @Override
    method loadJars (line 299) | @Override
    method loadJars$$ (line 314) | @Deprecated // since v1.1.0
    method listJars (line 375) | @Override
    method checkForChanges (line 410) | private void checkForChanges() {
    method loadPomFile (line 416) | @Override
    method overridePomFile (line 424) | @Override
    method deleteJars (line 435) | @Override

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/impl/TelnetServiceImpl.java
  class TelnetServiceImpl (line 34) | @Slf4j
    method send (line 44) | @Override
    method makeCommand (line 114) | private String makeCommand(String serviceName, String methodName, Stri...

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/util/DOMUtil.java
  class DOMUtil (line 40) | public class DOMUtil {
    method createDocument (line 49) | public static Document createDocument() throws ConfigurationException {
    method parse (line 67) | public static Document parse(String xml) throws SAXException, IOExcept...
    method parseStream (line 85) | public static Document parseStream(InputStream stream, boolean validate,
    method parseStream (line 105) | public static Document parseStream(InputStream stream, boolean validate,
    method getAttribute (line 135) | public static String getAttribute(Element element, String name, String...
    method addElement (line 149) | public static Element addElement(Node parent, String elementName) {
    method removeEmptyAttributes (line 166) | public static void removeEmptyAttributes(Element element) {
    method serialize (line 187) | public static void serialize(Node node, File outdir, String fileName) ...
    method serialize (line 191) | public static void serialize(Node node, OutputStream out) throws Confi...
    method serialize (line 201) | public static void serialize(Node node, StreamResult streamRes) throws...
    method serialize (line 212) | public static void serialize(Node node, StreamResult streamRes, boolea...
    method countElementsBefore (line 241) | public static int countElementsBefore(Node node, String tagName) {
    method copyNodeList (line 277) | public static List<Node> copyNodeList(NodeList nodeList) {
    method getNextSiblingElement (line 291) | public static Element getNextSiblingElement(Node node) {
    method getFirstChildByType (line 304) | public static Node getFirstChildByType(Element element, int nodeType) {
    method getNodeList (line 333) | public static NodeList getNodeList(Node node, String xpath) {
    method getNode (line 368) | public static Node getNode(Node node, String xpath) {
    method getName (line 390) | public static String getName(Element element) {
    method copyChildNodes (line 405) | public static void copyChildNodes(Node source, Node target) {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/util/FileUtil.java
  class FileUtil (line 21) | @Slf4j
    method readToString (line 24) | public static String readToString(String fileName) throws DoeException {
    method WriteStringToFile (line 44) | public static void WriteStringToFile(String fileName, String text) {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/util/JsonFileUtil.java
  class JsonFileUtil (line 25) | public class JsonFileUtil {
    method readList (line 30) | public static <T> List<T> readList(InputStream inputStream, Class<T> c...
    method readObject (line 51) | public static <T> T readObject(InputStream inputStream, Class<T> clazz...

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/util/MD5Util.java
  class MD5Util (line 21) | @Slf4j
    method encrypt (line 24) | public final static String encrypt(String pwd) {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/util/ParamUtil.java
  class ParamUtil (line 32) | public class ParamUtil {
    method getAttachmentFromUrl (line 34) | public static HashMap<String,String> getAttachmentFromUrl(URL url) thr...
    method parseJson (line 66) | public static Object[] parseJson(String jsonStr, Method invokeMethod) {
    method parsePointModel (line 97) | public static PointModel parsePointModel(@NotNull String conn) {

FILE: mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/util/StringUtil.java
  class StringUtil (line 17) | public class StringUtil {
    method format (line 27) | public static String format(String src, Object... param) {
    method main (line 37) | public static void main(String[] args) {

FILE: mmc-dubbo-doe/src/main/resources/static/v3/assets/js/html5shiv.js
  function addStyleSheet (line 67) | function addStyleSheet(ownerDocument, cssText) {
  function getElements (line 80) | function getElements() {
  function getExpandoData (line 91) | function getExpandoData(ownerDocument) {
  function createElement (line 109) | function createElement(nodeName, ownerDocument, data){
  function createDocumentFragment (line 145) | function createDocumentFragment(ownerDocument, data){
  function shivMethods (line 169) | function shivMethods(ownerDocument, data) {
  function shivDocument (line 207) | function shivDocument(ownerDocument) {

FILE: mmc-dubbo-doe/src/main/resources/static/v3/assets/js/jqGrid/jquery.jqGrid.src.js
  function tojLinq (line 1685) | function tojLinq ( group ) {
  function scrGrid (line 2910) | function scrGrid(iR){
  function isEmpty (line 3277) | function isEmpty(obj) {
  function resortArray (line 3359) | function resortArray(a) {
  function resortRows (line 3371) | function resortRows(parent, clobj) {
  function setAttributes (line 5989) | function setAttributes(elm, atr, exl ) {
  function getStringRule (line 6966) | function getStringRule(rule) {
  function getStringForGroup (line 6980) | function getStringForGroup(group) {
  function showFilter (line 7155) | function showFilter(_filter) {
  function getFormData (line 7462) | function getFormData(){
  function createData (line 7516) | function createData(rowid,obj,tb,maxcols){
  function fillData (line 7596) | function fillData(rowid,obj,fmid){
  function setNulls (line 7717) | function setNulls() {
  function postIt (line 7726) | function postIt() {
  function compareData (line 7923) | function compareData(nObj, oObj ) {
  function checkUpdates (line 7933) | function checkUpdates () {
  function restoreInline (line 7948) | function restoreInline()
  function updateNav (line 7960) | function updateNav(cr, posarr){
  function getCurrPos (line 7978) | function getCurrPos() {
  function focusaref (line 8316) | function focusaref(){ //Sfari 3 issues
  function createData (line 8321) | function createData(rowid,obj,tb,maxcols){
  function fillData (line 8399) | function fillData(rowid,obj){
  function updateNav (line 8425) | function updateNav(cr,posarr){
  function getCurrPos (line 8442) | function getCurrPos() {
  function scrollGrid (line 10164) | function scrollGrid(iR, iC, tp){
  function findNextVisible (line 10193) | function findNextVisible(iC,act){
  function findGroupIdx (line 11528) | function findGroupIdx( ind , offset, grp) {
  function start (line 12002) | function start() {ts.p.disableClick = true;}
  function insert (line 12067) | function insert(perm,i,v) {
  function call (line 12203) | function call(fn, obj) {
  function updateDnD (line 12279) | function updateDnD ()
  function tableToGrid (line 12468) | function tableToGrid(selector, options) {

FILE: mmc-dubbo-doe/src/main/resources/static/v3/assets/js/jquery.colorbox-min.js
  function o (line 7) | function o(i,o,n){var r=e.createElement(i);return o&&(r.id=te+o),n&&(r.s...
  function n (line 7) | function n(){return i.innerHeight?i.innerHeight:t(i).height()}
  function r (line 7) | function r(t){var e=E.length,i=(j+t)%e;return 0>i?e+i:i}
  function l (line 7) | function l(t,e){return Math.round((/%/.test(t)?("x"===e?H.width():n())/1...
  function h (line 7) | function h(t,e){return t.photo||t.photoRegex.test(e)}
  function s (line 7) | function s(t,e){return t.retinaUrl&&i.devicePixelRatio>1?e.replace(t.pho...
  function a (line 7) | function a(t){"contains"in v[0]&&!v[0].contains(t.target)&&(t.stopPropag...
  function d (line 7) | function d(){var e,i=t.data(A,Z);null==i?(O=t.extend({},Y),console&&cons...
  function c (line 7) | function c(i,o){t(e).trigger(i),se.trigger(i),t.isFunction(o)&&o.call(A)}
  function u (line 7) | function u(){var t,e,i,o,n,r=te+"Slideshow_",l="click."+te;O.slideshow&&...
  function p (line 7) | function p(i){G||(A=i,d(),E=t(A),j=0,"nofollow"!==O.rel&&(E=t("."+ee).fi...
  function f (line 7) | function f(){!v&&e.body&&(X=!1,H=t(i),v=o(ae).attr({id:Z,"class":t.suppo...
  function m (line 7) | function m(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t...
  function w (line 7) | function w(){var n,r,a,u=J.prep,p=++de;q=!0,U=!1,A=E[j],d(),c(he),c(oe,O...
  function o (line 7) | function o(){b[0].style.width=k[0].style.width=x[0].style.width=parseInt...
  function n (line 7) | function n(){return O.w=O.w||W.width(),O.w=O.mw&&O.mw<O.w?O.mw:O.w,O.w}
  function l (line 7) | function l(){return O.h=O.h||W.height(),O.h=O.mh&&O.mh<O.h?O.mh:O.h,O.h}
  function i (line 7) | function i(){t.support.opacity===!1&&v[0].style.removeAttribute("filter")}

FILE: mmc-dubbo-doe/src/main/resources/static/v3/assets/js/jquery.form.js
  function deepSerialize (line 342) | function deepSerialize(extraData) {
  function fileUploadXhr (line 360) | function fileUploadXhr(a) {
  function fileUploadIframe (line 430) | function fileUploadIframe(a) {
  function doAjaxSubmit (line 1009) | function doAjaxSubmit(e) {
  function captureSubmittingElement (line 1019) | function captureSubmittingElement(e) {
  function log (line 1506) | function log() {

FILE: mmc-dubbo-doe/src/main/resources/static/v3/assets/js/multiple-select.js
  function MultipleSelect (line 126) | function MultipleSelect($el, options) {

FILE: mmc-dubbo-doe/src/main/resources/static/v3/js/core.js
  function buildTree (line 36) | function buildTree(data, pmenuId){
  function viewTree (line 115) | function viewTree(elmId, datas) {

FILE: mmc-dubbo-doe/src/main/resources/static/v3/js/echartUtils.js
  function initLine (line 5) | function initLine(divid,name,data,data2) {
  function drawSumline (line 85) | function drawSumline(dataArray, data2) {

FILE: mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/DubboDoeApplicationTests.java
  class DubboDoeApplicationTests (line 8) | @RunWith(SpringRunner.class)
    method contextLoads (line 13) | @Test

FILE: mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestCaseService.java
  class TestCaseService (line 30) | @RunWith(SpringRunner.class)
    method testSave (line 37) | @Test
    method testListAll (line 53) | @Test

FILE: mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestClassService.java
  class TestClassService (line 31) | @RunWith(SpringRunner.class)
    method testGenerateMethodParamsJsonString (line 38) | @Test
    method testListMethods (line 63) | @Test

FILE: mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestConfigService.java
  class TestConfigService (line 29) | @RunWith(SpringRunner.class)
    method testListRegistry (line 36) | @Test
    method testAddRegistry (line 63) | @Test
    method testDelRegistry (line 83) | @Test

FILE: mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestConnectService.java
  class TestConnectService (line 33) | @RunWith(SpringRunner.class)
    method testSend (line 42) | @Test

FILE: mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestCuratorHandler.java
  class TestCuratorHandler (line 27) | public class TestCuratorHandler {
    method testConnect (line 32) | @Before
    method testGetInterfaces (line 40) | @Test
    method testGetProviders (line 53) | @Test
    method testGetMethods (line 75) | @Test

FILE: mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestDemo.java
  class TestDemo (line 37) | public class TestDemo {
    method testDemo (line 39) | @Test

FILE: mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestDoeClassLoader.java
  class TestDoeClassLoader (line 19) | public class TestDoeClassLoader {
    method testLoad (line 21) | @Test

FILE: mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestDoeClient.java
  class TestDoeClient (line 33) | public class TestDoeClient {
    method testConnect (line 38) | @Before
    method testSend (line 45) | @Test

FILE: mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestFuture.java
  class TestFuture (line 21) | public class TestFuture {
    method test (line 23) | @Test

FILE: mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestLogback.java
  class TestLogback (line 19) | @Slf4j
    method test (line 22) | @Test

FILE: mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestNumber.java
  class TestNumber (line 18) | public class TestNumber {
    method testPercent (line 20) | @Test

FILE: mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestParam.java
  class TestParam (line 22) | public class TestParam {
    method testMethodPassValue (line 24) | @Test
    method print (line 39) | private void print(String... values) {

FILE: mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestPomService.java
  class TestPomService (line 37) | @RunWith(SpringRunner.class)
    method testPath (line 44) | @Test
    method testParse (line 54) | @Test
    method testAppend (line 74) | @Test
    method testLoad (line 101) | @Test
    method testListJars (line 123) | @Test
    method testInvoke (line 135) | @Test
    method testLoadPomFile (line 168) | @Test
    method testOverridePomFile (line 180) | @Test

FILE: mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestProcessClient.java
  class TestProcessClient (line 26) | @RunWith(SpringRunner.class)
    method testDownload (line 33) | @Test

FILE: mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestRedisResolver.java
  class TestRedisResolver (line 27) | @RunWith(SpringRunner.class)
    method testString (line 34) | @Test

FILE: mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestRedisTemplate.java
  class TestRedisTemplate (line 26) | @RunWith(SpringRunner.class)
    method testRedis (line 33) | @Test

FILE: mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestTelnetService.java
  class TestTelnetService (line 34) | public class TestTelnetService {
    method testSend (line 38) | @Test

FILE: mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestTime.java
  class TestTime (line 22) | public class TestTime {
    method main (line 24) | public static void main(String[] args) {
    method isRestTime (line 45) | private static boolean isRestTime(LocalTime now) {
    method isMoreThanDiffDay (line 73) | public static boolean isMoreThanDiffDay(String tmStartStr, String tmEn...

FILE: mmc-dubbo-provider/src/main/java/com/mmc/dubbo/provider/DubboProviderApplication.java
  class DubboProviderApplication (line 7) | @EnableDubbo
    method main (line 11) | public static void main(String[] args) {

FILE: mmc-dubbo-provider/src/main/java/com/mmc/dubbo/provider/user/UserFeedbackServiceImpl.java
  class UserFeedbackServiceImpl (line 23) | @com.alibaba.dubbo.config.annotation.Service(version = "2.0.0", group = ...
    method getCurrentById (line 32) | @Override
    method insert (line 52) | @Override
    method echo (line 69) | @Override

FILE: mmc-dubbo-provider/src/main/java/com/mmc/dubbo/provider/user/UserMemberServiceImpl.java
  class UserMemberServiceImpl (line 24) | @com.alibaba.dubbo.config.annotation.Service
    method getCurrentById (line 28) | @Override
    method insert (line 41) | @Override
    method echo (line 61) | @Override
Condensed preview — 154 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,194K chars).
[
  {
    "path": ".gitattributes",
    "chars": 28,
    "preview": "*.js linguist-language=Java\n"
  },
  {
    "path": ".gitignore",
    "chars": 50,
    "preview": "##ignore this file##\n.idea/\ntarget\ntarget/\n*.iml\n\n"
  },
  {
    "path": "README.md",
    "chars": 2628,
    "preview": "\n# Doe 发布 [V1.3.0]\n\n前段时间排查某问题的时候,想要快速知道某些dubbo接口(三无)的响应结果,但不想启动项目(因为这些项目不是你负责的,不会部署而且超级笨重),也不想新建一个dubbo客户端项目(占地方),也不想开te"
  },
  {
    "path": "UPGRADE.md",
    "chars": 644,
    "preview": "\n版本发布记录\n\n# Doe 发布 [V1.0.0]\n## 版本特性\n一、连接发送\n* 极简模式\n* 普通模式\n* 用例模式\n\n二、依赖管理\n* 增加依赖\n* 依赖列表\n\n> 基础功能基本实现\n\n\n# Doe 发布 [V1.1.0]\n\n##"
  },
  {
    "path": "deploy/SimpleHttpServer.py",
    "chars": 2469,
    "preview": "#!/usr/bin/env python2\n# --coding:utf-8--\n\nimport os\nimport time\nfrom BaseHTTPServer import BaseHTTPRequestHandler, HTTP"
  },
  {
    "path": "deploy/deploy.sh",
    "chars": 1235,
    "preview": "#!/bin/bash\n\nsource /etc/profile\n\nfunction log() {\n    echo `date '+%Y-%m-%d %H:%M:%S'` \"$1\"\n}\n\nfunction doStop() {\n\tlog"
  },
  {
    "path": "deploy/pom.xml",
    "chars": 1176,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"htt"
  },
  {
    "path": "deploy/pom.xml.backup",
    "chars": 1176,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"htt"
  },
  {
    "path": "mmc-dubbo-api/.gitignore",
    "chars": 49,
    "preview": "##ignore this file##\n.idea/\ntarget\ntarget/\n*.iml\n"
  },
  {
    "path": "mmc-dubbo-api/pom.xml",
    "chars": 1015,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xmlns:xsi=\"http://www"
  },
  {
    "path": "mmc-dubbo-api/src/main/java/com/mmc/dubbo/api/user/GenericReq.java",
    "chars": 849,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-api/src/main/java/com/mmc/dubbo/api/user/GenericResp.java",
    "chars": 848,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-api/src/main/java/com/mmc/dubbo/api/user/UserFact.java",
    "chars": 1135,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-api/src/main/java/com/mmc/dubbo/api/user/UserService.java",
    "chars": 820,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/.gitignore",
    "chars": 268,
    "preview": "/target/\n!.mvn/wrapper/maven-wrapper.jar\n\n### STS ###\n.apt_generated\n.classpath\n.factorypath\n.project\n.settings\n.springB"
  },
  {
    "path": "mmc-dubbo-doe/pom.xml",
    "chars": 4471,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2"
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/DubboDoeApplication.java",
    "chars": 563,
    "preview": "package com.mmc.dubbo.doe;\n\nimport com.mmc.dubbo.doe.context.ApplicationReadyEventListener;\nimport org.springframework.b"
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/auth/MenuNode.java",
    "chars": 868,
    "preview": "/*  \n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.  \n *  \n * This software is the confidential and propri"
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/auth/MenuTree.java",
    "chars": 2336,
    "preview": "/*  \n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.  \n *  \n * This software is the confidential and propri"
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/cache/CuratorCaches.java",
    "chars": 1895,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/cache/DoeRedisResolver.java",
    "chars": 10816,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/cache/MethodCaches.java",
    "chars": 1858,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/cache/RedisConfiguration.java",
    "chars": 5657,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/cache/RedisResolver.java",
    "chars": 6750,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/cache/UrlCaches.java",
    "chars": 1695,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/channel/NettyChannel.java",
    "chars": 6119,
    "preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n  * contributor license agreements.  See the NO"
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/client/DoeClient.java",
    "chars": 1586,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/client/ProcessClient.java",
    "chars": 4521,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/client/TransportClient.java",
    "chars": 7583,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/context/ApplicationReadyEventListener.java",
    "chars": 1592,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/context/Const.java",
    "chars": 1219,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/context/DoeClassLoader.java",
    "chars": 5266,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/context/ResponseDispatcher.java",
    "chars": 1697,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/context/TaskContainer.java",
    "chars": 1908,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/crontroller/CaseController.java",
    "chars": 2311,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/crontroller/DubboController.java",
    "chars": 5556,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/crontroller/HomeController.java",
    "chars": 2305,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/crontroller/PomController.java",
    "chars": 4933,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/crontroller/RegistryController.java",
    "chars": 2896,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/crontroller/SysConfController.java",
    "chars": 1597,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dao/CaseDAO.java",
    "chars": 689,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/BaseDTO.java",
    "chars": 731,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/CaseModelDTO.java",
    "chars": 486,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/ConnectDTO.java",
    "chars": 1124,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/MethodModelDTO.java",
    "chars": 1063,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/PomDTO.java",
    "chars": 602,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/ResultDTO.java",
    "chars": 3467,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/dto/UrlModelDTO.java",
    "chars": 527,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/exception/DoeException.java",
    "chars": 528,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/handler/CuratorHandler.java",
    "chars": 3699,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/handler/SendReceiveHandler.java",
    "chars": 3194,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/handler/StreamHandler.java",
    "chars": 3281,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/CaseModel.java",
    "chars": 1159,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/MethodModel.java",
    "chars": 2153,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/PointModel.java",
    "chars": 624,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/PomModel.java",
    "chars": 1336,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/RegistryModel.java",
    "chars": 520,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/ServiceModel.java",
    "chars": 511,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/model/UrlModel.java",
    "chars": 725,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/CaseService.java",
    "chars": 758,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/ClassService.java",
    "chars": 1073,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/ConfigService.java",
    "chars": 995,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/ConnectService.java",
    "chars": 1302,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/MenuService.java",
    "chars": 652,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/PomService.java",
    "chars": 2615,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/TelnetService.java",
    "chars": 705,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/impl/CaseServiceImpl.java",
    "chars": 2791,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/impl/ClassServiceImpl.java",
    "chars": 7858,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/impl/ConfigServiceImpl.java",
    "chars": 4755,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/impl/ConnectServiceImpl.java",
    "chars": 4812,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/impl/MenuServiceImpl.java",
    "chars": 8836,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/impl/PomServiceImpl.java",
    "chars": 16827,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/service/impl/TelnetServiceImpl.java",
    "chars": 4046,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/util/DOMUtil.java",
    "chars": 14540,
    "preview": "package com.mmc.dubbo.doe.util;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.File;\nimport java.io.IOException;\ni"
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/util/FileUtil.java",
    "chars": 1727,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/util/JsonFileUtil.java",
    "chars": 1615,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/util/MD5Util.java",
    "chars": 1695,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/util/ParamUtil.java",
    "chars": 3521,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/main/java/com/mmc/dubbo/doe/util/StringUtil.java",
    "chars": 1069,
    "preview": "/*  \n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.  \n *  \n * This software is the confidential and propri"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/application-dev.yml",
    "chars": 694,
    "preview": "# ====================server====================\nserver:\n  port: 9876\nspring:\n  thymeleaf:\n    # 开发环境禁用页面缓存\n    cache: f"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/application-prd.yml",
    "chars": 743,
    "preview": "# ====================server====================\nserver:\n  port: 9876\nspring:\n  thymeleaf:\n    # 开发环境禁用页面缓存\n    cache: t"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/application.yml",
    "chars": 58,
    "preview": "spring:\n  profiles:\n    active: @spring.profiles.active@\n\n"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/logback-spring.xml",
    "chars": 4792,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<configuration scan=\"true\" scanPeriod=\"60 seconds\" debug=\"false\">\n\n\n    <property"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/menu.json",
    "chars": 4086,
    "preview": "[\n  {\n    \"autoId\":\"1\",\n    \"menuId\":\"16000000\",\n    \"pmenuId\":\"-1\",\n    \"menuName\":\"Doe\",\n    \"menuUrl\":\"#\",\n    \"menuS"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/registry.json",
    "chars": 99,
    "preview": "[\n  {\n    \"registryKey\": \"127.0.0.1:2181\",\n    \"registryDesc\": \"localhost -- 127.0.0.1:2181\"\n  }\n]\n"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/css/bootstrap-editable.css",
    "chars": 21030,
    "preview": "/*! X-editable - v1.4.6 \n* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery\n* http://github.com/vitalet"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/css/bootstrap-timepicker.css",
    "chars": 2780,
    "preview": "/*!\n * Timepicker Component for Twitter Bootstrap\n *\n * Copyright 2013 Joris de Wit\n *\n * Contributors https://github.co"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/css/chosen.css",
    "chars": 13586,
    "preview": "/* @group Base */\n.chosen-container {\n  position: relative;\n  display: inline-block;\n  vertical-align: middle;\n  font-si"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/css/colorbox.css",
    "chars": 4340,
    "preview": "/*\n    Colorbox Core Style:\n    The following CSS is consistent between example themes and should not be altered.\n*/\n#co"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/css/colorpicker.css",
    "chars": 2400,
    "preview": "/*!\n* Colorpicker for Bootstrap\n*\n* Copyright 2012 Stefan Petre\n* Licensed under the Apache License v2.0\n* http://www.ap"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/css/datepicker.css",
    "chars": 10224,
    "preview": "/*!\n * Datepicker for Bootstrap\n *\n * Copyright 2012 Stefan Petre\n * Improvements by Andrew Rowls\n * Licensed under the "
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/css/daterangepicker.css",
    "chars": 4814,
    "preview": "/*!\n * Stylesheet for the Date Range Picker, for use with Bootstrap 3.x\n *\n * Copyright 2013 Dan Grossman ( http://www.d"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/css/dropzone.css",
    "chars": 11758,
    "preview": "/* The MIT License */\n.dropzone,\n.dropzone *,\n.dropzone-previews,\n.dropzone-previews * {\n  -webkit-box-sizing: border-bo"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/css/fullcalendar.css",
    "chars": 11147,
    "preview": "/*!\n * FullCalendar v1.6.4 Stylesheet\n * Docs & License: http://arshaw.com/fullcalendar/\n * (c) 2013 Adam Shaw\n */\n\n\n.fc"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/css/jquery.gritter.css",
    "chars": 1954,
    "preview": "/* the norm */\n#gritter-notice-wrapper {\n\tposition:fixed;\n\ttop:20px;\n\tright:20px;\n\twidth:301px;\n\tz-index:9999;\n}\n#gritte"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/css/multiple-select.css",
    "chars": 4282,
    "preview": "/**\n * @author zhixin wen <wenzhixin2010@gmail.com>\n */\n\n.ms-parent {\n    display: inline-block;\n    position: relative;"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/css/select2.css",
    "chars": 19222,
    "preview": "/*\nVersion: 3.4.2 Timestamp: Mon Aug 12 15:04:12 PDT 2013\n*/\n.select2-container {\n    margin: 0;\n    position: relative;"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/css/ui.jqgrid.css",
    "chars": 12257,
    "preview": "/*Grid*/\n.ui-jqgrid {position: relative;}\n.ui-jqgrid .ui-jqgrid-view {position: relative;left:0; top: 0; padding: 0; fon"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/font/fonts.googleapis.com.css",
    "chars": 413,
    "preview": "@font-face {\n  font-family: 'Open Sans';\n  font-style: normal;\n  font-weight: 300;\n  src: local('Open Sans Light'), loca"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/js/fuelux/data/fuelux.tree-sampledata.js",
    "chars": 6711,
    "preview": "var DataSourceTree = function(options) {\n\tthis._data \t= options.data;\n\tthis._delay = options.delay;\n}\n\nDataSourceTree.pr"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/js/html5shiv.js",
    "chars": 9507,
    "preview": "/**\n* @preserve HTML5 Shiv tpl.6.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed\n*/\n;(function(window, document"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/js/jqGrid/i18n/grid.locale-en.js",
    "chars": 6611,
    "preview": ";(function($){\n/**\n * jqGrid English Translation\n * Tony Tomov tony@trirand.com\n * http://trirand.com/blog/ \n * Dual lic"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/js/jqGrid/jquery.jqGrid.src.js",
    "chars": 439890,
    "preview": "// ==ClosureCompiler==\n// @compilation_level SIMPLE_OPTIMIZATIONS\n\n/**\n * @license jqGrid  4.5.2 - jQuery Grid\n * Copyri"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/js/jquery.colorbox-min.js",
    "chars": 10894,
    "preview": "/*!\n\tColorbox v1.4.27 - 2013-07-16\n\tjQuery lightbox and modal window plugin\n\t(c) 2013 Jack Moore - http://www.jacklmoore"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/js/jquery.dataTables.bootstrap.js",
    "chars": 4113,
    "preview": "//http://datatables.net/plug-ins/pagination#bootstrap\n$.extend( true, $.fn.dataTable.defaults, {\n\t\"sDom\": \"<'row'<'col-s"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/js/jquery.form.js",
    "chars": 41023,
    "preview": "/*!\n * jQuery Form Plugin\n * version: 4.2.1\n * Requires jQuery v1.7 or later\n * Copyright 2017 Kevin Morris\n * Copyright"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/assets/js/multiple-select.js",
    "chars": 34149,
    "preview": "/**\n * @author zhixin wen <wenzhixin2010@gmail.com>\n * @version 1.2.1\n *\n * http://wenzhixin.net.cn/p/multiple-select/\n "
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/js/JGridUtils.js",
    "chars": 8884,
    "preview": "var  JGridUtils = function (){\n}\n\n//时间格式化的方式\nJGridUtils.dateTimeFormat = function(cellvalue, options, rowObject){\n    va"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/js/Nora.js",
    "chars": 2668,
    "preview": "/**\n * Nora工具包.<br>\n * 请放在jq后加载.\n */\n\nvar Nora = window.Nora || {\n\t/**\n\t * 返回整响应结果.\n\t * @param url\n\t * @param prams\n\t * "
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/js/core.js",
    "chars": 3754,
    "preview": "/** 自定占位符 **/\nString.prototype.format=function()  \n{  \n  if(arguments.length==0) return this;  \n  for(var s=this, i=0; i"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/js/echartUtils.js",
    "chars": 3152,
    "preview": "/**\n * \n */\n\n\tfunction initLine(divid,name,data,data2) {\n\t            require([ 'echarts', 'echarts/chart/line' // 使用柱状图"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/js/jquery.jsonEdit.js",
    "chars": 9270,
    "preview": "(function($){\n    $.fn.extend({\n        jsonEdit: function(options) {\n\n            //参数绑定\n            var params = {\n   "
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/static/v3/js/pom.js",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/templates/index.html",
    "chars": 231,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>Title</title>\n</head>\n<body>\nwelcome to do"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/templates/pages/tpl/bread.html",
    "chars": 1211,
    "preview": " <div class=\"breadcrumbs\" th:fragment=\"breader\" xmlns:th=\"http://www.thymeleaf.org\">\n     <script type=\"text/javascript\""
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/templates/pages/tpl/foot.html",
    "chars": 1303,
    "preview": "<div th:fragment=\"footer\" xmlns:th=\"http://www.thymeleaf.org\">\n\n        <!-- ace settings handler -->\n        <script th"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/templates/pages/tpl/head.html",
    "chars": 1179,
    "preview": "<div th:fragment=\"header\" xmlns:th=\"http://www.thymeleaf.org\">\n\n        <meta name=\"keywords\" content=\"Bootstrap模版,Boots"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/templates/pages/tpl/left.html",
    "chars": 4028,
    "preview": "<div class=\"sidebar\" id=\"sidebar\" th:fragment=\"lefter\" xmlns:th=\"http://www.thymeleaf.org\">\n    <script type=\"text/javas"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/templates/pages/tpl/top.html",
    "chars": 2342,
    "preview": "\n<div class=\"navbar navbar-default\" th:fragment=\"topper\" xmlns:th=\"http://www.thymeleaf.org\">\n    <script type=\"text/jav"
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/templates/pages/v3/addJar.html",
    "chars": 14611,
    "preview": "<!DOCTYPE html>\n<html xmlns:th=\"http://www.thymeleaf.org\">\n<head>\n    <meta charset=\"utf-8\" />\n    <title>Doe</title>\n  "
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/templates/pages/v3/caseCnt.html",
    "chars": 11389,
    "preview": "<!DOCTYPE html>\n<html xmlns:th=\"http://www.thymeleaf.org\">\n<head>\n    <meta charset=\"utf-8\" />\n    <title>Doe</title>\n  "
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/templates/pages/v3/easyCnt.html",
    "chars": 9808,
    "preview": "<!DOCTYPE html>\n<html xmlns:th=\"http://www.thymeleaf.org\">\n<head>\n    <meta charset=\"utf-8\" />\n    <title>Doe</title>\n  "
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/templates/pages/v3/editPom.html",
    "chars": 7764,
    "preview": "<!DOCTYPE html>\n<html xmlns:th=\"http://www.thymeleaf.org\">\n<head>\n    <meta charset=\"utf-8\" />\n    <title>Doe</title>\n  "
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/templates/pages/v3/listJar.html",
    "chars": 4072,
    "preview": "<!DOCTYPE html>\n<html xmlns:th=\"http://www.thymeleaf.org\">\n<head>\n    <meta charset=\"utf-8\" />\n    <title>Doe</title>\n  "
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/templates/pages/v3/listZk.html",
    "chars": 8228,
    "preview": "<!DOCTYPE html>\n<html xmlns:th=\"http://www.thymeleaf.org\">\n<head>\n    <meta charset=\"utf-8\" />\n    <title>Doe</title>\n  "
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/templates/pages/v3/normalCnt.html",
    "chars": 23226,
    "preview": "<!DOCTYPE html>\n<html xmlns:th=\"http://www.thymeleaf.org\">\n<head>\n    <meta charset=\"utf-8\" />\n    <title>Doe</title>\n  "
  },
  {
    "path": "mmc-dubbo-doe/src/main/resources/templates/pages/v3/sys.html",
    "chars": 4526,
    "preview": "<!DOCTYPE html>\n<html xmlns:th=\"http://www.thymeleaf.org\">\n<head>\n    <meta charset=\"utf-8\" />\n    <title>Doe</title>\n  "
  },
  {
    "path": "mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/DubboDoeApplicationTests.java",
    "chars": 424,
    "preview": "package com.mmc.dubbo.doe;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.boot.test"
  },
  {
    "path": "mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestCaseService.java",
    "chars": 1899,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestClassService.java",
    "chars": 2508,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestConfigService.java",
    "chars": 2702,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestConnectService.java",
    "chars": 2719,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestCuratorHandler.java",
    "chars": 2400,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestDemo.java",
    "chars": 2675,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestDoeClassLoader.java",
    "chars": 913,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestDoeClient.java",
    "chars": 2367,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestFuture.java",
    "chars": 1073,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestLogback.java",
    "chars": 576,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestNumber.java",
    "chars": 644,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestParam.java",
    "chars": 917,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestPomService.java",
    "chars": 5317,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestProcessClient.java",
    "chars": 1505,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestRedisResolver.java",
    "chars": 1258,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestRedisTemplate.java",
    "chars": 1246,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestTelnetService.java",
    "chars": 1575,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/test/java/com/mmc/dubbo/doe/test/TestTime.java",
    "chars": 2810,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-doe/src/test/resources/logback-spring.xml",
    "chars": 4792,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<configuration scan=\"true\" scanPeriod=\"60 seconds\" debug=\"false\">\n\n\n    <property"
  },
  {
    "path": "mmc-dubbo-doe/src/test/resources/test-pom.xml",
    "chars": 1308,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"htt"
  },
  {
    "path": "mmc-dubbo-provider/.gitignore",
    "chars": 49,
    "preview": "##ignore this file##\n.idea/\ntarget\ntarget/\n*.iml\n"
  },
  {
    "path": "mmc-dubbo-provider/pom.xml",
    "chars": 2792,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/"
  },
  {
    "path": "mmc-dubbo-provider/src/main/java/com/mmc/dubbo/provider/DubboProviderApplication.java",
    "chars": 495,
    "preview": "package com.mmc.dubbo.provider;\n\nimport com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo;\nimport org.sprin"
  },
  {
    "path": "mmc-dubbo-provider/src/main/java/com/mmc/dubbo/provider/user/UserFeedbackServiceImpl.java",
    "chars": 1846,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-provider/src/main/java/com/mmc/dubbo/provider/user/UserMemberServiceImpl.java",
    "chars": 1752,
    "preview": "/*\n * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.\n *\n * This software is the confidential and proprietary "
  },
  {
    "path": "mmc-dubbo-provider/src/main/resources/application.yml",
    "chars": 435,
    "preview": "# ====================server====================\nserver:\n  port: 8080\nspring:\n  application:\n    name: mmc-dubbo-provide"
  }
]

About this extraction

This page contains the full source code of the VIPJoey/doe GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 154 files (1.0 MB), approximately 302.2k tokens, and a symbol index with 566 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!