├── .gitignore ├── LICENSE ├── README.md ├── build.gradle ├── demo ├── demo-service │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── src │ │ ├── company.emf │ │ ├── company.sql │ │ ├── customer.emf │ │ ├── customer.sql │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── xx │ │ │ └── demo │ │ │ └── test │ │ │ ├── domain │ │ │ ├── CompanyQueryParam.java │ │ │ ├── CustomerQueryParam.java │ │ │ └── entity │ │ │ │ ├── CompanyEntity.java │ │ │ │ └── CustomerEntity.java │ │ │ ├── repository │ │ │ ├── CompanyRepository.java │ │ │ └── CustomerRepository.java │ │ │ └── service │ │ │ └── impl │ │ │ ├── CompanyServiceImpl.java │ │ │ └── CustomerServiceImpl.java │ │ └── resources │ │ ├── application.yml │ │ ├── esql │ │ └── e_init_ds.sql │ │ └── i18n │ │ └── test │ │ ├── company.properties │ │ ├── company_en_US.properties │ │ ├── company_zh_CN.properties │ │ ├── customer.properties │ │ ├── customer_en_US.properties │ │ └── customer_zh_CN.properties └── demo-ui │ ├── build.gradle │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── src │ └── main │ └── resources │ ├── application.yml │ └── static │ └── demo │ └── test │ ├── company_index.html │ └── customer_index.html ├── deploy.png ├── docker-compose.yaml ├── e-example ├── e-example-single │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── src │ │ └── main │ │ ├── docker │ │ ├── Dockerfile │ │ └── application.yml │ │ ├── java │ │ └── com │ │ │ └── loy │ │ │ └── SingleApplicationMain.java │ │ └── resources │ │ ├── application.yml │ │ ├── e_init_ds.sql │ │ ├── esql │ │ └── e_init_test.sql │ │ ├── keystore.jks │ │ └── logback.groovy └── e-micro-service │ ├── e-example-ms-db │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── lib │ │ ├── de.flapdoodle.embed.process-1.50.3-20160513.093141-4.jar │ │ ├── h2-1.4.193.jar │ │ ├── slf4j-api-1.7.21.jar │ │ └── spring-core-4.2.7.RELEASE.jar │ └── src │ │ └── main │ │ ├── docker │ │ └── Dockerfile │ │ ├── java │ │ └── com │ │ │ └── loy │ │ │ └── MainDb.java │ │ └── resources │ │ └── banner.txt │ ├── e-example-ms-demo │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── src │ │ └── main │ │ ├── docker │ │ ├── Dockerfile │ │ └── application.yml │ │ ├── java │ │ └── com │ │ │ └── loy │ │ │ ├── CloudDemoApplicationMain.java │ │ │ └── InitTestSql.java │ │ └── resources │ │ ├── application.yml │ │ ├── e_init_test.sql │ │ └── logback.groovy │ ├── e-example-ms-discovery │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── src │ │ └── main │ │ ├── docker │ │ ├── Dockerfile │ │ └── application.yml │ │ ├── java │ │ └── com │ │ │ └── loy │ │ │ └── DiscoveryApplicationMain.java │ │ └── resources │ │ └── application.yml │ ├── e-example-ms-gateway │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── src │ │ └── main │ │ ├── docker │ │ ├── Dockerfile │ │ └── application.yml │ │ ├── java │ │ └── com │ │ │ └── loy │ │ │ └── GatewayApplicationMain.java │ │ └── resources │ │ └── application.yml │ ├── e-example-ms-log │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── src │ │ └── main │ │ ├── docker │ │ ├── Dockerfile │ │ └── application.yml │ │ ├── java │ │ └── com │ │ │ └── loy │ │ │ └── LogApplicationMain.java │ │ └── resources │ │ ├── application.yml │ │ └── logback.groovy │ ├── e-example-ms-oauth2 │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── src │ │ └── main │ │ ├── docker │ │ ├── Dockerfile │ │ └── application.yml │ │ ├── java │ │ └── com │ │ │ └── loy │ │ │ └── ServiceAuthApplicationMain.java │ │ └── resources │ │ ├── application.yml │ │ ├── keystore.jks │ │ └── logback.groovy │ ├── e-example-ms-start-w │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── lib │ │ ├── de.flapdoodle.embed.process-1.50.3-20160513.093141-4.jar │ │ ├── h2-1.4.193.jar │ │ ├── jna.jar │ │ ├── platform.jar │ │ ├── slf4j-api-1.7.21.jar │ │ └── spring-core-4.2.7.RELEASE.jar │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── loy │ │ │ ├── EComposite.java │ │ │ ├── MainFrame.java │ │ │ ├── WriteLogThread.java │ │ │ └── ee.png │ │ └── resources │ │ ├── application.yml │ │ ├── banner.txt │ │ └── ee.png │ ├── e-example-ms-start │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── lib │ │ ├── de.flapdoodle.embed.process-1.50.3-20160513.093141-4.jar │ │ ├── h2-1.4.193.jar │ │ ├── jna.jar │ │ ├── platform.jar │ │ ├── slf4j-api-1.7.21.jar │ │ └── spring-core-4.2.7.RELEASE.jar │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── loy │ │ │ ├── EComposite.java │ │ │ ├── MicroServiceConsole.java │ │ │ ├── WriteLogThread.java │ │ │ └── ee.png │ │ └── resources │ │ ├── application.yml │ │ ├── banner.txt │ │ └── ee.png │ ├── e-example-ms-ui │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── src │ │ └── main │ │ ├── docker │ │ └── Dockerfile │ │ ├── java │ │ └── com │ │ │ └── loy │ │ │ └── UIApplicationMain.java │ │ └── resources │ │ └── application.yml │ └── e-example-ms-upm │ ├── build.gradle │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── src │ └── main │ ├── docker │ ├── Dockerfile │ └── application.yml │ ├── java │ └── com │ │ └── loy │ │ └── CloudUpmApplicationMain.java │ └── resources │ ├── application.yml │ ├── e_init_ds.sql │ └── logback.groovy ├── framework.png ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle ├── source.png ├── start-micro-service-w.bat ├── start-micro-service.bat └── start-single-service.bat /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | 3 | */bin/ 4 | 5 | target/ 6 | build/ 7 | logs/ 8 | *.gradle/ 9 | # eclipse ignore 10 | .settings/ 11 | .project 12 | .classpath 13 | *.lock 14 | *.bak 15 | 16 | # temp ignore 17 | *.log 18 | *.cache 19 | *.diff 20 | *.patch 21 | *.tmp -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |  2 | # 项目演示地址 3 | [微服务演示](http://119.91.216.125); QQ交流群: 204690448 540553957 4 | # 目的 5 | E框架的目的是让开发不必从零开始开发,让开发者只关注自己的业务功能。 6 | # 技术说明 7 | * 框架采用微服务的设计思想,而且各工程易分易合 8 | * 此框架采用前后台分开,前后台都可以单独部署,前端采用轻量级的扁平化设计(html+javascript+Bootstrap), 会自动针对不同的屏幕尺寸调整页面,使其在各个尺寸的屏幕上表现良好。 9 | * 后端采用Spring boot 、 Spring Cloud,不需要部署WAR 文件,可直接运行jar文件。 10 | * 系统权限框架采用spring-security oauth2,实现前后台权限校验,权限实现了用户授权和客户端授权。 11 | * 持久层采用JPA ,能够很好的适应不同数据库,并实现注解式动态查询功能。 12 | * 数据响应该采用json格式。 13 | * 服务采用REST形式,能够方便的与手机app进行对接,集成swagger能够在线查看RESTAPI 文档和在线测试服务接口 14 | * 支持单点登录,可以多系统进行菜单集成,形成一个portal。 15 | * 支持高并发和水平扩展,支持Session的统一存储。 16 | * 项目采用gradle构建,能够方便的将各项目进行按需组装。 17 | 18 | ## 构建须知 19 | * 设好jdk环境变量,项目需要jdk8,项目编码和数据库编码都采用UTF-8 20 | * 输出日志在eclipse下有乱码可以通过设置项目下的logback.groovy文件中日志编码为UTF-8来解决 21 | * 项目默认用到8080端口,请检查8080端口是否被占用 22 | * 为了演示方便默认数据库设为了H2数据库,演示时不用做数据库相关的任何设置,按照构建说明进行就可以了 23 | * 系统默认用户名密码分别为 admin 123456 24 | * 实际可设为mysql,修改resources\application.yml文件的数据库相关设置为实际值,建库建表数据初始化都会自动进行 25 | * 详细构建可看QQ群中的构建视频(E构建) 26 | 27 | ##### 单体服务构建 28 | 29 | * 运行start-single-service.bat 文件,这里需要等待下载相关jar包 30 | * 构建成功后在浏览器中输入http://localhost:8080 进入页面 31 | 32 | ##### 微服务构建 33 | 34 | * 在e目录下运行gradlew build ,成功后进行下一步 35 | * 在e目录下运行start-micro-service,也可以运行start-micro-service-w(启动Swing界面,可方便查看各项目日志); 36 | * 此运行方式只作演示与快速启动,实际部署、启动根据自己需求作相应调整 37 | * 运行成功后在浏览器中输入http://localhost:8080 进入页面 38 | 39 | # 开发环境 40 | 41 | ## eclipse 42 | 43 | * 直接在e目录下运行gradlew eclipse 生成eclipse项目;导入e目录;运行e-example-single项目下的SingleApplicationMain文件;进入http://localhost:8080; 44 | * 多系统启动可按下面顺序来启动各项目,最好等前一个项目启动完后再启动下一下项目 45 | 46 | - e-example-ms-db 47 | - e-example-ms-discovery 48 | - e-example-ms-upm 49 | - e-example-ms-oauth2 50 | - e-example-ms-log 51 | - e-example-ms-demo 52 | - e-example-ms-ui 53 | - e-example-ms-gateway 54 | 55 | ## idea 56 | 57 | * 直接在e目录下运行gradlew eclipse 生成eclipse项目;导入e目录;运行SingleApplicationMain文件;进入http://localhost:8080; 58 | 59 | # 开发说明 60 | 61 | * 一般情况每个具体的子项目由两工程组成,一个是UI,一个是Service 目录结构如 62 | * demo 63 | * |_ demo-ui 64 | * |_ demo-service 65 | * 66 | * 可以象例子中那样根据需要把子工程组装起来 67 | * 开发时尽量在自己的代码中扩展功能和替换原来的功能,而不是修改框架代码本身,以便于今后升级方便 68 | 69 | # 框架结构 70 | ![](framework.png) 71 | 72 | # 部署示例 73 | ![](deploy.png) 74 | 75 | # 关于源码 76 | 框架本身源码是以jar的形式提供,在生成eclipse项目时会自动从maven库上下载,可以在开发工具中查看源码和debug。也可以在http://search.maven.org 上搜索com.17jee来查询框架代码 77 | 78 | ![](source.png) 79 | 80 | # 关于修改主页信息(以e-example-single工程为例) 81 | 82 | * 1.只修改主页上的文字:可以在e-example-single工程src/main/resources下新建 i18n  包,将e-core-3.0.1.5.jar 下面 i18n 下的 .properties文件拷贝到新建的i18n下去做修改。 83 | * 2.修改主页文件:可以在e-example-single工程src/main/resources下新建 static 文件夹,将e-core-static-3.0.1.5.jar 下面 public 下的 home_tabs.html文件拷贝到新建的static下进行修改。 84 | * 3.修改主页文件:可以通过修改e-example-single工程下的配置文件application.yml 的e.conf.homePage来指定自己主页; 85 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | springBootVersion = "${springBootVersion}" 4 | } 5 | repositories { 6 | maven { url "http://maven.aliyun.com/nexus/content/groups/public" } 7 | maven { url "http://repo2.maven.org/maven2" } 8 | } 9 | dependencies { 10 | classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 11 | classpath ("com.bmuschko:gradle-docker-plugin:3.0.3") 12 | } 13 | } 14 | 15 | apply plugin:'groovy' 16 | 17 | repositories { 18 | maven { url "http://maven.aliyun.com/nexus/content/groups/public" } 19 | maven { url "http://repo2.maven.org/maven2" } 20 | } 21 | 22 | allprojects { 23 | repositories { 24 | maven { url "http://maven.aliyun.com/nexus/content/groups/public" } 25 | maven { url "http://repo2.maven.org/maven2" } 26 | } 27 | 28 | } 29 | 30 | subprojects { 31 | apply plugin:'groovy' 32 | apply plugin: 'maven' 33 | apply plugin: 'signing' 34 | 35 | dependencies { 36 | compile "org.codehaus.groovy:groovy-all:${groovyVersion}" 37 | } 38 | tasks.withType(JavaCompile) { 39 | options.encoding = "UTF-8" 40 | } 41 | repositories { 42 | maven { url "http://maven.aliyun.com/nexus/content/groups/public" } 43 | maven { url "http://repo2.maven.org/maven2" } 44 | 45 | } 46 | jar { 47 | manifest { 48 | attributes("Implementation-Title": project.name, 49 | "Implementation-Vendor": project.group, 50 | "Created-By": project.group, 51 | "Implementation-Version": project.version) 52 | } 53 | } 54 | 55 | 56 | tasks.withType(JavaCompile) { 57 | options.encoding = "UTF-8" 58 | } 59 | task wrapper(type: Wrapper) { 60 | gradleVersion = "${gradleVersion}" 61 | } 62 | 63 | 64 | } 65 | task startSingleService(dependsOn: 'e-example:e-example-single:erun') << { 66 | 67 | } 68 | task eclean() << { 69 | allprojects.each{ 70 | def o = new File(it.projectDir,".project"); 71 | o.delete() 72 | o = new File(it.projectDir,"bin"); 73 | o.deleteDir() 74 | o = new File(it.projectDir,".settings"); 75 | o.deleteDir() 76 | o = new File(it.projectDir,"build.gradle.bak"); 77 | o.delete() 78 | o = new File(it.projectDir,"logs"); 79 | o.deleteDir() 80 | o = new File(it.projectDir,"build"); 81 | o.deleteDir() 82 | o = new File(it.projectDir,".classpath"); 83 | o.delete() 84 | o = new File(it.projectDir,".factorypath"); 85 | o.delete() 86 | o = new File(it.projectDir,".apt_generated"); 87 | o.deleteDir() 88 | o = new File(it.projectDir,".metadata"); 89 | o.deleteDir() 90 | o = new File(it.projectDir,"pids"); 91 | o.deleteDir() 92 | 93 | } 94 | } -------------------------------------------------------------------------------- /demo/demo-service/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java" 2 | apply plugin: "eclipse" 3 | apply plugin: "idea" 4 | jar { 5 | baseName = "demo-service" 6 | } 7 | 8 | dependencies { 9 | compile ("com.17jee:e-core:${eversion}") 10 | compile ("com.17jee:e-basic-data:${eversion}") 11 | compile ("com.17jee:e-data-permission:${eversion}") 12 | compile ("io.springfox:springfox-swagger2:${springfoxSwaggerVersion}") 13 | compile ("org.springframework.boot:spring-boot-starter-web:${springBootVersion}") 14 | runtime ("mysql:mysql-connector-java:${mysqlVersion}") 15 | } 16 | -------------------------------------------------------------------------------- /demo/demo-service/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/demo/demo-service/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /demo/demo-service/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Aug 26 08:51:35 CST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip 7 | -------------------------------------------------------------------------------- /demo/demo-service/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /demo/demo-service/src/company.emf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 公司 4 | CompanyEntity 5 | 6 | true 7 | false 8 | true 9 | String 10 | String 11 | 名称 12 | true 13 | true 14 | false 15 | name 16 | false 17 | true 18 | true 19 | true 20 | like 21 | true 22 | 23 | 24 | true 25 | false 26 | false 27 | Integer 28 | Integer 29 | 注册资金(万元) 30 | true 31 | true 32 | false 33 | registeredCapital 34 | false 35 | true 36 | true 37 | false 38 | = 39 | true 40 | 41 | 42 | true 43 | true 44 | true 45 | Date 46 | Date 47 | 注册日期 48 | true 49 | true 50 | false 51 | registerDate 52 | false 53 | true 54 | true 55 | false 56 | >=,<= 57 | true 58 | 59 | 60 | true 61 | false 62 | false 63 | String 64 | String 65 | 联系人 66 | true 67 | true 68 | false 69 | contactName 70 | false 71 | true 72 | true 73 | false 74 | = 75 | true 76 | 77 | 78 | true 79 | false 80 | true 81 | String 82 | String 83 | 电话号码 84 | true 85 | true 86 | false 87 | phone 88 | false 89 | true 90 | true 91 | false 92 | like 93 | true 94 | 95 | 96 | true 97 | false 98 | false 99 | String 100 | String 101 | 地址 102 | true 103 | true 104 | false 105 | address 106 | false 107 | true 108 | true 109 | false 110 | = 111 | true 112 | 113 | com.xx.demo.test 114 | Company 115 | CompanyQueryParam 116 | CompanyRepository 117 | CompanyServiceImpl 118 | demo_company 119 | 120 | -------------------------------------------------------------------------------- /demo/demo-service/src/company.sql: -------------------------------------------------------------------------------- 1 | 2 | INSERT INTO e_resource (id,created_time,creator_id,modified_time,modifier_id,available,name,parent_id,permission,resource_type,url,cls,lable_key,sort_num,access_code,system_id) VALUES ('com_xx_demo_test_company',NULL,NULL,NULL,NULL,1,'公司','demo',NULL,'MENU','demo-ui/demo/test/company_index.html','menu-icon fa fa-caret-right','menu.demo.test.company_manage',20,NULL,'demo'); 3 | 4 | INSERT INTO e_menu_i18n (id,key_,lang_,value_,system_code) VALUES ('menu.demo.test.company_manage','menu.demo.test.company_manage','','公司管理','demo'); 5 | INSERT INTO e_menu_i18n (id,key_,lang_,value_,system_code) VALUES ('menu.demo.test.company_manage_zh_CN','menu.demo.test.company_manage','zh_CN','公司管理','demo'); 6 | INSERT INTO e_menu_i18n (id,key_,lang_,value_,system_code) VALUES ('menu.demo.test.company_manage_en_US','menu.demo.test.company_manage','en_US','Company MGT','demo'); 7 | 8 | 9 | INSERT INTO e_resource (id,created_time,creator_id,modified_time,modifier_id,available,name,parent_id,permission,resource_type,url,cls,lable_key,sort_num,access_code,system_id) VALUES ('com_xx_demo_test_company_add',NULL,NULL,NULL,NULL,1,'新增','com_xx_demo_test_company',NULL,'BUTTON','company/save',NULL,'menu.add',NULL,'company:save','demo'); 10 | INSERT INTO e_resource (id,created_time,creator_id,modified_time,modifier_id,available,name,parent_id,permission,resource_type,url,cls,lable_key,sort_num,access_code,system_id) VALUES ('com_xx_demo_test_company_edit',NULL,NULL,NULL,NULL,1,'编辑','com_xx_demo_test_company',NULL,'BUTTON','company/update',NULL,'menu.edit',NULL,'company:update','demo'); 11 | INSERT INTO e_resource (id,created_time,creator_id,modified_time,modifier_id,available,name,parent_id,permission,resource_type,url,cls,lable_key,sort_num,access_code,system_id) VALUES ('com_xx_demo_test_company_delete',NULL,NULL,NULL,NULL,1,'删除','com_xx_demo_test_company',NULL,'BUTTON','company/delete',NULL,'menu.delete',NULL,'company:delete','demo'); -------------------------------------------------------------------------------- /demo/demo-service/src/customer.sql: -------------------------------------------------------------------------------- 1 | 2 | INSERT INTO e_resource (id,created_time,creator_id,modified_time,modifier_id,available,name,parent_id,permission,resource_type,url,cls,lable_key,sort_num,access_code,system_id) VALUES ('com_xx_demo_test_customer',NULL,NULL,NULL,NULL,1,'客户','demo',NULL,'MENU','demo-ui/demo/test/customer_index.html','menu-icon fa fa-caret-right','menu.demo.test.customer_manage',20,NULL,'demo'); 3 | 4 | INSERT INTO e_menu_i18n (id,key_,lang_,value_,system_code) VALUES ('menu.demo.test.customer_manage','menu.demo.test.customer_manage','','客户管理','demo'); 5 | INSERT INTO e_menu_i18n (id,key_,lang_,value_,system_code) VALUES ('menu.demo.test.customer_manage_zh_CN','menu.demo.test.customer_manage','zh_CN','客户管理','demo'); 6 | INSERT INTO e_menu_i18n (id,key_,lang_,value_,system_code) VALUES ('menu.demo.test.customer_manage_en_US','menu.demo.test.customer_manage','en_US','Customer MGT','demo'); 7 | 8 | 9 | INSERT INTO e_resource (id,created_time,creator_id,modified_time,modifier_id,available,name,parent_id,permission,resource_type,url,cls,lable_key,sort_num,access_code,system_id) VALUES ('com_xx_demo_test_customer_add',NULL,NULL,NULL,NULL,1,'新增','com_xx_demo_test_customer',NULL,'BUTTON','customer/save',NULL,'menu.add',NULL,'customer:save','demo'); 10 | INSERT INTO e_resource (id,created_time,creator_id,modified_time,modifier_id,available,name,parent_id,permission,resource_type,url,cls,lable_key,sort_num,access_code,system_id) VALUES ('com_xx_demo_test_customer_edit',NULL,NULL,NULL,NULL,1,'编辑','com_xx_demo_test_customer',NULL,'BUTTON','customer/update',NULL,'menu.edit',NULL,'customer:update','demo'); 11 | INSERT INTO e_resource (id,created_time,creator_id,modified_time,modifier_id,available,name,parent_id,permission,resource_type,url,cls,lable_key,sort_num,access_code,system_id) VALUES ('com_xx_demo_test_customer_delete',NULL,NULL,NULL,NULL,1,'删除','com_xx_demo_test_customer',NULL,'BUTTON','customer/delete',NULL,'menu.delete',NULL,'customer:delete','demo'); -------------------------------------------------------------------------------- /demo/demo-service/src/main/java/com/xx/demo/test/domain/CompanyQueryParam.java: -------------------------------------------------------------------------------- 1 | package com.xx.demo.test.domain; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.format.annotation.DateTimeFormat; 6 | 7 | import com.loy.e.data.permission.data.DefaultDataPermissionQueryParam; 8 | 9 | /** 10 | * 11 | * @author Loy Fu qq群 540553957 website = http://www.17jee.com 12 | */ 13 | public class CompanyQueryParam extends DefaultDataPermissionQueryParam { 14 | private String name; 15 | @DateTimeFormat(pattern = "yyyy-MM-dd") 16 | private Date registerDateStart; 17 | @DateTimeFormat(pattern = "yyyy-MM-dd") 18 | private Date registerDateEnd; 19 | private String phone; 20 | 21 | String orderProperty = ""; 22 | 23 | String direction = ""; 24 | 25 | public String getOrderProperty() { 26 | return orderProperty; 27 | } 28 | 29 | public void setOrderProperty(String orderProperty) { 30 | this.orderProperty = orderProperty; 31 | } 32 | 33 | public String getDirection() { 34 | return direction; 35 | } 36 | 37 | public void setDirection(String direction) { 38 | this.direction = direction; 39 | } 40 | 41 | public String getName() { 42 | return name; 43 | } 44 | 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | public Date getRegisterDateStart() { 50 | return registerDateStart; 51 | } 52 | 53 | public void setRegisterDateStart(Date registerDateStart) { 54 | this.registerDateStart = registerDateStart; 55 | } 56 | 57 | public Date getRegisterDateEnd() { 58 | return registerDateEnd; 59 | } 60 | 61 | public void setRegisterDateEnd(Date registerDateEnd) { 62 | this.registerDateEnd = registerDateEnd; 63 | } 64 | 65 | public String getPhone() { 66 | return phone; 67 | } 68 | 69 | public void setPhone(String phone) { 70 | this.phone = phone; 71 | } 72 | } -------------------------------------------------------------------------------- /demo/demo-service/src/main/java/com/xx/demo/test/domain/CustomerQueryParam.java: -------------------------------------------------------------------------------- 1 | package com.xx.demo.test.domain; 2 | 3 | import java.util.Date; 4 | 5 | import org.springframework.format.annotation.DateTimeFormat; 6 | 7 | import com.loy.e.core.query.data.QueryParam; 8 | import com.loy.e.data.permission.data.DefaultDataPermissionQueryParam; 9 | 10 | /** 11 | * 12 | * @author Loy Fu qq群 540553957 website = http://www.17jee.com 13 | */ 14 | public class CustomerQueryParam extends DefaultDataPermissionQueryParam implements QueryParam { 15 | private String name; 16 | private String sexId; 17 | private Boolean vip; 18 | @DateTimeFormat(pattern="yyyy-MM-dd") 19 | private Date dobStart; 20 | @DateTimeFormat(pattern="yyyy-MM-dd") 21 | private Date dobEnd; 22 | private String phone; 23 | 24 | public String getName() { 25 | return name; 26 | } 27 | 28 | public void setName(String name) { 29 | this.name = name; 30 | } 31 | 32 | public String getSexId() { 33 | return sexId; 34 | } 35 | 36 | public void setSexId(String sexId) { 37 | this.sexId = sexId; 38 | } 39 | 40 | public Boolean getVip() { 41 | return vip; 42 | } 43 | 44 | public void setVip(Boolean vip) { 45 | this.vip = vip; 46 | } 47 | 48 | public Date getDobStart() { 49 | return dobStart; 50 | } 51 | 52 | public void setDobStart(Date dobStart) { 53 | this.dobStart = dobStart; 54 | } 55 | 56 | public Date getDobEnd() { 57 | return dobEnd; 58 | } 59 | 60 | public void setDobEnd(Date dobEnd) { 61 | this.dobEnd = dobEnd; 62 | } 63 | 64 | public String getPhone() { 65 | return phone; 66 | } 67 | 68 | public void setPhone(String phone) { 69 | this.phone = phone; 70 | } 71 | } -------------------------------------------------------------------------------- /demo/demo-service/src/main/java/com/xx/demo/test/domain/entity/CompanyEntity.java: -------------------------------------------------------------------------------- 1 | package com.xx.demo.test.domain.entity; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Entity; 5 | import javax.persistence.Table; 6 | 7 | import com.loy.e.core.entity.BaseEntity; 8 | import java.util.Date; 9 | import org.springframework.format.annotation.DateTimeFormat; 10 | /** 11 | * 12 | * @author Loy Fu qq群 540553957 website = http://www.17jee.com 13 | */ 14 | 15 | @Entity 16 | @Table(name = "demo_company") 17 | public class CompanyEntity extends BaseEntity { 18 | private static final long serialVersionUID = 1L; 19 | @Column( nullable=true) 20 | private String name; 21 | @Column( nullable=true) 22 | private Integer registeredCapital; 23 | @Column( nullable=true) 24 | @DateTimeFormat(pattern="yyyy-MM-dd") 25 | private Date registerDate; 26 | @Column( nullable=true) 27 | private String contactName; 28 | @Column( nullable=true) 29 | private String phone; 30 | @Column( nullable=true) 31 | private String address; 32 | public String getName() { 33 | return name; 34 | } 35 | 36 | public void setName(String name) { 37 | this.name = name; 38 | } 39 | public Integer getRegisteredCapital() { 40 | return registeredCapital; 41 | } 42 | 43 | public void setRegisteredCapital(Integer registeredCapital) { 44 | this.registeredCapital = registeredCapital; 45 | } 46 | public Date getRegisterDate() { 47 | return registerDate; 48 | } 49 | 50 | public void setRegisterDate(Date registerDate) { 51 | this.registerDate = registerDate; 52 | } 53 | public String getContactName() { 54 | return contactName; 55 | } 56 | 57 | public void setContactName(String contactName) { 58 | this.contactName = contactName; 59 | } 60 | public String getPhone() { 61 | return phone; 62 | } 63 | 64 | public void setPhone(String phone) { 65 | this.phone = phone; 66 | } 67 | public String getAddress() { 68 | return address; 69 | } 70 | 71 | public void setAddress(String address) { 72 | this.address = address; 73 | } 74 | } -------------------------------------------------------------------------------- /demo/demo-service/src/main/java/com/xx/demo/test/domain/entity/CustomerEntity.java: -------------------------------------------------------------------------------- 1 | package com.xx.demo.test.domain.entity; 2 | 3 | import javax.persistence.Column; 4 | import javax.persistence.Entity; 5 | import javax.persistence.Table; 6 | 7 | import com.loy.e.core.entity.BaseEntity; 8 | import javax.persistence.ManyToOne; 9 | import com.xx.demo.test.domain.entity.CompanyEntity; 10 | import java.util.Date; 11 | import com.loy.e.basic.data.domain.entity.DictionaryEntity; 12 | import org.springframework.format.annotation.DateTimeFormat; 13 | /** 14 | * 15 | * @author Loy Fu qq群 540553957 website = http://www.17jee.com 16 | */ 17 | 18 | @Entity 19 | @Table(name = "demo_customer") 20 | public class CustomerEntity extends BaseEntity { 21 | private static final long serialVersionUID = 1L; 22 | @Column( nullable=true) 23 | private String name; 24 | @ManyToOne() 25 | private DictionaryEntity sex; 26 | @ManyToOne() 27 | private CompanyEntity company; 28 | @Column( nullable=true) 29 | private Boolean vip = false; 30 | @Column( nullable=true) 31 | @DateTimeFormat(pattern="yyyy-MM-dd") 32 | private Date dob; 33 | @Column( nullable=true) 34 | private String phone; 35 | @Column( nullable=true) 36 | private String address; 37 | public String getName() { 38 | return name; 39 | } 40 | 41 | public void setName(String name) { 42 | this.name = name; 43 | } 44 | public DictionaryEntity getSex() { 45 | return sex; 46 | } 47 | 48 | public void setSex(DictionaryEntity sex) { 49 | this.sex = sex; 50 | } 51 | public CompanyEntity getCompany() { 52 | return company; 53 | } 54 | 55 | public void setCompany(CompanyEntity company) { 56 | this.company = company; 57 | } 58 | public Boolean getVip() { 59 | return vip; 60 | } 61 | 62 | public void setVip(Boolean vip) { 63 | this.vip = vip; 64 | } 65 | public Date getDob() { 66 | return dob; 67 | } 68 | 69 | public void setDob(Date dob) { 70 | this.dob = dob; 71 | } 72 | public String getPhone() { 73 | return phone; 74 | } 75 | 76 | public void setPhone(String phone) { 77 | this.phone = phone; 78 | } 79 | public String getAddress() { 80 | return address; 81 | } 82 | 83 | public void setAddress(String address) { 84 | this.address = address; 85 | } 86 | } -------------------------------------------------------------------------------- /demo/demo-service/src/main/java/com/xx/demo/test/repository/CompanyRepository.java: -------------------------------------------------------------------------------- 1 | package com.xx.demo.test.repository; 2 | 3 | import org.springframework.data.jpa.repository.Query; 4 | import com.loy.e.core.query.annotation.DynamicQuery; 5 | import com.xx.demo.test.domain.entity.CompanyEntity; 6 | import com.xx.demo.test.domain.CompanyQueryParam; 7 | import org.springframework.data.domain.Pageable; 8 | import org.springframework.data.domain.Page; 9 | import com.loy.e.core.repository.GenericRepository; 10 | 11 | /** 12 | * 13 | * @author Loy Fu qq群 540553957 website = http://www.17jee.com 14 | */ 15 | public interface CompanyRepository extends GenericRepository { 16 | 17 | @Query(value=" from CompanyEntity x where 1=1 ${permissionQL} and x.name like '%${name}%' and x.registerDate >= :registerDateStart and x.registerDate <= :registerDateEnd and x.phone like '%${phone}%' order by x.${orderProperty} ${direction} ") 18 | @DynamicQuery 19 | Page findCompanyPage(CompanyQueryParam companyQueryParam, Pageable pageable); 20 | 21 | } -------------------------------------------------------------------------------- /demo/demo-service/src/main/java/com/xx/demo/test/repository/CustomerRepository.java: -------------------------------------------------------------------------------- 1 | package com.xx.demo.test.repository; 2 | 3 | import org.springframework.data.jpa.repository.Query; 4 | import com.loy.e.core.query.annotation.DynamicQuery; 5 | import com.xx.demo.test.domain.entity.CustomerEntity; 6 | import org.springframework.data.domain.Pageable; 7 | import com.xx.demo.test.domain.CustomerQueryParam; 8 | import org.springframework.data.domain.Page; 9 | import com.loy.e.core.repository.GenericRepository; 10 | 11 | /** 12 | * 13 | * @author Loy Fu qq群 540553957 website = http://www.17jee.com 14 | */ 15 | public interface CustomerRepository extends GenericRepository { 16 | 17 | @Query(value=" from CustomerEntity x where 1=1 and x.name like '%${name}%' and x.sex.id = :sexId and x.vip = :vip and x.dob >= :dobStart and x.dob <= :dobEnd and x.phone like '%${phone}%' ") 18 | @DynamicQuery 19 | Page findCustomerPage(CustomerQueryParam customerQueryParam, Pageable pageable); 20 | 21 | } -------------------------------------------------------------------------------- /demo/demo-service/src/main/java/com/xx/demo/test/service/impl/CompanyServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.xx.demo.test.service.impl; 2 | 3 | import java.io.IOException; 4 | import java.io.OutputStream; 5 | import java.util.Date; 6 | 7 | import javax.servlet.http.HttpServletResponse; 8 | 9 | import org.apache.commons.lang.ArrayUtils; 10 | import org.apache.commons.lang.StringUtils; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.data.domain.Page; 13 | import org.springframework.data.domain.Pageable; 14 | import org.springframework.transaction.annotation.Transactional; 15 | import org.springframework.web.bind.annotation.RequestMapping; 16 | import org.springframework.web.bind.annotation.RequestMethod; 17 | import org.springframework.web.bind.annotation.RestController; 18 | 19 | import com.loy.e.common.util.DateUtil; 20 | import com.loy.e.core.annotation.ControllerLogExeTime; 21 | import com.loy.e.core.query.Direction; 22 | import com.loy.e.core.util.TableToExcelUtil; 23 | import com.loy.e.data.permission.annotation.DataPermission; 24 | import com.xx.demo.test.domain.CompanyQueryParam; 25 | import com.xx.demo.test.domain.entity.CompanyEntity; 26 | import com.xx.demo.test.repository.CompanyRepository; 27 | /** 28 | * 29 | * @author Loy Fu qq群 540553957 website = http://www.17jee.com 30 | */ 31 | @RestController 32 | @RequestMapping(value={"**/company"}, method={RequestMethod.POST, RequestMethod.GET}) 33 | @Transactional 34 | public class CompanyServiceImpl{ 35 | 36 | @Autowired 37 | CompanyRepository companyRepository; 38 | @RequestMapping({ "/page" }) 39 | @ControllerLogExeTime(description = "分页查询公司", log = false) 40 | @DataPermission(uniqueKey="CompanyServiceImpl.queryPage",findAll=true) 41 | public Page queryPage(CompanyQueryParam companyQueryParam, Pageable pageable) { 42 | if (companyQueryParam != null) { 43 | processSort(companyQueryParam); 44 | Date registerDateEnd = companyQueryParam.getRegisterDateEnd(); 45 | if (registerDateEnd != null) { 46 | registerDateEnd = DateUtil.addOneDay(registerDateEnd); 47 | companyQueryParam.setRegisterDateEnd(registerDateEnd); 48 | } 49 | } 50 | Page page = this.companyRepository.findCompanyPage((companyQueryParam), pageable); 51 | return page; 52 | } 53 | 54 | 55 | @ControllerLogExeTime(description="获取公司", log=false) 56 | @RequestMapping({"/get"}) 57 | public CompanyEntity get(String id) { 58 | CompanyEntity companyEntity = (CompanyEntity)this.companyRepository.get(id); 59 | return companyEntity; 60 | } 61 | @ControllerLogExeTime(description="查看公司", log=false) 62 | @RequestMapping({"/detail"}) 63 | public CompanyEntity detail(String id) { 64 | CompanyEntity companyEntity = (CompanyEntity)this.companyRepository.get(id); 65 | return companyEntity; 66 | } 67 | @ControllerLogExeTime(description="删除公司") 68 | @RequestMapping({"/del"}) 69 | public void del(String id) { 70 | if (StringUtils.isNotEmpty(id)) { 71 | String[] idsArr = id.split(","); 72 | if (idsArr != null) { 73 | for (String idd : idsArr) { 74 | CompanyEntity companyEntity = (CompanyEntity)this.companyRepository.get(idd); 75 | if (companyEntity != null) { 76 | this.companyRepository.delete(companyEntity); 77 | } 78 | } 79 | } 80 | } 81 | } 82 | 83 | @RequestMapping({"/save"}) 84 | @ControllerLogExeTime(description="保存公司") 85 | public CompanyEntity save(CompanyEntity companyEntity) { 86 | companyEntity.setId(null); 87 | this.companyRepository.save(companyEntity); 88 | return companyEntity; 89 | } 90 | @RequestMapping({"/update"}) 91 | @ControllerLogExeTime(description="修改公司") 92 | public void update(CompanyEntity companyEntity) { 93 | this.companyRepository.save(companyEntity); 94 | } 95 | 96 | 97 | @RequestMapping(value={"/excel"}, method={RequestMethod.POST}) 98 | @ControllerLogExeTime(description="导出公司", log=false) 99 | public void excel(String html, HttpServletResponse response) throws IOException { 100 | response.setContentType("application/msexcel;charset=UTF-8"); 101 | response.addHeader("Content-Disposition", "attachment;filename=companys.xls"); 102 | OutputStream out = response.getOutputStream(); 103 | TableToExcelUtil.createExcelFormTable("company", html, 1, out); 104 | out.flush(); 105 | out.close(); 106 | } 107 | private void processSort(CompanyQueryParam companyQueryParam){ 108 | String orderProperity = companyQueryParam.getOrderProperty(); 109 | if (StringUtils.isNotEmpty(orderProperity)) { 110 | String[] orderProperties = {"registerDate"}; 111 | if (ArrayUtils.contains(orderProperties, orderProperity)) { 112 | String direction = companyQueryParam.getDirection(); 113 | if ((!Direction.ASC.getInfo().equalsIgnoreCase(direction)) && 114 | (!Direction.DESC.getInfo().equalsIgnoreCase(direction))) { 115 | companyQueryParam.setDirection(Direction.DESC.getInfo()); 116 | } 117 | } 118 | }else { 119 | companyQueryParam.setOrderProperty(""); 120 | companyQueryParam.setDirection(""); 121 | } 122 | } 123 | } -------------------------------------------------------------------------------- /demo/demo-service/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | e: 2 | conf: 3 | authServer: http://localhost:9999/uaa 4 | loyAspect: true 5 | defaultLocale: zh_CN 6 | debugPageResult: false 7 | recordOperateLog: true 8 | ignoreJsonResponseUrls: 9 | - /configuration/ui 10 | - /swagger-resources 11 | - /v2/api-docs 12 | - /configuration/security 13 | - /model/*/json 14 | - /model/*/save 15 | - /editor/stencilset 16 | 17 | 18 | apiInfo: 19 | title: E-框架 REST API 20 | description: 21 | version: 2.0.0 22 | termsOfServiceUrl: 23 | contact: 24 | name: Loy Fu 25 | url: http://www.17jee.com 26 | email: 21549322@qq.com 27 | license: 28 | licenseUrl: 29 | pathsRegex: ^.*(? \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /demo/demo-ui/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /demo/demo-ui/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | e: 2 | conf: 3 | attachmentBaseDirectory : ./upload 4 | defaultLocale: zh_CN 5 | supportLocales: 6 | - en_US 7 | - zh_CN 8 | defaultPage: readme.html 9 | 10 | staticMappings: 11 | /demo-ui/**: 12 | - classpath:/static/ 13 | 14 | spring: 15 | application: 16 | name: demo-ui 17 | 18 | server: 19 | port: 39090 20 | tomcat: 21 | uri-encoding: UTF-8 22 | 23 | eureka: 24 | client: 25 | serviceUrl: 26 | defaultZone: http://localhost:8761/eureka/ # 指定注册中心的地址 27 | instance: 28 | preferIpAddress: true 29 | 30 | 31 | logging: 32 | path: ./logs 33 | file: ./logs/demo-ui.log 34 | 35 | 36 | -------------------------------------------------------------------------------- /deploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/deploy.png -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | db: 2 | image: com.loy/db:latest 3 | ports: 4 | - 9092:9092 5 | 6 | discovery: 7 | image: com.loy/discovery:latest 8 | ports: 9 | - 8761:8761 10 | upm: 11 | image: com.loy/upm:latest 12 | ports: 13 | - 18080:18080 14 | links: 15 | - discovery:discovery 16 | - db:db 17 | - oauth:oauth 18 | 19 | 20 | oauth: 21 | image: com.loy/oauth2:latest 22 | ports: 23 | - 9999:9999 24 | environment: 25 | - e.conf.loginSuccessUrl=http://192.168.88.128:8080/ 26 | links: 27 | - discovery:discovery 28 | - db:db 29 | log: 30 | image: com.loy/log:latest 31 | ports: 32 | - 28080:28080 33 | links: 34 | - oauth:oauth 35 | - discovery:discovery 36 | - db:db 37 | 38 | demo: 39 | image: com.loy/demo:latest 40 | ports: 41 | - 38080:38080 42 | links: 43 | - oauth:oauth 44 | - discovery:discovery 45 | - db:db 46 | 47 | ui: 48 | image: com.loy/ui:latest 49 | ports: 50 | - 8888:8888 51 | 52 | gateway: 53 | image: com.loy/gateway:latest 54 | ports: 55 | - 8080:8080 56 | - 8000:8000 57 | environment: 58 | - e.conf.authServer=http://192.168.88.128:9999/uaa 59 | - zuul.debug.request=true 60 | links: 61 | - discovery:discovery 62 | - ui:ui 63 | - upm:upm 64 | - oauth:oauth 65 | - log:log 66 | - demo:demo 67 | -------------------------------------------------------------------------------- /e-example/e-example-single/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java" 2 | apply plugin: "eclipse" 3 | apply plugin: "org.springframework.boot" 4 | apply plugin: "idea" 5 | apply plugin: "com.bmuschko.docker-remote-api" 6 | 7 | import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage 8 | configurations { 9 | compile.exclude group: "org.springframework.cloud" ,module: "spring-cloud-starter-eureka" 10 | compile.exclude group: "com.17jee" ,module: "e-core-ui" 11 | } 12 | 13 | description = "" 14 | 15 | jar { 16 | baseName = "e-example-single" 17 | 18 | } 19 | 20 | springBoot { 21 | mainClass = "com.loy.SingleApplicationMain" 22 | } 23 | 24 | bootRepackage { 25 | mainClass = "com.loy.SingleApplicationMain" 26 | } 27 | dependencies { 28 | 29 | compile ("com.17jee:e-core-static:${eversion}") 30 | compile ("com.17jee:e-core:${eversion}") 31 | compile ("com.17jee:e-upm-api:${eversion}") 32 | compile ("com.17jee:e-security-password:${eversion}") 33 | 34 | compile ("com.17jee:e-upm-service:3.0.1.12") 35 | compile ("com.17jee:e-upm-ui:3.0.1.12") 36 | compile ("com.17jee:e-log-service:${eversion}") 37 | compile ("com.17jee:e-log-ui:${eversion}") 38 | compile ("com.h2database:h2:1.4.193") 39 | compile ("com.17jee:e-data-permission-service:${eversion}") 40 | compile ("com.17jee:e-data-permission-impl:${eversion}") 41 | compile ("com.17jee:e-data-permission-ui:${eversion}") 42 | compile ("com.17jee:e-security-token:${eversion}") 43 | compile ("com.17jee:e-cache-hibernate-ehcache:${eversion}") 44 | compile project(":demo:demo-service") 45 | compile project(":demo:demo-ui") 46 | 47 | runtime("mysql:mysql-connector-java:${mysqlVersion}") 48 | 49 | compile("org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}") 50 | compile "io.springfox:springfox-swagger-ui:${springfoxSwaggerVersion}" 51 | 52 | } 53 | task erun(type:Exec, dependsOn: build) { 54 | workingDir "${project.buildDir}/libs" 55 | commandLine "java", "-Dfile.encoding=${fileEncoding}", "-jar","${project.name}-${version}.jar" 56 | } 57 | task copyJar(type: Copy) { 58 | dependsOn "build" 59 | from "build/libs/${jar.baseName}-${version}.jar" 60 | into "build/docker" 61 | //rename { String fileName -> 62 | // fileName.replace("-${version}", "-docker-${version}") 63 | //} 64 | 65 | from "src/main/docker" 66 | into "build/docker" 67 | 68 | } 69 | task buildDockerImage(type: DockerBuildImage) { 70 | dependsOn copyJar 71 | if (System.env.DOCKER_HOST) { 72 | url = "$System.env.DOCKER_HOST".replace("tcp","https") 73 | if (System.env.DOCKER_CERT_PATH) { 74 | certPath = new File(System.env.DOCKER_CERT_PATH) 75 | } 76 | } 77 | else { 78 | url = 'unix:///var/run/docker.sock' 79 | } 80 | 81 | inputDir = file('build/docker') 82 | tag = 'com.loy/singleupm' 83 | } 84 | -------------------------------------------------------------------------------- /e-example/e-example-single/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-example-single/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /e-example/e-example-single/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Aug 26 08:51:36 CST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip 7 | -------------------------------------------------------------------------------- /e-example/e-example-single/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /e-example/e-example-single/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | ADD *.jar e-example-single.jar 3 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-Dfile.encoding=UTF-8","-jar","/e-example-single.jar"] -------------------------------------------------------------------------------- /e-example/e-example-single/src/main/docker/application.yml: -------------------------------------------------------------------------------- 1 | e: 2 | conf: 3 | loyAspect: true 4 | defaultLocale: zh_CN 5 | debugPageResult: false 6 | recordOperateLog: true 7 | supportLocales: 8 | - en_US 9 | - zh_CN 10 | defaultPage: readme.html 11 | homePage: home_tabs.html 12 | defaultPassword: 123456 13 | 14 | homePageConfig: 15 | staticResourceFolder: asssets 16 | 17 | staticMappings: 18 | /upm-ui/component/**: 19 | - classpath:/static/component/ 20 | - classpath:/public/component/ 21 | /upm-ui/**: 22 | - classpath:/static/ 23 | /log-ui/**: 24 | - classpath:/static/ 25 | /demo-ui/**: 26 | - classpath:/static/ 27 | ignoreJsonResponseUrls: 28 | - /configuration/ui 29 | - /swagger-resources 30 | - /v2/api-docs 31 | - /configuration/security 32 | - /model/*/json 33 | - /model/*/save 34 | - /editor/stencilset 35 | 36 | apiInfo: 37 | title: E-框架 REST API 38 | description: null 39 | version: 2.0.0 40 | termsOfServiceUrl: null 41 | contact: 42 | name: Loy Fu 43 | url: http://www.17jee.com 44 | email: 21549322@qq.com 45 | license: null 46 | licenseUrl: null 47 | pathsRegex: ^.*(? pars = new ArrayList(); 87 | tokenPar.name("Authorization").description("令牌").modelRef(new ModelRef("string")).parameterType("header") 88 | .required(false).build(); 89 | pars.add(tokenPar.build()); 90 | 91 | return new Docket(DocumentationType.SWAGGER_2).select() 92 | .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)).paths(PathSelectors.any()) 93 | .build().globalOperationParameters(pars); 94 | 95 | } 96 | 97 | } 98 | -------------------------------------------------------------------------------- /e-example/e-example-single/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | e: 2 | conf: 3 | loyAspect: true 4 | defaultLocale: zh_CN 5 | debugPageResult: false 6 | recordOperateLog: true 7 | supportLocales: 8 | - en_US 9 | - zh_CN 10 | defaultPage: readme.html 11 | homePage: home_tabs.html 12 | defaultPassword: 123456 13 | 14 | homePageConfig: 15 | staticResourceFolder: asssets 16 | 17 | staticMappings: 18 | /upm-ui/component/**: 19 | - classpath:/static/component/ 20 | - classpath:/public/component/ 21 | /upm-ui/**: 22 | - classpath:/static/ 23 | /log-ui/**: 24 | - classpath:/static/ 25 | /demo-ui/**: 26 | - classpath:/static/ 27 | ignoreJsonResponseUrls: 28 | - /configuration/ui 29 | - /swagger-resources 30 | - /v2/api-docs 31 | - /configuration/security 32 | - /model/*/json 33 | - /model/*/save 34 | - /editor/stencilset 35 | 36 | apiInfo: 37 | title: E-框架 REST API 38 | description: null 39 | version: 2.0.0 40 | termsOfServiceUrl: null 41 | contact: 42 | name: Loy Fu 43 | url: http://www.17jee.com 44 | email: 21549322@qq.com 45 | license: null 46 | licenseUrl: null 47 | pathsRegex: ^.*(? 36 | // fileName.replace("-${version}", "-docker-${version}") 37 | //} 38 | 39 | from "src/main/docker" 40 | into "build/docker" 41 | 42 | } 43 | task buildDockerImage(type: DockerBuildImage) { 44 | dependsOn copyJar 45 | if (System.env.DOCKER_HOST) { 46 | url = "$System.env.DOCKER_HOST".replace("tcp","https") 47 | if (System.env.DOCKER_CERT_PATH) { 48 | certPath = new File(System.env.DOCKER_CERT_PATH) 49 | } 50 | } 51 | else { 52 | url = 'unix:///var/run/docker.sock' 53 | } 54 | 55 | inputDir = file('build/docker') 56 | tag = 'com.loy/db' 57 | } 58 | 59 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-db/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-db/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-db/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Aug 26 08:51:36 CST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip 7 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-db/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-db/lib/de.flapdoodle.embed.process-1.50.3-20160513.093141-4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-db/lib/de.flapdoodle.embed.process-1.50.3-20160513.093141-4.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-db/lib/h2-1.4.193.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-db/lib/h2-1.4.193.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-db/lib/slf4j-api-1.7.21.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-db/lib/slf4j-api-1.7.21.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-db/lib/spring-core-4.2.7.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-db/lib/spring-core-4.2.7.RELEASE.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-db/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | ADD *.jar e-example-ms-db.jar 3 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-Dfile.encoding=UTF-8","-jar","/e-example-ms-db.jar"] -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-db/src/main/java/com/loy/MainDb.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Loy Fu.付厚俊 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package com.loy; 15 | 16 | import java.sql.SQLException; 17 | 18 | import org.h2.tools.Server; 19 | 20 | /** 21 | * 22 | * @author Loy Fu qq群 540553957 http://www.17jee.com 23 | * @since 1.8 24 | * @version 3.0.0 25 | * 26 | */ 27 | public class MainDb { 28 | public static void main(String[] args) throws SQLException { 29 | 30 | String[] arg = { "-tcp", "-tcpAllowOthers" }; 31 | Server server = Server.createTcpServer(arg); 32 | server.start(); 33 | 34 | System.out.println("JVM running for"); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-db/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ______ _ ____ __ __ 2 | | ____| | | / __ \\ \ / / 3 | | |__ ______ | | | | | |\ \_/ / 4 | | __| |______| | | | | | | \ / 5 | | |____ | |____| |__| | | | Running Spring Boot ${spring-boot.version} 6 | |______| |______|\____/ |_| http://www.17jee.com 7 | 8 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-demo/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java" 2 | apply plugin: "eclipse" 3 | apply plugin: 'idea' 4 | apply plugin: "org.springframework.boot" 5 | apply plugin: "com.bmuschko.docker-remote-api" 6 | 7 | import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage 8 | 9 | jar { 10 | baseName = "e-example-ms-demo" 11 | } 12 | 13 | springBoot { 14 | mainClass = "com.loy.CloudDemoApplicationMain" 15 | } 16 | 17 | bootRepackage { 18 | mainClass = "com.loy.CloudDemoApplicationMain" 19 | } 20 | 21 | dependencies { 22 | compile ("com.17jee:e-security-jwt:${eversion}") 23 | compile ("com.17jee:e-cloud-authorize:${eversion}") 24 | compile project(":demo:demo-service") 25 | compile ("com.17jee:e-data-permission-impl:${eversion}") 26 | compile ("com.17jee:e-cache-hibernate-ehcache:${eversion}") 27 | runtime("mysql:mysql-connector-java:${mysqlVersion}") 28 | runtime ("com.h2database:h2:1.4.193") 29 | compile "io.springfox:springfox-swagger-ui:${springfoxSwaggerVersion}" 30 | } 31 | task erun(type:Exec, dependsOn: build) { 32 | workingDir "${project.buildDir}/libs" 33 | commandLine "java", "-Dfile.encoding=${fileEncoding}", "-jar","${project.name}-${version}.jar" 34 | } 35 | 36 | task copyJar(type: Copy) { 37 | dependsOn "build" 38 | from "build/libs/${jar.baseName}-${version}.jar" 39 | into "build/docker" 40 | //rename { String fileName -> 41 | // fileName.replace("-${version}", "-docker-${version}") 42 | //} 43 | 44 | from "src/main/docker" 45 | into "build/docker" 46 | 47 | } 48 | task buildDockerImage(type: DockerBuildImage) { 49 | dependsOn copyJar 50 | if (System.env.DOCKER_HOST) { 51 | url = "$System.env.DOCKER_HOST".replace("tcp","https") 52 | if (System.env.DOCKER_CERT_PATH) { 53 | certPath = new File(System.env.DOCKER_CERT_PATH) 54 | } 55 | } 56 | else { 57 | url = 'unix:///var/run/docker.sock' 58 | } 59 | 60 | inputDir = file('build/docker') 61 | tag = 'com.loy/demo' 62 | } -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-demo/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-demo/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-demo/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Aug 26 08:51:36 CST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip 7 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-demo/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-demo/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | ADD *.jar /e-example-ms-upm.jar 3 | ADD application.yml /econf/ 4 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","-Dspring.config.location=/econf/application.yml","/e-example-ms-upm.jar"] -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-demo/src/main/docker/application.yml: -------------------------------------------------------------------------------- 1 | e: 2 | conf: 3 | authServer: http://oauth:9999/uaa 4 | loyAspect: true 5 | defaultLocale: zh_CN 6 | debugPageResult: false 7 | recordOperateLog: true 8 | supportLocales: 9 | - en_US 10 | - zh_CN 11 | defaultPage: readme.html 12 | 13 | homePageConfig: 14 | staticResourceFolder: asssets 15 | 16 | ignoreJsonResponseUrls: 17 | - /configuration/ui 18 | - /swagger-resources 19 | - /v2/api-docs 20 | - /configuration/security 21 | - /model/*/json 22 | - /model/*/save 23 | - /editor/stencilset 24 | 25 | apiInfo: 26 | title: E-框架 REST API 27 | description: null 28 | version: 2.0.0 29 | termsOfServiceUrl: null 30 | contact: 31 | name: Loy Fu 32 | url: http://www.17jee.com 33 | email: 21549322@qq.com 34 | license: null 35 | licenseUrl: null 36 | pathsRegex: ^.*(? 40 | // fileName.replace("-${version}", "-docker-${version}") 41 | //} 42 | 43 | from "src/main/docker" 44 | into "build/docker" 45 | 46 | } 47 | task buildDockerImage(type: DockerBuildImage) { 48 | dependsOn copyJar 49 | if (System.env.DOCKER_HOST) { 50 | url = "$System.env.DOCKER_HOST".replace("tcp","https") 51 | if (System.env.DOCKER_CERT_PATH) { 52 | certPath = new File(System.env.DOCKER_CERT_PATH) 53 | } 54 | } 55 | else { 56 | url = 'unix:///var/run/docker.sock' 57 | } 58 | 59 | inputDir = file('build/docker') 60 | tag = 'com.loy/discovery' 61 | } 62 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-discovery/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-discovery/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-discovery/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Aug 26 08:51:35 CST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip 7 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-discovery/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-discovery/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | ADD *.jar /e-example-ms-discovery.jar 3 | ADD application.yml /econf/ 4 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","-Dspring.config.location=/econf/application.yml","/e-example-ms-discovery.jar"] -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-discovery/src/main/docker/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: discovery 4 | server: 5 | port: 8761 # 指定该Eureka实例的端口 6 | eureka: 7 | instance: 8 | hostname: discovery # 指定该Eureka实例的主机名 9 | client: 10 | registerWithEureka: false 11 | fetchRegistry: false 12 | serviceUrl: 13 | defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-discovery/src/main/java/com/loy/DiscoveryApplicationMain.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Loy Fu. 付厚俊 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package com.loy; 15 | 16 | import org.springframework.boot.SpringApplication; 17 | import org.springframework.boot.autoconfigure.SpringBootApplication; 18 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 19 | 20 | /** 21 | * 22 | * @author Loy Fu qq群 540553957 http://www.17jee.com 23 | * @since 1.8 24 | * @version 3.0.0 25 | * 26 | */ 27 | 28 | @SpringBootApplication 29 | @EnableEurekaServer 30 | public class DiscoveryApplicationMain { 31 | public static void main(String[] args) { 32 | SpringApplication.run(DiscoveryApplicationMain.class, args); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-discovery/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: discovery-server 4 | server: 5 | port: 8761 # 指定该Eureka实例的端口 6 | eureka: 7 | instance: 8 | hostname: localhost # 指定该Eureka实例的主机名 9 | client: 10 | registerWithEureka: false 11 | fetchRegistry: false 12 | serviceUrl: 13 | defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-gateway/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java" 2 | apply plugin: "eclipse" 3 | apply plugin: "idea" 4 | apply plugin: "org.springframework.boot" 5 | apply plugin: "com.bmuschko.docker-remote-api" 6 | 7 | import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage 8 | jar { 9 | baseName = "e-example-ms-gateway" 10 | } 11 | springBoot { 12 | mainClass = "com.loy.GatewayApplicationMain" 13 | } 14 | 15 | bootRepackage { 16 | mainClass = "com.loy.GatewayApplicationMain" 17 | } 18 | dependencies { 19 | compile ("com.17jee:e-cloud-gateway:${eversion}") 20 | compile("org.springframework.cloud:spring-cloud-starter-security:${springCloudOauth2}") 21 | compile("org.springframework.cloud:spring-cloud-starter-oauth2:${springCloudOauth2}") 22 | compile("org.springframework.cloud:spring-cloud-starter-eureka:${springCloud}") 23 | compile("org.springframework.cloud:spring-cloud-starter-feign:${springCloud}") 24 | } 25 | task erun(type:Exec, dependsOn: build) { 26 | workingDir "${project.buildDir}/libs" 27 | commandLine "java", "-jar","${project.name}-${version}.jar" 28 | } 29 | 30 | task copyJar(type: Copy) { 31 | dependsOn "build" 32 | from "build/libs/${jar.baseName}-${version}.jar" 33 | into "build/docker" 34 | //rename { String fileName -> 35 | // fileName.replace("-${version}", "-docker-${version}") 36 | //} 37 | 38 | from "src/main/docker" 39 | into "build/docker" 40 | 41 | } 42 | task buildDockerImage(type: DockerBuildImage) { 43 | dependsOn copyJar 44 | if (System.env.DOCKER_HOST) { 45 | url = "$System.env.DOCKER_HOST".replace("tcp","https") 46 | if (System.env.DOCKER_CERT_PATH) { 47 | certPath = new File(System.env.DOCKER_CERT_PATH) 48 | } 49 | } 50 | else { 51 | url = 'unix:///var/run/docker.sock' 52 | } 53 | 54 | inputDir = file('build/docker') 55 | tag = 'com.loy/gateway' 56 | } -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-gateway/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-gateway/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-gateway/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Aug 26 08:51:36 CST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip 7 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-gateway/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-gateway/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | ADD *.jar /e-example-ms-gateway.jar 3 | ADD application.yml /econf/ 4 | ENTRYPOINT ["java","-Xdebug","-Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n","-Djava.security.egd=file:/dev/./urandom","-jar","-Dspring.config.location=/econf/application.yml","/e-example-ms-gateway.jar"] -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-gateway/src/main/docker/application.yml: -------------------------------------------------------------------------------- 1 | e: 2 | conf: 3 | authServer: http://localhost:9999/uaa 4 | 5 | spring: 6 | application: 7 | name: gateway 8 | server: 9 | port: 8080 10 | zuul: 11 | routes: 12 | upm: 13 | sensitive-headers: true 14 | stripPrefix: true 15 | path: /upm/** 16 | url: http://upm:18080/ 17 | 18 | upm-ui: 19 | sensitive-headers: true 20 | stripPrefix: true 21 | path: /upm-ui/** 22 | url: http://ui:8888/ 23 | 24 | log: 25 | sensitive-headers: true 26 | stripPrefix: true 27 | path: /log/** 28 | url: http://log:28080/ 29 | 30 | log-ui: 31 | sensitive-headers: true 32 | stripPrefix: true 33 | path: /log-ui/** 34 | url: http://ui:8888/ 35 | 36 | 37 | demo: 38 | sensitive-headers: true 39 | stripPrefix: true 40 | path: /demo/** 41 | #serviceId: demo 42 | url: http://demo:38080/ 43 | 44 | demo-ui: 45 | sensitive-headers: true 46 | stripPrefix: true 47 | path: /demo-ui/** 48 | url: http://ui:8888/ 49 | 50 | 51 | auth: 52 | sensitive-headers: true 53 | stripPrefix: true 54 | path: /uaa/** 55 | url: http://oauth:9999/ 56 | 57 | ms-ui-home: 58 | sensitive-headers: true 59 | stripPrefix: true 60 | path: / 61 | url: http://ui:8888/home.html 62 | 63 | ms-ui: 64 | sensitive-headers: true 65 | stripPrefix: true 66 | path: /** 67 | url: http://ui:8888/ 68 | 69 | 70 | eureka: 71 | client: 72 | serviceUrl: 73 | defaultZone: http://discovery:8761/eureka/ # 指定注册中心的地址 74 | instance: 75 | preferIpAddress: true 76 | 77 | 78 | 79 | security: 80 | user: 81 | password: none 82 | oauth2: 83 | client: 84 | accessTokenUri: ${e.conf.authServer}/oauth/token 85 | userAuthorizationUri: ${e.conf.authServer}/oauth/authorize 86 | clientId: acme 87 | clientSecret: acmesecret 88 | resource: 89 | jwt: 90 | keyValue: | 91 | -----BEGIN PUBLIC KEY----- 92 | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnGp/Q5lh0P8nPL21oMMrt2RrkT9AW5jgYwLfSUnJVc9G6uR3cXRRDCjHqWU5WYwivcF180A6CWp/ireQFFBNowgc5XaA0kPpzEtgsA5YsNX7iSnUibB004iBTfU9hZ2Rbsc8cWqynT0RyN4TP1RYVSeVKvMQk4GT1r7JCEC+TNu1ELmbNwMQyzKjsfBXyIOCFU/E94ktvsTZUHF4Oq44DBylCDsS1k7/sfZC2G5EU7Oz0mhG8+Uz6MSEQHtoIi6mc8u64Rwi3Z3tscuWG2ShtsUFuNSAFNkY7LkLn+/hxLCu2bNISMaESa8dG22CIMuIeRLVcAmEWEWH5EEforTg+QIDAQAB 93 | -----END PUBLIC KEY----- 94 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-gateway/src/main/java/com/loy/GatewayApplicationMain.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Loy Fu. 付厚俊 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package com.loy; 15 | 16 | import org.apache.commons.logging.Log; 17 | import org.apache.commons.logging.LogFactory; 18 | import org.springframework.boot.SpringApplication; 19 | import org.springframework.boot.autoconfigure.SpringBootApplication; 20 | import org.springframework.cloud.netflix.zuul.EnableZuulProxy; 21 | import org.springframework.security.oauth2.config.annotation.web.configuration.EnableOAuth2Client; 22 | 23 | /** 24 | * 25 | * @author Loy Fu qq群 540553957 http://www.17jee.com 26 | * @since 1.8 27 | * @version 3.0.0 28 | * 29 | */ 30 | 31 | @EnableZuulProxy 32 | @SpringBootApplication 33 | @EnableOAuth2Client 34 | 35 | public class GatewayApplicationMain { 36 | static final Log logger = LogFactory.getLog(GatewayApplicationMain.class); 37 | 38 | public static void main(String[] args) throws Exception { 39 | SpringApplication.run(GatewayApplicationMain.class, args); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-gateway/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | e: 2 | conf: 3 | authServer: http://localhost:9999/uaa 4 | 5 | spring: 6 | application: 7 | name: gateway 8 | server: 9 | port: 8080 10 | zuul: 11 | routes: 12 | upm: 13 | sensitive-headers: true 14 | stripPrefix: true 15 | path: /upm/** 16 | url: http://localhost:18080/ 17 | 18 | upm-ui: 19 | sensitive-headers: true 20 | stripPrefix: true 21 | path: /upm-ui/** 22 | url: http://localhost:8888/ 23 | 24 | log: 25 | sensitive-headers: true 26 | stripPrefix: true 27 | path: /log/** 28 | url: http://localhost:28080/ 29 | 30 | log-ui: 31 | sensitive-headers: true 32 | stripPrefix: true 33 | path: /log-ui/** 34 | url: http://localhost:8888/ 35 | 36 | 37 | demo: 38 | sensitive-headers: true 39 | stripPrefix: true 40 | path: /demo/** 41 | #url: http://localhost:38080/ 42 | serviceId: demo 43 | 44 | demo-ui: 45 | sensitive-headers: true 46 | stripPrefix: true 47 | path: /demo-ui/** 48 | url: http://localhost:8888/ 49 | 50 | 51 | auth: 52 | sensitive-headers: true 53 | stripPrefix: true 54 | path: /uaa/** 55 | url: http://localhost:9999/ 56 | 57 | ms-ui-home: 58 | sensitive-headers: true 59 | stripPrefix: true 60 | path: / 61 | url: http://localhost:8888/home.html 62 | 63 | ms-ui: 64 | sensitive-headers: true 65 | stripPrefix: true 66 | path: /** 67 | url: http://localhost:8888/ 68 | 69 | 70 | eureka: 71 | client: 72 | serviceUrl: 73 | defaultZone: http://localhost:8761/eureka/ # 指定注册中心的地址 74 | instance: 75 | preferIpAddress: true 76 | 77 | 78 | 79 | security: 80 | user: 81 | password: none 82 | oauth2: 83 | client: 84 | accessTokenUri: ${e.conf.authServer}/oauth/token 85 | userAuthorizationUri: ${e.conf.authServer}/oauth/authorize 86 | clientId: acme 87 | clientSecret: acmesecret 88 | resource: 89 | jwt: 90 | keyValue: | 91 | -----BEGIN PUBLIC KEY----- 92 | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnGp/Q5lh0P8nPL21oMMrt2RrkT9AW5jgYwLfSUnJVc9G6uR3cXRRDCjHqWU5WYwivcF180A6CWp/ireQFFBNowgc5XaA0kPpzEtgsA5YsNX7iSnUibB004iBTfU9hZ2Rbsc8cWqynT0RyN4TP1RYVSeVKvMQk4GT1r7JCEC+TNu1ELmbNwMQyzKjsfBXyIOCFU/E94ktvsTZUHF4Oq44DBylCDsS1k7/sfZC2G5EU7Oz0mhG8+Uz6MSEQHtoIi6mc8u64Rwi3Z3tscuWG2ShtsUFuNSAFNkY7LkLn+/hxLCu2bNISMaESa8dG22CIMuIeRLVcAmEWEWH5EEforTg+QIDAQAB 93 | -----END PUBLIC KEY----- -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-log/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java" 2 | apply plugin: "eclipse" 3 | apply plugin: "idea" 4 | apply plugin: "org.springframework.boot" 5 | apply plugin: "com.bmuschko.docker-remote-api" 6 | 7 | import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage 8 | jar { 9 | baseName = "e-example-ms-log" 10 | } 11 | 12 | springBoot { 13 | mainClass = "com.loy.LogApplicationMain" 14 | } 15 | 16 | bootRepackage { 17 | mainClass = "com.loy.LogApplicationMain" 18 | } 19 | 20 | 21 | dependencies { 22 | compile ("com.17jee:e-core:${eversion}") 23 | compile ("com.17jee:e-cloud-authorize:${eversion}") 24 | compile ("com.17jee:e-security-jwt:${eversion}") 25 | compile ("com.17jee:e-log-service:${eversion}") 26 | runtime("mysql:mysql-connector-java:${mysqlVersion}") 27 | runtime ("com.h2database:h2:1.4.193") 28 | 29 | } 30 | 31 | task erun(type:Exec, dependsOn: build) { 32 | workingDir "${project.buildDir}/libs" 33 | commandLine "java", "-Dfile.encoding=${fileEncoding}", "-jar","${project.name}-${version}.jar" 34 | } 35 | 36 | task copyJar(type: Copy) { 37 | dependsOn "build" 38 | from "build/libs/${jar.baseName}-${version}.jar" 39 | into "build/docker" 40 | //rename { String fileName -> 41 | // fileName.replace("-${version}", "-docker-${version}") 42 | //} 43 | 44 | from "src/main/docker" 45 | into "build/docker" 46 | 47 | } 48 | task buildDockerImage(type: DockerBuildImage) { 49 | dependsOn copyJar 50 | if (System.env.DOCKER_HOST) { 51 | url = "$System.env.DOCKER_HOST".replace("tcp","https") 52 | if (System.env.DOCKER_CERT_PATH) { 53 | certPath = new File(System.env.DOCKER_CERT_PATH) 54 | } 55 | } 56 | else { 57 | url = 'unix:///var/run/docker.sock' 58 | } 59 | 60 | inputDir = file('build/docker') 61 | tag = 'com.loy/log' 62 | } 63 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-log/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-log/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-log/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Aug 26 08:51:35 CST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip 7 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-log/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-log/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | ADD *.jar /e-example-ms-log.jar 3 | ADD application.yml /econf/ 4 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","-Dspring.config.location=/econf/application.yml","/e-example-ms-log.jar"] -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-log/src/main/docker/application.yml: -------------------------------------------------------------------------------- 1 | e: 2 | conf: 3 | authServer: http://oauth:9999/uaa 4 | loyAspect: false 5 | attachmentBaseDirectory : ./upload 6 | defaultLocale: zh_CN 7 | debugPageResult: false 8 | recordOperateLog: true 9 | ignoreJsonResponseUrls: 10 | - /configuration/ui 11 | - /swagger-resources 12 | - /v2/api-docs 13 | - /configuration/security 14 | - /model/*/json 15 | - /model/*/save 16 | - /editor/stencilset 17 | 18 | 19 | apiInfo: 20 | title: E-框架 REST API 21 | description: 22 | version: 2.0.0 23 | termsOfServiceUrl: 24 | contact: 25 | name: Loy Fu 26 | url: http://www.17jee.com 27 | email: 21549322@qq.com 28 | license: 29 | licenseUrl: 30 | pathsRegex: ^.*(? 35 | // fileName.replace("-${version}", "-docker-${version}") 36 | //} 37 | 38 | from "src/main/docker" 39 | into "build/docker" 40 | 41 | } 42 | task buildDockerImage(type: DockerBuildImage) { 43 | dependsOn copyJar 44 | if (System.env.DOCKER_HOST) { 45 | url = "$System.env.DOCKER_HOST".replace("tcp","https") 46 | if (System.env.DOCKER_CERT_PATH) { 47 | certPath = new File(System.env.DOCKER_CERT_PATH) 48 | } 49 | } 50 | else { 51 | url = 'unix:///var/run/docker.sock' 52 | } 53 | 54 | inputDir = file('build/docker') 55 | tag = 'com.loy/oauth2' 56 | } -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-oauth2/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-oauth2/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-oauth2/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Aug 26 08:51:36 CST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip 7 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-oauth2/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-oauth2/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | ADD *.jar /e-example-ms-oauth2.jar 3 | ADD application.yml /econf/ 4 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","-Dspring.config.location=/econf/application.yml","/e-example-ms-oauth2.jar"] -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-oauth2/src/main/docker/application.yml: -------------------------------------------------------------------------------- 1 | e: 2 | conf: 3 | loginSuccessUrl: http://localhost:8080/ 4 | server: 5 | port: 9999 6 | context-path: /uaa 7 | security: 8 | oauth2: 9 | resource: 10 | jwt: 11 | keyValue: | 12 | -----BEGIN PUBLIC KEY----- 13 | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnGp/Q5lh0P8nPL21oMMrt2RrkT9AW5jgYwLfSUnJVc9G6uR3cXRRDCjHqWU5WYwivcF180A6CWp/ireQFFBNowgc5XaA0kPpzEtgsA5YsNX7iSnUibB004iBTfU9hZ2Rbsc8cWqynT0RyN4TP1RYVSeVKvMQk4GT1r7JCEC+TNu1ELmbNwMQyzKjsfBXyIOCFU/E94ktvsTZUHF4Oq44DBylCDsS1k7/sfZC2G5EU7Oz0mhG8+Uz6MSEQHtoIi6mc8u64Rwi3Z3tscuWG2ShtsUFuNSAFNkY7LkLn+/hxLCu2bNISMaESa8dG22CIMuIeRLVcAmEWEWH5EEforTg+QIDAQAB 14 | -----END PUBLIC KEY----- 15 | user: 16 | password: password 17 | spring: 18 | application: 19 | name: oauth 20 | datasource: 21 | platform: h2 22 | #url: jdbc:mysql://db/e_upm?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&autoReconnect=true&failOverReadOnly=false 23 | url: jdbc:h2:tcp://db/~/.h2/e_upm 24 | username: root 25 | password: 123456 26 | #driverClassName: com.mysql.jdbc.Driver 27 | driverClassName: org.h2.Driver 28 | max-active: 50 29 | max-idle: 40 30 | min-idle: 20 31 | initial-size: 6 32 | validation-query: select 1 33 | test-on-borrow: false 34 | test-on-return: false 35 | test-while-idle: true 36 | jpa: 37 | properties: 38 | hibernate: 39 | #dialect: org.hibernate.dialect.MySQL5InnoDBDialect 40 | dialect: org.hibernate.dialect.H2Dialect 41 | showSql: false 42 | hibernate: 43 | ddlAuto: update 44 | eureka: 45 | client: 46 | serviceUrl: 47 | defaultZone: http://discovery:8761/eureka/ # 指定注册中心的地址 48 | instance: 49 | preferIpAddress: true 50 | 51 | logging: 52 | path: ./logs 53 | file: ./logs/auth.log 54 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-oauth2/src/main/java/com/loy/ServiceAuthApplicationMain.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Loy Fu. 付厚俊 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package com.loy; 15 | 16 | import org.h2.server.web.WebServlet; 17 | import org.springframework.boot.SpringApplication; 18 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 19 | import org.springframework.boot.autoconfigure.SpringBootApplication; 20 | import org.springframework.boot.web.servlet.ServletRegistrationBean; 21 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 22 | import org.springframework.context.annotation.Bean; 23 | import org.springframework.context.annotation.ComponentScan; 24 | import org.springframework.data.jpa.repository.config.EnableJpaRepositories; 25 | import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer; 26 | import org.springframework.web.bind.annotation.SessionAttributes; 27 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 28 | 29 | @SpringBootApplication 30 | @SessionAttributes("authorizationRequest") 31 | @EnableResourceServer 32 | @EnableAutoConfiguration() 33 | @EnableEurekaClient() 34 | @EnableJpaRepositories 35 | @ComponentScan(basePackages = { "com.loy" }) 36 | public class ServiceAuthApplicationMain extends WebMvcConfigurerAdapter { 37 | 38 | public static void main(String[] args) { 39 | SpringApplication.run(ServiceAuthApplicationMain.class, args); 40 | } 41 | 42 | @Bean 43 | public ServletRegistrationBean h2servletRegistration() { 44 | ServletRegistrationBean registration = new ServletRegistrationBean(new WebServlet()); 45 | registration.addUrlMappings("/console/*"); 46 | return registration; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-oauth2/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | e: 2 | conf: 3 | loginSuccessUrl: http://localhost:8080/ 4 | server: 5 | port: 9999 6 | context-path: /uaa 7 | security: 8 | oauth2: 9 | resource: 10 | jwt: 11 | keyValue: | 12 | -----BEGIN PUBLIC KEY----- 13 | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnGp/Q5lh0P8nPL21oMMrt2RrkT9AW5jgYwLfSUnJVc9G6uR3cXRRDCjHqWU5WYwivcF180A6CWp/ireQFFBNowgc5XaA0kPpzEtgsA5YsNX7iSnUibB004iBTfU9hZ2Rbsc8cWqynT0RyN4TP1RYVSeVKvMQk4GT1r7JCEC+TNu1ELmbNwMQyzKjsfBXyIOCFU/E94ktvsTZUHF4Oq44DBylCDsS1k7/sfZC2G5EU7Oz0mhG8+Uz6MSEQHtoIi6mc8u64Rwi3Z3tscuWG2ShtsUFuNSAFNkY7LkLn+/hxLCu2bNISMaESa8dG22CIMuIeRLVcAmEWEWH5EEforTg+QIDAQAB 14 | -----END PUBLIC KEY----- 15 | user: 16 | password: password 17 | spring: 18 | application: 19 | name: oauth 20 | datasource: 21 | platform: h2 22 | #url: jdbc:mysql://localhost/e_upm?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&autoReconnect=true&failOverReadOnly=false 23 | url: jdbc:h2:tcp://localhost/~/.h2/e_upm 24 | username: root 25 | password: 123456 26 | #driverClassName: com.mysql.jdbc.Driver 27 | driverClassName: org.h2.Driver 28 | max-active: 50 29 | max-idle: 40 30 | min-idle: 20 31 | initial-size: 6 32 | validation-query: select 1 33 | test-on-borrow: false 34 | test-on-return: false 35 | test-while-idle: true 36 | jpa: 37 | properties: 38 | hibernate: 39 | #dialect: org.hibernate.dialect.MySQL5InnoDBDialect 40 | dialect: org.hibernate.dialect.H2Dialect 41 | showSql: false 42 | hibernate: 43 | ddlAuto: update 44 | eureka: 45 | client: 46 | serviceUrl: 47 | defaultZone: http://localhost:8761/eureka/ # 指定注册中心的地址 48 | instance: 49 | preferIpAddress: true 50 | 51 | logging: 52 | path: ./logs 53 | file: ./logs/auth.log 54 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-oauth2/src/main/resources/keystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-oauth2/src/main/resources/keystore.jks -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-oauth2/src/main/resources/logback.groovy: -------------------------------------------------------------------------------- 1 | // 2 | // Built on Fri Aug 05 04:22:00 UTC 2016 by logback-translator 3 | // For more information on configuration files in Groovy 4 | // please see http://logback.qos.ch/manual/groovy.html 5 | 6 | // For assistance related to this tool or configuration files 7 | // in general, please contact the logback user mailing list at 8 | // http://qos.ch/mailman/listinfo/logback-user 9 | 10 | // For professional support please see 11 | // http://www.qos.ch/shop/products/professionalSupport 12 | 13 | import ch.qos.logback.classic.encoder.PatternLayoutEncoder 14 | import ch.qos.logback.classic.filter.ThresholdFilter 15 | import ch.qos.logback.core.ConsoleAppender 16 | import ch.qos.logback.core.rolling.RollingFileAppender 17 | import ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP 18 | import ch.qos.logback.core.rolling.TimeBasedRollingPolicy 19 | import java.nio.charset.Charset 20 | 21 | import static ch.qos.logback.classic.Level.DEBUG 22 | import static ch.qos.logback.classic.Level.INFO 23 | import static ch.qos.logback.classic.Level.WARN 24 | 25 | scan("10 seconds") 26 | appender("FILE", RollingFileAppender) { 27 | encoder(PatternLayoutEncoder) { 28 | pattern = "[ %-5level] [%date{yyyy-MM-dd HH:mm:ss}] %logger{96} [%line] - %msg%n" 29 | charset = Charset.forName("UTF-8") 30 | } 31 | rollingPolicy(TimeBasedRollingPolicy) { 32 | fileNamePattern = "../logs/upm-%d{yyyy-MM-dd}.%i.log" 33 | timeBasedFileNamingAndTriggeringPolicy(SizeAndTimeBasedFNATP) { 34 | maxFileSize = "64 MB" 35 | } 36 | } 37 | filter(ThresholdFilter) { 38 | level = DEBUG 39 | } 40 | prudent = true 41 | } 42 | appender("STDOUT", ConsoleAppender) { 43 | encoder(PatternLayoutEncoder) { 44 | pattern = "[ %-5level] [%date{yyyy-MM-dd HH:mm:ss}] %logger{96} [%line] - %msg%n" 45 | charset = Charset.forName("GBK") 46 | } 47 | filter(ThresholdFilter) { 48 | level = INFO 49 | } 50 | } 51 | root(INFO, ["FILE", "STDOUT"]) 52 | logger("com.loy.e.core.web.dispatch", INFO) 53 | logger("com.loy.e", INFO) 54 | logger("org.springframework", WARN) 55 | logger("org.hibernate", WARN) -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start-w/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java" 2 | apply plugin: "eclipse" 3 | apply plugin: "idea" 4 | apply plugin: "org.springframework.boot" 5 | 6 | description = "" 7 | 8 | jar { 9 | baseName = "e-example-ms-start-w" 10 | } 11 | 12 | springBoot { 13 | mainClass = "com.loy.MainFrame" 14 | } 15 | 16 | bootRepackage { 17 | mainClass = "com.loy.MainFrame" 18 | } 19 | 20 | dependencies { 21 | compile ("org.yaml:snakeyaml:1.17") 22 | compile fileTree(dir: "lib", include: "*.jar") 23 | compile ("commons-logging:commons-logging:1.2") 24 | } 25 | task erun(type:Exec, dependsOn: build) { 26 | workingDir "${project.buildDir}/libs" 27 | commandLine "java", "-Dfile.encoding=${fileEncoding}", "-jar","${project.name}-${version}.jar" 28 | } 29 | 30 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start-w/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-start-w/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start-w/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Aug 26 08:51:36 CST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip 7 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start-w/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start-w/lib/de.flapdoodle.embed.process-1.50.3-20160513.093141-4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-start-w/lib/de.flapdoodle.embed.process-1.50.3-20160513.093141-4.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start-w/lib/h2-1.4.193.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-start-w/lib/h2-1.4.193.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start-w/lib/jna.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-start-w/lib/jna.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start-w/lib/platform.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-start-w/lib/platform.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start-w/lib/slf4j-api-1.7.21.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-start-w/lib/slf4j-api-1.7.21.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start-w/lib/spring-core-4.2.7.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-start-w/lib/spring-core-4.2.7.RELEASE.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start-w/src/main/java/com/loy/EComposite.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Loy Fu. 付厚俊 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package com.loy; 15 | 16 | import javax.swing.JTextArea; 17 | 18 | /** 19 | * 20 | * @author Loy Fu qq群 540553957 http://www.17jee.com 21 | * @since 1.8 22 | * @version 3.0.0 23 | * 24 | */ 25 | public class EComposite { 26 | 27 | private String command; 28 | private JTextArea textArea; 29 | 30 | public String getCommand() { 31 | return command; 32 | } 33 | 34 | public void setCommand(String command) { 35 | this.command = command; 36 | } 37 | 38 | public JTextArea getTextArea() { 39 | return textArea; 40 | } 41 | 42 | public void setTextArea(JTextArea textArea) { 43 | this.textArea = textArea; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start-w/src/main/java/com/loy/WriteLogThread.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Loy Fu. 付厚俊 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package com.loy; 15 | 16 | import java.io.BufferedReader; 17 | import java.io.IOException; 18 | import java.io.InputStream; 19 | import java.io.InputStreamReader; 20 | 21 | import javax.swing.JTextArea; 22 | 23 | import org.apache.commons.logging.Log; 24 | import org.apache.commons.logging.LogFactory; 25 | 26 | /** 27 | * 28 | * @author Loy Fu qq群 540553957 http://www.17jee.com 29 | * @since 1.8 30 | * @version 3.0.0 31 | * 32 | */ 33 | public class WriteLogThread extends Thread { 34 | protected final Log logger = LogFactory.getLog(WriteLogThread.class); 35 | InputStream inputStream; 36 | JTextArea textArea; 37 | boolean notify = false; 38 | 39 | public WriteLogThread(InputStream inputStream) { 40 | this.inputStream = inputStream; 41 | } 42 | 43 | public WriteLogThread(InputStream inputStream, JTextArea textArea) { 44 | this.inputStream = inputStream; 45 | this.textArea = textArea; 46 | } 47 | 48 | @Override 49 | public void run() { 50 | BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); 51 | 52 | String str = null; 53 | try { 54 | while ((str = bufferedReader.readLine()) != null) { 55 | if (!notify && str.indexOf("JVM running for") != -1) { 56 | synchronized (MainFrame.lock) { 57 | MainFrame.lock.notify(); 58 | notify = true; 59 | } 60 | } 61 | 62 | if (this.textArea == null) { 63 | System.out.println(str); 64 | //logger.info(str); 65 | } else { 66 | this.textArea.append(str); 67 | 68 | this.textArea.append("\r\n"); 69 | this.textArea.setCaretPosition(this.textArea.getText().length()); 70 | } 71 | 72 | } 73 | } catch (IOException e) { 74 | e.printStackTrace(); 75 | } 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start-w/src/main/java/com/loy/ee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-start-w/src/main/java/com/loy/ee.png -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start-w/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | platform: Windows 2 | version: 3.0.1.3 3 | jvmOption: -Xms256m -Xmx256m 4 | 5 | projects: 6 | - e-example-ms-discovery 7 | - e-example-ms-upm 8 | - e-example-ms-oauth2 9 | - e-example-ms-log 10 | - e-example-ms-ui 11 | - e-example-ms-demo 12 | - e-example-ms-gateway 13 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start-w/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ______ _ ____ __ __ 2 | | ____| | | / __ \\ \ / / 3 | | |__ ______ | | | | | |\ \_/ / 4 | | __| |______| | | | | | | \ / 5 | | |____ | |____| |__| | | | Running Spring Boot ${spring-boot.version} 6 | |______| |______|\____/ |_| http://www.17jee.com 7 | 8 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start-w/src/main/resources/ee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-start-w/src/main/resources/ee.png -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java" 2 | apply plugin: "eclipse" 3 | apply plugin: "idea" 4 | apply plugin: "org.springframework.boot" 5 | 6 | description = "" 7 | 8 | jar { 9 | baseName = "e-example-ms-start" 10 | } 11 | 12 | springBoot { 13 | mainClass = "com.loy.MicroServiceConsole" 14 | } 15 | 16 | bootRepackage { 17 | mainClass = "com.loy.MicroServiceConsole" 18 | } 19 | 20 | dependencies { 21 | compile ("org.yaml:snakeyaml:1.17") 22 | compile fileTree(dir: "lib", include: "*.jar") 23 | compile ("commons-logging:commons-logging:1.2") 24 | } 25 | task erun(type:Exec, dependsOn: build) { 26 | workingDir "${project.buildDir}/libs" 27 | commandLine "java", "-Dfile.encoding=${fileEncoding}", "-jar","${project.name}-${version}.jar" 28 | } 29 | 30 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-start/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Aug 26 08:51:36 CST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip 7 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start/lib/de.flapdoodle.embed.process-1.50.3-20160513.093141-4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-start/lib/de.flapdoodle.embed.process-1.50.3-20160513.093141-4.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start/lib/h2-1.4.193.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-start/lib/h2-1.4.193.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start/lib/jna.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-start/lib/jna.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start/lib/platform.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-start/lib/platform.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start/lib/slf4j-api-1.7.21.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-start/lib/slf4j-api-1.7.21.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start/lib/spring-core-4.2.7.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-start/lib/spring-core-4.2.7.RELEASE.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start/src/main/java/com/loy/EComposite.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Loy Fu. 付厚俊 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package com.loy; 15 | 16 | import javax.swing.JTextArea; 17 | 18 | /** 19 | * 20 | * @author Loy Fu qq群 540553957 http://www.17jee.com 21 | * @since 1.8 22 | * @version 3.0.0 23 | * 24 | */ 25 | public class EComposite { 26 | 27 | private String command; 28 | private JTextArea textArea; 29 | 30 | public String getCommand() { 31 | return command; 32 | } 33 | 34 | public void setCommand(String command) { 35 | this.command = command; 36 | } 37 | 38 | public JTextArea getTextArea() { 39 | return textArea; 40 | } 41 | 42 | public void setTextArea(JTextArea textArea) { 43 | this.textArea = textArea; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start/src/main/java/com/loy/WriteLogThread.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Loy Fu. 付厚俊 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package com.loy; 15 | 16 | import java.io.BufferedReader; 17 | import java.io.IOException; 18 | import java.io.InputStream; 19 | import java.io.InputStreamReader; 20 | 21 | import javax.swing.JTextArea; 22 | 23 | import org.apache.commons.logging.Log; 24 | import org.apache.commons.logging.LogFactory; 25 | 26 | /** 27 | * 28 | * @author Loy Fu qq群 540553957 http://www.17jee.com 29 | * @since 1.8 30 | * @version 3.0.0 31 | * 32 | */ 33 | public class WriteLogThread extends Thread { 34 | protected final Log logger = LogFactory.getLog(WriteLogThread.class); 35 | InputStream inputStream; 36 | JTextArea textArea; 37 | boolean notify = false; 38 | 39 | public WriteLogThread(InputStream inputStream) { 40 | this.inputStream = inputStream; 41 | } 42 | 43 | public WriteLogThread(InputStream inputStream, JTextArea textArea) { 44 | this.inputStream = inputStream; 45 | this.textArea = textArea; 46 | } 47 | 48 | @Override 49 | public void run() { 50 | BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); 51 | 52 | String str = null; 53 | try { 54 | while ((str = bufferedReader.readLine()) != null) { 55 | 56 | if (!notify && str.indexOf("JVM running for") != -1) { 57 | synchronized (MicroServiceConsole.lock) { 58 | MicroServiceConsole.lock.notify(); 59 | notify = true; 60 | } 61 | } 62 | if (this.textArea == null) { 63 | System.out.println(str); 64 | //logger.info(str); 65 | } else { 66 | this.textArea.append(str); 67 | 68 | this.textArea.append("\r\n"); 69 | this.textArea.setCaretPosition(this.textArea.getText().length()); 70 | } 71 | 72 | } 73 | } catch (IOException e) { 74 | e.printStackTrace(); 75 | } 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start/src/main/java/com/loy/ee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-start/src/main/java/com/loy/ee.png -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | platform: Windows 2 | version: 3.0.1.3 3 | jvmOption: -Xms256m -Xmx512m 4 | 5 | projects: 6 | - e-example-ms-discovery 7 | - e-example-ms-upm 8 | - e-example-ms-oauth2 9 | - e-example-ms-log 10 | - e-example-ms-ui 11 | - e-example-ms-demo 12 | - e-example-ms-gateway 13 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ______ _ ____ __ __ 2 | | ____| | | / __ \\ \ / / 3 | | |__ ______ | | | | | |\ \_/ / 4 | | __| |______| | | | | | | \ / 5 | | |____ | |____| |__| | | | Running Spring Boot ${spring-boot.version} 6 | |______| |______|\____/ |_| http://www.17jee.com 7 | 8 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-start/src/main/resources/ee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-start/src/main/resources/ee.png -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-ui/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java" 2 | apply plugin: "eclipse" 3 | apply plugin: "idea" 4 | apply plugin: "org.springframework.boot" 5 | apply plugin: "com.bmuschko.docker-remote-api" 6 | 7 | import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage 8 | description = "" 9 | 10 | jar { 11 | baseName = "e-example-ms-ui" 12 | 13 | } 14 | 15 | springBoot { 16 | mainClass = "com.loy.UIApplicationMain" 17 | } 18 | 19 | bootRepackage { 20 | mainClass = "com.loy.UIApplicationMain" 21 | } 22 | dependencies { 23 | compile ("com.17jee:e-core-static:${eversion}") 24 | compile ("com.17jee:e-core-ui:${eversion}") 25 | compile ("com.17jee:e-upm-ui:3.0.1.12") 26 | compile ("com.17jee:e-log-ui:${eversion}") 27 | compile ("com.17jee:e-data-permission-ui:${eversion}") 28 | compile project(":demo:demo-ui") 29 | } 30 | task erun(type:Exec, dependsOn: build) { 31 | workingDir "${project.buildDir}/libs" 32 | commandLine "java", "-Dfile.encoding=${fileEncoding}", "-jar","${project.name}-${version}.jar" 33 | } 34 | task copyJar(type: Copy) { 35 | dependsOn "build" 36 | from "build/libs/${jar.baseName}-${version}.jar" 37 | into "build/docker" 38 | //rename { String fileName -> 39 | // fileName.replace("-${version}", "-docker-${version}") 40 | //} 41 | 42 | from "src/main/docker" 43 | into "build/docker" 44 | 45 | } 46 | task buildDockerImage(type: DockerBuildImage) { 47 | dependsOn copyJar 48 | if (System.env.DOCKER_HOST) { 49 | url = "$System.env.DOCKER_HOST".replace("tcp","https") 50 | if (System.env.DOCKER_CERT_PATH) { 51 | certPath = new File(System.env.DOCKER_CERT_PATH) 52 | } 53 | } 54 | else { 55 | url = 'unix:///var/run/docker.sock' 56 | } 57 | 58 | inputDir = file('build/docker') 59 | tag = 'com.loy/ui' 60 | } -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-ui/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-ui/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-ui/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Aug 26 08:51:36 CST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip 7 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-ui/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-ui/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | ADD *.jar e-example-ms-ui.jar 3 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-Dfile.encoding=UTF-8","-jar","/e-example-ms-ui.jar"] -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-ui/src/main/java/com/loy/UIApplicationMain.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright Loy Fu. 付厚俊 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package com.loy; 15 | 16 | import org.apache.commons.logging.Log; 17 | import org.apache.commons.logging.LogFactory; 18 | import org.springframework.boot.SpringApplication; 19 | import org.springframework.boot.autoconfigure.SpringBootApplication; 20 | 21 | 22 | /** 23 | * 24 | * @author Loy Fu qq群 540553957 http://www.17jee.com 25 | * @since 1.8 26 | * @version 3.0.0 27 | * 28 | */ 29 | @SpringBootApplication 30 | 31 | public class UIApplicationMain { 32 | static final Log logger = LogFactory.getLog(UIApplicationMain.class); 33 | 34 | public static void main(String[] args) throws Exception { 35 | SpringApplication.run(UIApplicationMain.class, args); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-ui/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | e: 2 | conf: 3 | loyAspect: true 4 | attachmentBaseDirectory: ./upload 5 | defaultLocale: zh_CN 6 | debugPageResult: false 7 | recordOperateLog: true 8 | supportLocales: 9 | - en_US 10 | - zh_CN 11 | defaultPage: readme.html 12 | 13 | 14 | 15 | ignoreJsonResponseUrls: 16 | - /configuration/ui 17 | - /swagger-resources 18 | - /v2/api-docs 19 | - /configuration/security 20 | - /model/*/json 21 | - /model/*/save 22 | - /editor/stencilset 23 | 24 | 25 | spring: 26 | application: 27 | name: ui 28 | server: 29 | port: 8888 30 | tomcat: 31 | uri-encoding: UTF-8 32 | 33 | endpoints: 34 | actuator: 35 | enabled: false 36 | logfile: 37 | enabled: false 38 | path: /logfile 39 | 40 | 41 | logging: 42 | path: ./logs 43 | file: ./logs/example-ms-ui.log 44 | 45 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-upm/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java" 2 | apply plugin: "eclipse" 3 | apply plugin: 'idea' 4 | apply plugin: "org.springframework.boot" 5 | apply plugin: "com.bmuschko.docker-remote-api" 6 | 7 | import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage 8 | 9 | jar { 10 | baseName = "e-example-ms-upm" 11 | } 12 | 13 | springBoot { 14 | mainClass = "com.loy.CloudUpmApplicationMain" 15 | } 16 | 17 | bootRepackage { 18 | mainClass = "com.loy.CloudUpmApplicationMain" 19 | } 20 | 21 | dependencies { 22 | compile ("com.17jee:e-core:${eversion}") 23 | compile ("com.17jee:e-upm-api:${eversion}") 24 | compile ("com.17jee:e-security-password:${eversion}") 25 | compile ("com.17jee:e-upm-service:3.0.1.12") 26 | compile ("com.17jee:e-security-jwt:${eversion}") 27 | compile ("com.17jee:e-cloud-authorize:${eversion}") 28 | compile ("com.17jee:e-cache-hibernate-ehcache:${eversion}") 29 | runtime("mysql:mysql-connector-java:${mysqlVersion}") 30 | compile ("com.17jee:e-data-permission-service:${eversion}") 31 | runtime ("com.h2database:h2:1.4.193") 32 | compile "io.springfox:springfox-swagger-ui:${springfoxSwaggerVersion}" 33 | } 34 | task erun(type:Exec, dependsOn: build) { 35 | workingDir "${project.buildDir}/libs" 36 | commandLine "java", "-Dfile.encoding=${fileEncoding}", "-jar","${project.name}-${version}.jar" 37 | } 38 | 39 | task copyJar(type: Copy) { 40 | dependsOn "build" 41 | from "build/libs/${jar.baseName}-${version}.jar" 42 | into "build/docker" 43 | //rename { String fileName -> 44 | // fileName.replace("-${version}", "-docker-${version}") 45 | //} 46 | 47 | from "src/main/docker" 48 | into "build/docker" 49 | 50 | } 51 | task buildDockerImage(type: DockerBuildImage) { 52 | dependsOn copyJar 53 | if (System.env.DOCKER_HOST) { 54 | url = "$System.env.DOCKER_HOST".replace("tcp","https") 55 | if (System.env.DOCKER_CERT_PATH) { 56 | certPath = new File(System.env.DOCKER_CERT_PATH) 57 | } 58 | } 59 | else { 60 | url = 'unix:///var/run/docker.sock' 61 | } 62 | 63 | inputDir = file('build/docker') 64 | tag = 'com.loy/upm' 65 | } 66 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-upm/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/e-example/e-micro-service/e-example-ms-upm/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-upm/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Aug 26 08:51:36 CST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip 7 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-upm/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-upm/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | ADD *.jar /e-example-ms-upm.jar 3 | ADD application.yml /econf/ 4 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","-Dspring.config.location=/econf/application.yml","/e-example-ms-upm.jar"] -------------------------------------------------------------------------------- /e-example/e-micro-service/e-example-ms-upm/src/main/docker/application.yml: -------------------------------------------------------------------------------- 1 | e: 2 | conf: 3 | authServer: http://oauth:9999/uaa 4 | loyAspect: true 5 | attachmentBaseDirectory: ./upload 6 | defaultLocale: zh_CN 7 | debugPageResult: false 8 | recordOperateLog: true 9 | supportLocales: 10 | - en_US 11 | - zh_CN 12 | defaultPage: readme.html 13 | 14 | homePageConfig: 15 | staticResourceFolder: asssets 16 | 17 | ignoreJsonResponseUrls: 18 | - /configuration/ui 19 | - /swagger-resources 20 | - /v2/api-docs 21 | - /configuration/security 22 | - /model/*/json 23 | - /model/*/save 24 | - /editor/stencilset 25 | 26 | apiInfo: 27 | title: E-框架 REST API 28 | description: null 29 | version: 2.0.0 30 | termsOfServiceUrl: null 31 | contact: 32 | name: Loy Fu 33 | url: http://www.17jee.com 34 | email: 21549322@qq.com 35 | license: null 36 | licenseUrl: null 37 | pathsRegex: ^.*(? \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'e' 2 | 3 | 4 | //include 'e-log:e-log-service' 5 | //include 'e-log:e-log-ui' 6 | 7 | //include 'e-upm:e-upm-api' 8 | //include 'e-upm:e-upm-service' 9 | //include 'e-upm:e-upm-ui' 10 | 11 | include 'e-example:e-example-single' 12 | 13 | include 'e-example:e-micro-service:e-example-ms-ui' 14 | include 'e-example:e-micro-service:e-example-ms-gateway' 15 | include 'e-example:e-micro-service:e-example-ms-upm' 16 | include 'e-example:e-micro-service:e-example-ms-log' 17 | include 'e-example:e-micro-service:e-example-ms-oauth2' 18 | include 'e-example:e-micro-service:e-example-ms-discovery' 19 | include 'e-example:e-micro-service:e-example-ms-db' 20 | include 'e-example:e-micro-service:e-example-ms-demo' 21 | 22 | include 'e-example:e-micro-service:e-example-ms-start' 23 | include 'e-example:e-micro-service:e-example-ms-start-w' 24 | 25 | include ':demo:demo-ui' 26 | include ':demo:demo-service' 27 | 28 | -------------------------------------------------------------------------------- /source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fuhoujun/e/3f4be2ec07f608d0f9b5d75d45390f92e222101f/source.png -------------------------------------------------------------------------------- /start-micro-service-w.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | if "%1" == "yes" goto begin 3 | mshta vbscript:createobject("wscript.shell").run("%~nx0 yes",0)(window.close)&&exit 4 | :begin 5 | cd e-example/e-micro-service/e-example-ms-start-w/build/libs 6 | java -jar e-example-ms-start-w-3.0.1.3.jar -------------------------------------------------------------------------------- /start-micro-service.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem if "%1" == "yes" goto begin 3 | rem mshta vbscript:createobject("wscript.shell").run("%~nx0 yes",0)(window.close)&&exit 4 | rem :begin 5 | cd e-example/e-micro-service/e-example-ms-start/build/libs 6 | java -jar e-example-ms-start-3.0.1.3.jar -------------------------------------------------------------------------------- /start-single-service.bat: -------------------------------------------------------------------------------- 1 | start gradlew startSingleService --------------------------------------------------------------------------------