├── docker └── README.md ├── zhili-auth ├── db │ └── zhili-auth.sql ├── zhili-auth-dao │ └── pom.xml ├── zhili-auth-admin │ └── pom.xml └── pom.xml ├── zhili-adhoc ├── db │ └── zhili-adhoc.sql ├── zhili-adhoc-dao │ └── pom.xml ├── zhili-adhoc-executor │ └── pom.xml └── pom.xml ├── zhili-dataservice ├── db │ └── zhili-dataservice.sql ├── zhili-dataservice-admin │ └── src │ │ ├── main │ │ ├── resources │ │ │ ├── application-poc.yml │ │ │ ├── application-prd.yml │ │ │ ├── application-stg.yml │ │ │ ├── application-dev.yml │ │ │ ├── application.yml │ │ │ ├── bootstrap.yml │ │ │ └── logback-admin.xml │ │ └── java │ │ │ └── com │ │ │ └── niezhili │ │ │ └── dataplatform │ │ │ └── dataservice │ │ │ ├── admin │ │ │ ├── service │ │ │ │ ├── ApplicationService.java │ │ │ │ └── impl │ │ │ │ │ └── ApplicationServiceImpl.java │ │ │ ├── controller │ │ │ │ ├── BaseController.java │ │ │ │ └── ApplicationController.java │ │ │ ├── aspect │ │ │ │ └── AccessLogAnnotation.java │ │ │ ├── exceptions │ │ │ │ └── ApiException.java │ │ │ ├── configuration │ │ │ │ └── SwaggerConfig.java │ │ │ └── utils │ │ │ │ └── Result.java │ │ │ └── ZhiliDataServiceAdminApplicationServer.java │ │ └── test │ │ └── java │ │ └── org │ │ └── example │ │ └── AppTest.java ├── README.md ├── zhili-dataservice-sdk │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── example │ │ │ │ └── App.java │ │ └── test │ │ │ └── java │ │ │ └── org │ │ │ └── example │ │ │ └── AppTest.java │ └── pom.xml ├── zhili-dataservice-api │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── niezhili │ │ │ └── dataplatform │ │ │ └── dataservice │ │ │ └── App.java │ │ └── test │ │ └── java │ │ └── org │ │ └── example │ │ └── AppTest.java ├── zhili-dataservice-dao │ └── src │ │ ├── test │ │ └── java │ │ │ └── org │ │ │ └── example │ │ │ └── AppTest.java │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── niezhili │ │ │ └── dataplatform │ │ │ └── dataservice │ │ │ └── dao │ │ │ ├── AbstractBaseDao.java │ │ │ ├── DaoFactory.java │ │ │ └── entity │ │ │ └── ProjectUser.java │ │ └── resources │ │ ├── com.niezhili.dataplatform.dataservice.dao.mapper │ │ └── ProjectUserMapper.xml │ │ └── datasource.properties └── pom.xml ├── zhili-gateway ├── src │ ├── main │ │ ├── resources │ │ │ ├── application-dev.yml │ │ │ ├── application-poc.yml │ │ │ ├── application-prd.yml │ │ │ ├── application-stg.yml │ │ │ ├── application.yml │ │ │ └── logback-gateway.xml │ │ └── java │ │ │ └── com │ │ │ └── niezhili │ │ │ └── dataplatform │ │ │ └── gateway │ │ │ └── ZhiliGatewayApplicationServer.java │ └── test │ │ └── java │ │ └── org │ │ └── example │ │ └── AppTest.java ├── README.md └── zhili-gateway.iml ├── zhili-monitor ├── zhili-monitor-admin │ └── src │ │ └── main │ │ ├── resources │ │ ├── application-poc.yml │ │ ├── application-prd.yml │ │ ├── application-stg.yml │ │ ├── application.yml │ │ ├── application-dev.yml │ │ └── logback-monitor.xml │ │ └── java │ │ └── com │ │ └── niezhili │ │ └── dataplatform │ │ └── monitor │ │ ├── admin │ │ ├── service │ │ │ ├── MonitorService.java │ │ │ └── impl │ │ │ │ └── MonitorServiceImpl.java │ │ ├── controller │ │ │ ├── BaseController.java │ │ │ └── MonitorController.java │ │ ├── configuration │ │ │ ├── SwaggerConfig.java │ │ │ └── InfluxDBConfiguration.java │ │ └── utils │ │ │ └── Result.java │ │ └── ZhiliMonitorAdminApplicationServer.java ├── zhili-monitor.iml └── pom.xml ├── zhili-report ├── zhili-report-admin │ └── src │ │ └── main │ │ ├── resources │ │ ├── application-dev.yml │ │ ├── application-poc.yml │ │ ├── application-prd.yml │ │ ├── application-stg.yml │ │ ├── application.yml │ │ └── logback-report.xml │ │ └── java │ │ └── com │ │ └── niezhili │ │ └── dataplatform │ │ └── monitor │ │ ├── admin │ │ ├── service │ │ │ ├── ReportService.java │ │ │ └── impl │ │ │ │ └── ReportServiceImpl.java │ │ ├── controller │ │ │ ├── BaseController.java │ │ │ └── ReportController.java │ │ ├── configuration │ │ │ └── SwaggerConfig.java │ │ └── utils │ │ │ └── Result.java │ │ └── ZhiliReportAdminApplicationServer.java ├── zhili-report-dao │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── niezhili │ │ │ └── dataplatform │ │ │ └── monitor │ │ │ └── dao │ │ │ ├── AbstractBaseDao.java │ │ │ ├── DaoFactory.java │ │ │ └── entity │ │ │ └── ProjectUser.java │ │ └── resources │ │ ├── com.niezhili.dataplatform.report.dao.mapper │ │ └── ProjectUserMapper.xml │ │ └── datasource.properties └── pom.xml ├── zhili-metadata ├── zhili-metadata-admin │ └── src │ │ └── main │ │ ├── resources │ │ ├── application-dev.yml │ │ ├── application-poc.yml │ │ ├── application-prd.yml │ │ ├── application-stg.yml │ │ ├── application.yml │ │ └── logback-admin.xml │ │ └── java │ │ └── com │ │ └── niezhili │ │ └── dataplatform │ │ └── metadata │ │ ├── admin │ │ ├── service │ │ │ ├── ApplicationService.java │ │ │ └── impl │ │ │ │ └── ApplicationServiceImpl.java │ │ ├── controller │ │ │ ├── BaseController.java │ │ │ └── ApplicationController.java │ │ ├── configuration │ │ │ └── SwaggerConfig.java │ │ └── utils │ │ │ └── Result.java │ │ └── ZhiliMetadataAdminApplicationServer.java ├── zhili-metadata-datasource │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── example │ │ │ │ └── App.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── niezhili │ │ │ └── dataplatform │ │ │ └── metadata │ │ │ ├── Field.java │ │ │ └── DruidTest.java │ └── pom.xml ├── zhili-metadata-dao │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── niezhili │ │ │ └── dataplatform │ │ │ └── metadata │ │ │ └── dao │ │ │ ├── AbstractBaseDao.java │ │ │ ├── DaoFactory.java │ │ │ ├── mapper │ │ │ └── DataSourceMapper.java │ │ │ └── entity │ │ │ └── ProjectUser.java │ │ └── resources │ │ ├── com.niezhili.dataplatform.metadata.dao.mapper │ │ └── ProjectUserMapper.xml │ │ └── datasource.properties ├── zhili-metadata-collect │ └── pom.xml └── pom.xml ├── zhili-dataplatform.jpg ├── .gitignore ├── zhili-ui ├── src │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── example │ │ │ └── App.java │ └── test │ │ └── java │ │ └── org │ │ └── example │ │ └── AppTest.java └── pom.xml ├── zhili-collect ├── src │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── example │ │ │ └── App.java │ └── test │ │ └── java │ │ └── org │ │ └── example │ │ └── AppTest.java └── pom.xml ├── zhili-safe ├── src │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── example │ │ │ └── App.java │ └── test │ │ └── java │ │ └── org │ │ └── example │ │ └── AppTest.java └── pom.xml ├── zhili-scheduler ├── src │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── niezhili │ │ │ └── App.java │ └── test │ │ └── java │ │ └── com │ │ └── niezhili │ │ └── AppTest.java └── pom.xml ├── .github └── workflows │ ├── maven.yml │ └── maven-publish.yml ├── README.md └── zhili-common ├── src └── main │ ├── java │ └── com │ │ └── niezhili │ │ └── dataplatform │ │ └── common │ │ ├── enums │ │ └── DbType.java │ │ └── constants │ │ └── Constants.java │ └── resources │ └── common.properties └── pom.xml /docker/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /zhili-auth/db/zhili-auth.sql: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /zhili-adhoc/db/zhili-adhoc.sql: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /zhili-dataservice/db/zhili-dataservice.sql: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /zhili-gateway/src/main/resources/application-dev.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 18092 -------------------------------------------------------------------------------- /zhili-gateway/src/main/resources/application-poc.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 12345 -------------------------------------------------------------------------------- /zhili-gateway/src/main/resources/application-prd.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 12345 -------------------------------------------------------------------------------- /zhili-gateway/src/main/resources/application-stg.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 12345 -------------------------------------------------------------------------------- /zhili-monitor/zhili-monitor-admin/src/main/resources/application-poc.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 12345 -------------------------------------------------------------------------------- /zhili-monitor/zhili-monitor-admin/src/main/resources/application-prd.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 12345 -------------------------------------------------------------------------------- /zhili-monitor/zhili-monitor-admin/src/main/resources/application-stg.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 12345 -------------------------------------------------------------------------------- /zhili-report/zhili-report-admin/src/main/resources/application-dev.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 18090 -------------------------------------------------------------------------------- /zhili-report/zhili-report-admin/src/main/resources/application-poc.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 12345 -------------------------------------------------------------------------------- /zhili-report/zhili-report-admin/src/main/resources/application-prd.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 12345 -------------------------------------------------------------------------------- /zhili-report/zhili-report-admin/src/main/resources/application-stg.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 12345 -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-admin/src/main/resources/application-dev.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 18070 -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-admin/src/main/resources/application-poc.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 12345 -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-admin/src/main/resources/application-prd.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 12345 -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-admin/src/main/resources/application-stg.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 12345 -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-admin/src/main/resources/application-poc.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 12345 -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-admin/src/main/resources/application-prd.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 12345 -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-admin/src/main/resources/application-stg.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 12345 -------------------------------------------------------------------------------- /zhili-dataplatform.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javasqlbug/zhili-dataplatform/HEAD/zhili-dataplatform.jpg -------------------------------------------------------------------------------- /zhili-monitor/zhili-monitor.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Project exclude paths 2 | /zhili-dataservice/zhili-dataservice-admin/target/ 3 | /zhili-dataservice/zhili-dataservice-api/target/ -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-admin/src/main/resources/application-dev.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 19091 3 | 4 | #nacos: 5 | # config: hello_nacos -------------------------------------------------------------------------------- /zhili-gateway/README.md: -------------------------------------------------------------------------------- 1 | Spring Cloud Gateway依赖注册中心, 2 | 3 | http转发是通过注册中心来获取服务列表, 4 | 5 | zhili-dataplatform注册中心采用Nacos, 6 | 7 | 如使用zhili-gateway微服务,需提前安装Nacos。 8 | 9 | (开发环境可以安装单节点Nacos,生产环境建议安装Nacos集群) -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-admin/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | servlet: 3 | context-path: /dataservice 4 | 5 | spring: 6 | profiles: 7 | active: dev 8 | 9 | logging: 10 | config: classpath:logback-admin.xml -------------------------------------------------------------------------------- /zhili-dataservice/README.md: -------------------------------------------------------------------------------- 1 | 数据服务又称API服务,是通过页面配置化,就可以发布API接口,形成数据高速公路。 2 | 3 | 发布API服务实现低代码开发,通过页面配置化就可以发布API,不再需要硬编码。 4 | 5 | 简单sql还可以通过自行通过java代码来解析,带条件判断的,比如类mybatis配置的sql才是关键, 6 | 7 | 这就需要hasor-dataql来实现动态sql。 8 | 9 | 通过hasor-dataql,实现的sql配置api能力可以满足99%以上的API开发场景。 -------------------------------------------------------------------------------- /zhili-gateway/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | servlet: 3 | context-path: /gateway 4 | 5 | spring: 6 | profiles: 7 | active: dev 8 | application: 9 | name: gateway 10 | 11 | logging: 12 | config: classpath:logback-gateway.xml -------------------------------------------------------------------------------- /zhili-ui/src/main/java/org/example/App.java: -------------------------------------------------------------------------------- 1 | package org.example; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | public static void main( String[] args ) 10 | { 11 | System.out.println( "Hello World!" ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /zhili-collect/src/main/java/org/example/App.java: -------------------------------------------------------------------------------- 1 | package org.example; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | public static void main( String[] args ) 10 | { 11 | System.out.println( "Hello World!" ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /zhili-safe/src/main/java/org/example/App.java: -------------------------------------------------------------------------------- 1 | package org.example; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | public static void main( String[] args ) 10 | { 11 | System.out.println( "Hello World!" ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-admin/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | servlet: 3 | context-path: /metadata 4 | 5 | spring: 6 | profiles: 7 | active: dev 8 | application: 9 | name: metadata 10 | 11 | logging: 12 | config: classpath:logback-admin.xml -------------------------------------------------------------------------------- /zhili-monitor/zhili-monitor-admin/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | servlet: 3 | context-path: /monitor 4 | 5 | spring: 6 | profiles: 7 | active: dev 8 | application: 9 | name: dataservice 10 | 11 | logging: 12 | config: classpath:logback-monitor.xml -------------------------------------------------------------------------------- /zhili-report/zhili-report-admin/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | servlet: 3 | context-path: /report 4 | 5 | spring: 6 | profiles: 7 | active: dev 8 | application: 9 | name: dataservice 10 | 11 | logging: 12 | config: classpath:logback-report.xml -------------------------------------------------------------------------------- /zhili-scheduler/src/main/java/com/niezhili/App.java: -------------------------------------------------------------------------------- 1 | package com.niezhili; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | public static void main( String[] args ) 10 | { 11 | System.out.println( "Hello World!" ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-sdk/src/main/java/org/example/App.java: -------------------------------------------------------------------------------- 1 | package org.example; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | public static void main( String[] args ) 10 | { 11 | System.out.println( "Hello World!" ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-datasource/src/main/java/org/example/App.java: -------------------------------------------------------------------------------- 1 | package org.example; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | public static void main( String[] args ) 10 | { 11 | System.out.println( "Hello World!" ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /zhili-monitor/zhili-monitor-admin/src/main/resources/application-dev.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 18091 3 | 4 | spring: 5 | influxdb: 6 | url: http://localhost:8086 7 | username: root 8 | password: root 9 | database: test 10 | retention-policy: autogen 11 | connect-timeout: 10 12 | read-timeout: 30 13 | write-timeout: 10 -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-api/src/main/java/com/niezhili/dataplatform/dataservice/App.java: -------------------------------------------------------------------------------- 1 | package com.niezhili.dataplatform.dataservice; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | public static void main( String[] args ) 10 | { 11 | System.out.println( "Hello World!" ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /zhili-safe/src/test/java/org/example/AppTest.java: -------------------------------------------------------------------------------- 1 | package org.example; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | { 12 | /** 13 | * Rigorous Test :-) 14 | */ 15 | @Test 16 | public void shouldAnswerWithTrue() 17 | { 18 | assertTrue( true ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /zhili-ui/src/test/java/org/example/AppTest.java: -------------------------------------------------------------------------------- 1 | package org.example; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | { 12 | /** 13 | * Rigorous Test :-) 14 | */ 15 | @Test 16 | public void shouldAnswerWithTrue() 17 | { 18 | assertTrue( true ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /zhili-collect/src/test/java/org/example/AppTest.java: -------------------------------------------------------------------------------- 1 | package org.example; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | { 12 | /** 13 | * Rigorous Test :-) 14 | */ 15 | @Test 16 | public void shouldAnswerWithTrue() 17 | { 18 | assertTrue( true ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /zhili-gateway/src/test/java/org/example/AppTest.java: -------------------------------------------------------------------------------- 1 | package org.example; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | { 12 | /** 13 | * Rigorous Test :-) 14 | */ 15 | @Test 16 | public void shouldAnswerWithTrue() 17 | { 18 | assertTrue( true ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /zhili-scheduler/src/test/java/com/niezhili/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.niezhili; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | { 12 | /** 13 | * Rigorous Test :-) 14 | */ 15 | @Test 16 | public void shouldAnswerWithTrue() 17 | { 18 | assertTrue( true ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-api/src/test/java/org/example/AppTest.java: -------------------------------------------------------------------------------- 1 | package org.example; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | { 12 | /** 13 | * Rigorous Test :-) 14 | */ 15 | @Test 16 | public void shouldAnswerWithTrue() 17 | { 18 | assertTrue( true ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-dao/src/test/java/org/example/AppTest.java: -------------------------------------------------------------------------------- 1 | package org.example; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | { 12 | /** 13 | * Rigorous Test :-) 14 | */ 15 | @Test 16 | public void shouldAnswerWithTrue() 17 | { 18 | assertTrue( true ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-sdk/src/test/java/org/example/AppTest.java: -------------------------------------------------------------------------------- 1 | package org.example; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | { 12 | /** 13 | * Rigorous Test :-) 14 | */ 15 | @Test 16 | public void shouldAnswerWithTrue() 17 | { 18 | assertTrue( true ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-admin/src/test/java/org/example/AppTest.java: -------------------------------------------------------------------------------- 1 | package org.example; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import org.junit.Test; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | { 12 | /** 13 | * Rigorous Test :-) 14 | */ 15 | @Test 16 | public void shouldAnswerWithTrue() 17 | { 18 | assertTrue( true ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /zhili-gateway/zhili-gateway.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/workflows/maven.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build a Java project with Maven 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven 3 | 4 | name: Java CI with Maven 5 | 6 | on: 7 | push: 8 | branches: [ master ] 9 | pull_request: 10 | branches: [ master ] 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - uses: actions/checkout@v2 19 | - name: Set up JDK 8 20 | uses: actions/setup-java@v2 21 | with: 22 | java-version: '8' 23 | distribution: 'adopt' 24 | - name: Build with Maven 25 | run: mvn -B package --file pom.xml 26 | -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-admin/src/main/resources/bootstrap.yml: -------------------------------------------------------------------------------- 1 | server: 2 | servlet: 3 | context-path: /dataservice 4 | 5 | 6 | 7 | logging: 8 | config: classpath:logback-admin.xml 9 | 10 | # Spring 11 | spring: 12 | profiles: 13 | active: dev 14 | application: 15 | name: dataservice 16 | cloud: 17 | nacos: 18 | discovery: 19 | # 服务注册地址 20 | server-addr: 127.0.0.1:8848 21 | # group: ZHILI_DATAPLATFORM_DEV_GROUP 22 | # namespace: 53e6e7f5-d45f-4f84-800c-1d2fedb30ada 23 | config: 24 | # 配置中心地址 25 | server-addr: 127.0.0.1:8848 26 | # 配置文件格式 27 | file-extension: yml 28 | # group: ZHILI_DATAPLATFORM_DEV_GROUP 29 | # namespace: 53e6e7f5-d45f-4f84-800c-1d2fedb30ada 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # zhili-dataplatform 2 | 3 | 目前国内数据中台建设如火如荼,作为近20年的java开发经验的java程序员老兵,结合多年的数据中台建设经验, 4 | 5 | 仅以此开源数据中台项目纪念袁隆平先生,以开源精神回馈社区,让数据就像粮食一样,让中小企业有数据可用,数据能吃饱,推动社会多一点点进步! 6 | 7 | 数据中台项目结构复杂,开发工作量巨大,一般中小创业公司是承担不起独立开发的成本。 8 | 9 | 本着空谈误国,实干兴邦的宗旨,我们利用工作闲暇时间,来一点一点用程序实现我们的梦想。日积月累,坚持就是胜利! 10 | 11 | 急需产品人员(Axure等),前端设计人员(sketch等)、前端开发人员(Vue.js等)一起加入进来。 12 | 13 | ## zhili-dataplatform数据中台总体架构 14 | 15 | 见同目录zhili-dataplatform.jpg 16 | 17 | 为方便国内用户下载,码云地址:https://gitee.com/javasqlbug/zhili-dataplatform.git 18 | 19 | ## zhili-dataplatform数据中台技术架构 20 | 21 | Java后端使用目前主流Spring Cloud Gateway + Spring Cloud Alibaba + Mybatis的Java微服务架构, 22 | 数据库使用Mysql,缓存使用Redis,注册中心和配置中心使用Nacos, 23 | 底层大数据平台使用Hadoop、Hive、Spark、Flink、HBase等,统一权限底层组件使用Ranger, 24 | 账号体系先写入Mysql,最终使用OpenLDAP,底层大数据组件认证以OpenLDAP为中心, 25 | 前端使用Vue.js,前后端代码分离。 26 | 27 | ## zhili-dataplatform数据中台(Go语言版) 28 | 目前云原生概念越来越火,Java在大数据生态有越来越被Go超越的趋势,未来将会是Go语言的天下。 29 | 云原生基本都是Go生态,后续将会提供zhili-dataplatform-go工程, 30 | 将会采用k8s+istio主流Go云原生微服务网格架构开发和部署,敬请期待! 31 | -------------------------------------------------------------------------------- /zhili-report/zhili-report-admin/src/main/java/com/niezhili/dataplatform/monitor/admin/service/ReportService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.monitor.admin.service; 19 | 20 | public interface ReportService { 21 | 22 | void test(); 23 | } 24 | -------------------------------------------------------------------------------- /zhili-monitor/zhili-monitor-admin/src/main/java/com/niezhili/dataplatform/monitor/admin/service/MonitorService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.monitor.admin.service; 19 | 20 | public interface MonitorService { 21 | 22 | void test(); 23 | } 24 | -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-admin/src/main/java/com/niezhili/dataplatform/metadata/admin/service/ApplicationService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.metadata.admin.service; 19 | 20 | public interface ApplicationService { 21 | 22 | void test(); 23 | } 24 | -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-admin/src/main/java/com/niezhili/dataplatform/dataservice/admin/service/ApplicationService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.dataservice.admin.service; 19 | 20 | public interface ApplicationService { 21 | 22 | void test(); 23 | } 24 | -------------------------------------------------------------------------------- /.github/workflows/maven-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build a package using Maven and then publish it to GitHub packages when a release is created 2 | # For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path 3 | 4 | name: Maven Package 5 | 6 | on: 7 | release: 8 | types: [created] 9 | 10 | jobs: 11 | build: 12 | 13 | runs-on: ubuntu-latest 14 | permissions: 15 | contents: read 16 | packages: write 17 | 18 | steps: 19 | - uses: actions/checkout@v2 20 | - name: Set up JDK 8 21 | uses: actions/setup-java@v2 22 | with: 23 | java-version: '8' 24 | distribution: 'adopt' 25 | server-id: github # Value of the distributionManagement/repository/id field of the pom.xml 26 | settings-path: ${{ github.workspace }} # location for the settings.xml file 27 | 28 | - name: Build with Maven 29 | run: mvn -B package --file pom.xml 30 | 31 | - name: Publish to GitHub Packages Apache Maven 32 | run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml 33 | env: 34 | GITHUB_TOKEN: ${{ github.token }} 35 | -------------------------------------------------------------------------------- /zhili-report/zhili-report-dao/src/main/java/com/niezhili/dataplatform/monitor/dao/AbstractBaseDao.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.monitor.dao; 18 | 19 | /** 20 | * base dao 21 | */ 22 | public abstract class AbstractBaseDao { 23 | 24 | /** 25 | * init 26 | */ 27 | protected abstract void init(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-dao/src/main/java/com/niezhili/dataplatform/metadata/dao/AbstractBaseDao.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.metadata.dao; 18 | 19 | /** 20 | * base dao 21 | */ 22 | public abstract class AbstractBaseDao { 23 | 24 | /** 25 | * init 26 | */ 27 | protected abstract void init(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-dao/src/main/java/com/niezhili/dataplatform/dataservice/dao/AbstractBaseDao.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.dataservice.dao; 18 | 19 | /** 20 | * base dao 21 | */ 22 | public abstract class AbstractBaseDao { 23 | 24 | /** 25 | * init 26 | */ 27 | protected abstract void init(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-datasource/src/test/java/com/niezhili/dataplatform/metadata/Field.java: -------------------------------------------------------------------------------- 1 | package com.niezhili.dataplatform.metadata; 2 | 3 | 4 | public class Field { 5 | 6 | private String fieldName; 7 | private String fieldType; 8 | private Integer fieldLength; 9 | 10 | public Field() { 11 | } 12 | 13 | public Field(String fieldName, String fieldType, Integer fieldLength) { 14 | this.fieldName = fieldName; 15 | this.fieldType = fieldType; 16 | this.fieldLength = fieldLength; 17 | } 18 | 19 | public String getFieldName() { 20 | return fieldName; 21 | } 22 | 23 | public void setFieldName(String fieldName) { 24 | this.fieldName = fieldName; 25 | } 26 | 27 | public String getFieldType() { 28 | return fieldType; 29 | } 30 | 31 | public void setFieldType(String fieldType) { 32 | this.fieldType = fieldType; 33 | } 34 | 35 | public Integer getFieldLength() { 36 | return fieldLength; 37 | } 38 | 39 | public void setFieldLength(Integer fieldLength) { 40 | this.fieldLength = fieldLength; 41 | } 42 | 43 | @Override 44 | public String toString() { 45 | return "Field [fieldName=" + fieldName + ", fieldType=" + fieldType + ", fieldLength" + fieldLength + "]"; 46 | } 47 | } -------------------------------------------------------------------------------- /zhili-monitor/zhili-monitor-admin/src/main/java/com/niezhili/dataplatform/monitor/admin/controller/BaseController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.monitor.admin.controller; 19 | 20 | 21 | import org.slf4j.Logger; 22 | import org.slf4j.LoggerFactory; 23 | 24 | /** 25 | * @author niezhili 26 | * @date 2021-06-20 27 | * 监控管理controller 28 | */ 29 | public class BaseController { 30 | 31 | private static final Logger logger = LoggerFactory.getLogger(BaseController.class); 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /zhili-report/zhili-report-admin/src/main/java/com/niezhili/dataplatform/monitor/admin/controller/BaseController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.monitor.admin.controller; 19 | 20 | 21 | import org.slf4j.Logger; 22 | import org.slf4j.LoggerFactory; 23 | 24 | /** 25 | * @author niezhili 26 | * @date 2021-05-29 27 | * 应用管理controller 28 | */ 29 | public class BaseController { 30 | 31 | private static final Logger logger = LoggerFactory.getLogger(BaseController.class); 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-admin/src/main/java/com/niezhili/dataplatform/metadata/admin/controller/BaseController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.metadata.admin.controller; 19 | 20 | 21 | import org.slf4j.Logger; 22 | import org.slf4j.LoggerFactory; 23 | 24 | /** 25 | * @author niezhili 26 | * @date 2021-05-29 27 | * 应用管理controller 28 | */ 29 | public class BaseController { 30 | 31 | private static final Logger logger = LoggerFactory.getLogger(BaseController.class); 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-admin/src/main/java/com/niezhili/dataplatform/dataservice/admin/controller/BaseController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.dataservice.admin.controller; 19 | 20 | 21 | import org.slf4j.Logger; 22 | import org.slf4j.LoggerFactory; 23 | 24 | /** 25 | * @author niezhili 26 | * @date 2021-05-29 27 | * 应用管理controller 28 | */ 29 | public class BaseController { 30 | 31 | private static final Logger logger = LoggerFactory.getLogger(BaseController.class); 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-admin/src/main/java/com/niezhili/dataplatform/dataservice/admin/aspect/AccessLogAnnotation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.dataservice.admin.aspect; 19 | 20 | import java.lang.annotation.*; 21 | 22 | @Target(ElementType.METHOD) 23 | @Retention(RetentionPolicy.RUNTIME) 24 | @Documented 25 | public @interface AccessLogAnnotation { 26 | // ignore request args 27 | String[] ignoreRequestArgs() default {}; 28 | 29 | boolean ignoreRequest() default false; 30 | 31 | boolean ignoreResponse() default true; 32 | } 33 | -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-admin/src/main/java/com/niezhili/dataplatform/dataservice/admin/exceptions/ApiException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.dataservice.admin.exceptions; 18 | 19 | 20 | import com.niezhili.dataplatform.dataservice.admin.enums.Status; 21 | 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.Target; 24 | 25 | import static java.lang.annotation.ElementType.METHOD; 26 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 27 | 28 | /** 29 | * controller exception annotation 30 | */ 31 | @Retention(RUNTIME) 32 | @Target(METHOD) 33 | public @interface ApiException { 34 | Status value(); 35 | } 36 | -------------------------------------------------------------------------------- /zhili-gateway/src/main/java/com/niezhili/dataplatform/gateway/ZhiliGatewayApplicationServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.gateway; 19 | 20 | import org.springframework.boot.SpringApplication; 21 | import org.springframework.boot.autoconfigure.SpringBootApplication; 22 | import org.springframework.boot.web.servlet.ServletComponentScan; 23 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 24 | import org.springframework.context.annotation.ComponentScan; 25 | import org.springframework.context.annotation.FilterType; 26 | 27 | /** 28 | * @author niezhili 29 | * @date 2021-06-20 30 | */ 31 | @SpringBootApplication 32 | @ComponentScan(value = "com.niezhili.dataplatform", 33 | excludeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = "com.niezhili.dataplatform.*")) 34 | public class ZhiliGatewayApplicationServer extends SpringBootServletInitializer { 35 | 36 | public static void main(String[] args) { 37 | SpringApplication.run(ZhiliGatewayApplicationServer.class, args); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /zhili-report/zhili-report-dao/src/main/resources/com.niezhili.dataplatform.report.dao.mapper/ProjectUserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | id, user_id, project_id, perm, create_time, update_time 23 | 24 | 25 | delete from t_ds_relation_project_user 26 | where 1=1 27 | and user_id = #{userId} 28 | 29 | and project_id = #{projectId} 30 | 31 | 32 | 40 | 41 | -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-dao/src/main/resources/com.niezhili.dataplatform.metadata.dao.mapper/ProjectUserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | id, user_id, project_id, perm, create_time, update_time 23 | 24 | 25 | delete from t_ds_relation_project_user 26 | where 1=1 27 | and user_id = #{userId} 28 | 29 | and project_id = #{projectId} 30 | 31 | 32 | 40 | 41 | -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-dao/src/main/resources/com.niezhili.dataplatform.dataservice.dao.mapper/ProjectUserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | id, user_id, project_id, perm, create_time, update_time 23 | 24 | 25 | delete from t_ds_relation_project_user 26 | where 1=1 27 | and user_id = #{userId} 28 | 29 | and project_id = #{projectId} 30 | 31 | 32 | 40 | 41 | -------------------------------------------------------------------------------- /zhili-report/zhili-report-admin/src/main/java/com/niezhili/dataplatform/monitor/ZhiliReportAdminApplicationServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.monitor; 19 | 20 | import org.springframework.boot.SpringApplication; 21 | import org.springframework.boot.autoconfigure.SpringBootApplication; 22 | import org.springframework.boot.web.servlet.ServletComponentScan; 23 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 24 | import org.springframework.context.annotation.ComponentScan; 25 | import org.springframework.context.annotation.FilterType; 26 | 27 | /** 28 | * @author niezhili 29 | * @date 2021-05-23 30 | */ 31 | @SpringBootApplication 32 | @ServletComponentScan 33 | @ComponentScan(value = "com.niezhili.dataplatform", 34 | excludeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.apache.dolphinscheduler.server.*")) 35 | public class ZhiliReportAdminApplicationServer extends SpringBootServletInitializer { 36 | 37 | public static void main(String[] args) { 38 | SpringApplication.run(ZhiliReportAdminApplicationServer.class, args); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /zhili-monitor/zhili-monitor-admin/src/main/java/com/niezhili/dataplatform/monitor/ZhiliMonitorAdminApplicationServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.monitor; 19 | 20 | import org.springframework.boot.SpringApplication; 21 | import org.springframework.boot.autoconfigure.SpringBootApplication; 22 | import org.springframework.boot.web.servlet.ServletComponentScan; 23 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 24 | import org.springframework.context.annotation.ComponentScan; 25 | import org.springframework.context.annotation.FilterType; 26 | 27 | /** 28 | * @author niezhili 29 | * @date 2021-06-20 30 | */ 31 | @SpringBootApplication 32 | @ServletComponentScan 33 | @ComponentScan(value = "com.niezhili.dataplatform", 34 | excludeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.apache.dolphinscheduler.server.*")) 35 | public class ZhiliMonitorAdminApplicationServer extends SpringBootServletInitializer { 36 | 37 | public static void main(String[] args) { 38 | SpringApplication.run(ZhiliMonitorAdminApplicationServer.class, args); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-admin/src/main/java/com/niezhili/dataplatform/metadata/ZhiliMetadataAdminApplicationServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.metadata; 19 | 20 | import org.springframework.boot.SpringApplication; 21 | import org.springframework.boot.autoconfigure.SpringBootApplication; 22 | import org.springframework.boot.web.servlet.ServletComponentScan; 23 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 24 | import org.springframework.context.annotation.ComponentScan; 25 | import org.springframework.context.annotation.FilterType; 26 | 27 | /** 28 | * @author niezhili 29 | * @date 2021-05-23 30 | */ 31 | @SpringBootApplication 32 | @ServletComponentScan 33 | @ComponentScan(value = "com.niezhili.dataplatform", 34 | excludeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.apache.dolphinscheduler.server.*")) 35 | public class ZhiliMetadataAdminApplicationServer extends SpringBootServletInitializer { 36 | 37 | public static void main(String[] args) { 38 | SpringApplication.run(ZhiliMetadataAdminApplicationServer.class, args); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /zhili-report/zhili-report-admin/src/main/java/com/niezhili/dataplatform/monitor/admin/service/impl/ReportServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.monitor.admin.service.impl; 19 | 20 | import com.niezhili.dataplatform.monitor.dao.entity.Project; 21 | import com.niezhili.dataplatform.monitor.dao.mapper.ProjectMapper; 22 | import com.niezhili.dataplatform.monitor.admin.service.ReportService; 23 | import org.springframework.beans.factory.annotation.Autowired; 24 | import org.springframework.stereotype.Service; 25 | 26 | import java.util.Date; 27 | 28 | @Service 29 | public class ReportServiceImpl implements ReportService { 30 | 31 | @Autowired 32 | private ProjectMapper projectMapper; 33 | 34 | @Override 35 | public void test() { 36 | Date now = new Date(); 37 | Project project = Project 38 | .newBuilder() 39 | .name("测试项目") 40 | .description("ssss") 41 | .userId(111) 42 | .userName("niezhili") 43 | .createTime(now) 44 | .updateTime(now) 45 | .build(); 46 | 47 | projectMapper.insert(project); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-admin/src/main/java/com/niezhili/dataplatform/metadata/admin/service/impl/ApplicationServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.metadata.admin.service.impl; 19 | 20 | import com.niezhili.dataplatform.metadata.dao.entity.Project; 21 | import com.niezhili.dataplatform.metadata.dao.mapper.ProjectMapper; 22 | import com.niezhili.dataplatform.metadata.admin.service.ApplicationService; 23 | import org.springframework.beans.factory.annotation.Autowired; 24 | import org.springframework.stereotype.Service; 25 | 26 | import java.util.Date; 27 | 28 | @Service 29 | public class ApplicationServiceImpl implements ApplicationService { 30 | 31 | @Autowired 32 | private ProjectMapper projectMapper; 33 | 34 | @Override 35 | public void test() { 36 | Date now = new Date(); 37 | Project project = Project 38 | .newBuilder() 39 | .name("测试项目") 40 | .description("ssss") 41 | .userId(111) 42 | .userName("niezhili") 43 | .createTime(now) 44 | .updateTime(now) 45 | .build(); 46 | 47 | projectMapper.insert(project); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-admin/src/main/java/com/niezhili/dataplatform/dataservice/admin/service/impl/ApplicationServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.dataservice.admin.service.impl; 19 | 20 | import com.niezhili.dataplatform.dataservice.admin.service.ApplicationService; 21 | import com.niezhili.dataplatform.dataservice.dao.entity.Project; 22 | import com.niezhili.dataplatform.dataservice.dao.mapper.ProjectMapper; 23 | import org.springframework.beans.factory.annotation.Autowired; 24 | import org.springframework.stereotype.Service; 25 | 26 | import java.util.Date; 27 | 28 | @Service 29 | public class ApplicationServiceImpl implements ApplicationService { 30 | 31 | @Autowired 32 | private ProjectMapper projectMapper; 33 | 34 | @Override 35 | public void test() { 36 | Date now = new Date(); 37 | Project project = Project 38 | .newBuilder() 39 | .name("测试项目") 40 | .description("ssss") 41 | .userId(111) 42 | .userName("niezhili") 43 | .createTime(now) 44 | .updateTime(now) 45 | .build(); 46 | 47 | projectMapper.insert(project); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-admin/src/main/java/com/niezhili/dataplatform/dataservice/ZhiliDataServiceAdminApplicationServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.dataservice; 19 | 20 | import org.springframework.boot.SpringApplication; 21 | import org.springframework.boot.autoconfigure.SpringBootApplication; 22 | import org.springframework.boot.web.servlet.ServletComponentScan; 23 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 24 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 25 | import org.springframework.context.annotation.ComponentScan; 26 | import org.springframework.context.annotation.FilterType; 27 | 28 | /** 29 | * @author niezhili 30 | * @date 2021-05-23 31 | */ 32 | @SpringBootApplication 33 | @ServletComponentScan 34 | @EnableDiscoveryClient 35 | @ComponentScan(value = "com.niezhili.dataplatform", 36 | excludeFilters = @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.apache.dolphinscheduler.server.*")) 37 | public class ZhiliDataServiceAdminApplicationServer extends SpringBootServletInitializer { 38 | 39 | public static void main(String[] args) { 40 | SpringApplication.run(ZhiliDataServiceAdminApplicationServer.class, args); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /zhili-report/zhili-report-dao/src/main/java/com/niezhili/dataplatform/monitor/dao/DaoFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.monitor.dao; 18 | 19 | import org.slf4j.Logger; 20 | import org.slf4j.LoggerFactory; 21 | 22 | import java.util.Map; 23 | import java.util.concurrent.ConcurrentHashMap; 24 | 25 | /** 26 | * dao factory 27 | */ 28 | public class DaoFactory { 29 | 30 | private static final Logger logger = LoggerFactory.getLogger(DaoFactory.class); 31 | 32 | private static Map daoMap = new ConcurrentHashMap<>(); 33 | 34 | private DaoFactory(){ 35 | 36 | } 37 | 38 | /** 39 | * get dao instance 40 | * @param clazz clazz 41 | * @param T 42 | * @return T object 43 | */ 44 | @SuppressWarnings("unchecked") 45 | public static T getDaoInstance(Class clazz) { 46 | String className = clazz.getName(); 47 | synchronized (daoMap) { 48 | if (!daoMap.containsKey(className)) { 49 | try { 50 | T t = clazz.getConstructor().newInstance(); 51 | // init 52 | t.init(); 53 | daoMap.put(className, t); 54 | } catch (Exception e) { 55 | logger.error(e.getMessage(), e); 56 | } 57 | } 58 | } 59 | 60 | return (T) daoMap.get(className); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-dao/src/main/java/com/niezhili/dataplatform/metadata/dao/DaoFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.metadata.dao; 18 | 19 | import org.slf4j.Logger; 20 | import org.slf4j.LoggerFactory; 21 | 22 | import java.util.Map; 23 | import java.util.concurrent.ConcurrentHashMap; 24 | 25 | /** 26 | * dao factory 27 | */ 28 | public class DaoFactory { 29 | 30 | private static final Logger logger = LoggerFactory.getLogger(DaoFactory.class); 31 | 32 | private static Map daoMap = new ConcurrentHashMap<>(); 33 | 34 | private DaoFactory(){ 35 | 36 | } 37 | 38 | /** 39 | * get dao instance 40 | * @param clazz clazz 41 | * @param T 42 | * @return T object 43 | */ 44 | @SuppressWarnings("unchecked") 45 | public static T getDaoInstance(Class clazz) { 46 | String className = clazz.getName(); 47 | synchronized (daoMap) { 48 | if (!daoMap.containsKey(className)) { 49 | try { 50 | T t = clazz.getConstructor().newInstance(); 51 | // init 52 | t.init(); 53 | daoMap.put(className, t); 54 | } catch (Exception e) { 55 | logger.error(e.getMessage(), e); 56 | } 57 | } 58 | } 59 | 60 | return (T) daoMap.get(className); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-dao/src/main/java/com/niezhili/dataplatform/dataservice/dao/DaoFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.dataservice.dao; 18 | 19 | import org.slf4j.Logger; 20 | import org.slf4j.LoggerFactory; 21 | 22 | import java.util.Map; 23 | import java.util.concurrent.ConcurrentHashMap; 24 | 25 | /** 26 | * dao factory 27 | */ 28 | public class DaoFactory { 29 | 30 | private static final Logger logger = LoggerFactory.getLogger(DaoFactory.class); 31 | 32 | private static Map daoMap = new ConcurrentHashMap<>(); 33 | 34 | private DaoFactory(){ 35 | 36 | } 37 | 38 | /** 39 | * get dao instance 40 | * @param clazz clazz 41 | * @param T 42 | * @return T object 43 | */ 44 | @SuppressWarnings("unchecked") 45 | public static T getDaoInstance(Class clazz) { 46 | String className = clazz.getName(); 47 | synchronized (daoMap) { 48 | if (!daoMap.containsKey(className)) { 49 | try { 50 | T t = clazz.getConstructor().newInstance(); 51 | // init 52 | t.init(); 53 | daoMap.put(className, t); 54 | } catch (Exception e) { 55 | logger.error(e.getMessage(), e); 56 | } 57 | } 58 | } 59 | 60 | return (T) daoMap.get(className); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /zhili-monitor/zhili-monitor-admin/src/main/java/com/niezhili/dataplatform/monitor/admin/service/impl/MonitorServiceImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.monitor.admin.service.impl; 19 | 20 | import com.niezhili.dataplatform.monitor.admin.service.MonitorService; 21 | import org.influxdb.dto.Point; 22 | import org.slf4j.Logger; 23 | import org.slf4j.LoggerFactory; 24 | import org.springframework.beans.factory.annotation.Autowired; 25 | import org.springframework.beans.factory.annotation.Value; 26 | import org.springframework.data.influxdb.InfluxDBTemplate; 27 | import org.springframework.stereotype.Service; 28 | 29 | import java.util.concurrent.TimeUnit; 30 | 31 | @Service 32 | public class MonitorServiceImpl implements MonitorService { 33 | 34 | private static final Logger logger = LoggerFactory.getLogger(MonitorServiceImpl.class); 35 | 36 | @Autowired 37 | private InfluxDBTemplate influxDBTemplate; 38 | 39 | @Value("${spring.influxdb.database}") 40 | private String databaseName; 41 | 42 | 43 | @Override 44 | public void test() { 45 | 46 | logger.debug("调用influxdb"); 47 | final Point p = Point.measurement("disk") 48 | .time(System.currentTimeMillis(), TimeUnit.MILLISECONDS) 49 | .tag("tenant", "default") 50 | .addField("used", 80L) 51 | .addField("free", 1L) 52 | .build(); 53 | influxDBTemplate.write(p); 54 | 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /zhili-common/src/main/java/com/niezhili/dataplatform/common/enums/DbType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.common.enums; 18 | 19 | //import com.baomidou.mybatisplus.annotation.EnumValue; 20 | 21 | import java.util.HashMap; 22 | 23 | /** 24 | * data base types 25 | */ 26 | public enum DbType { 27 | /** 28 | * 0 mysql 29 | * 1 postgresql 30 | * 2 hive 31 | * 3 spark 32 | * 4 clickhouse 33 | * 5 oracle 34 | * 6 sqlserver 35 | * 7 db2 36 | * 8 presto 37 | */ 38 | MYSQL(0, "mysql"), 39 | POSTGRESQL(1, "postgresql"), 40 | HIVE(2, "hive"), 41 | SPARK(3, "spark"), 42 | CLICKHOUSE(4, "clickhouse"), 43 | ORACLE(5, "oracle"), 44 | SQLSERVER(6, "sqlserver"), 45 | DB2(7, "db2"), 46 | PRESTO(8, "presto"); 47 | 48 | DbType(int code, String descp) { 49 | this.code = code; 50 | this.descp = descp; 51 | } 52 | 53 | //@EnumValue 54 | private final int code; 55 | private final String descp; 56 | 57 | public int getCode() { 58 | return code; 59 | } 60 | 61 | public String getDescp() { 62 | return descp; 63 | } 64 | 65 | 66 | private static HashMap DB_TYPE_MAP =new HashMap<>(); 67 | 68 | static { 69 | for (DbType dbType:DbType.values()){ 70 | DB_TYPE_MAP.put(dbType.getCode(),dbType); 71 | } 72 | } 73 | 74 | public static DbType of(int type){ 75 | if(DB_TYPE_MAP.containsKey(type)){ 76 | return DB_TYPE_MAP.get(type); 77 | } 78 | return null; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /zhili-report/zhili-report-admin/src/main/java/com/niezhili/dataplatform/monitor/admin/configuration/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.monitor.admin.configuration; 18 | 19 | import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI; 20 | import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; 21 | import org.springframework.context.annotation.Bean; 22 | import org.springframework.context.annotation.Configuration; 23 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 24 | import springfox.documentation.builders.ApiInfoBuilder; 25 | import springfox.documentation.builders.PathSelectors; 26 | import springfox.documentation.builders.RequestHandlerSelectors; 27 | import springfox.documentation.service.ApiInfo; 28 | import springfox.documentation.spi.DocumentationType; 29 | import springfox.documentation.spring.web.plugins.Docket; 30 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 31 | 32 | /** 33 | * 34 | * swager2 config class 35 | * 36 | */ 37 | @Configuration 38 | @EnableSwagger2 39 | @EnableSwaggerBootstrapUI 40 | @ConditionalOnWebApplication 41 | public class SwaggerConfig implements WebMvcConfigurer { 42 | 43 | @Bean 44 | public Docket createRestApi() { 45 | return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select() 46 | .apis(RequestHandlerSelectors.basePackage("com.niezhili.dataplatform.report.admin.controller")).paths(PathSelectors.any()) 47 | .build(); 48 | } 49 | 50 | private ApiInfo apiInfo() { 51 | return new ApiInfoBuilder().title("Zhili Dataplatform Report Admin Api Docs").description("Zhili Dataplatform Report Admin Api Docs") 52 | .build(); 53 | } 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /zhili-monitor/zhili-monitor-admin/src/main/java/com/niezhili/dataplatform/monitor/admin/configuration/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.monitor.admin.configuration; 18 | 19 | import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI; 20 | import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; 21 | import org.springframework.context.annotation.Bean; 22 | import org.springframework.context.annotation.Configuration; 23 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 24 | import springfox.documentation.builders.ApiInfoBuilder; 25 | import springfox.documentation.builders.PathSelectors; 26 | import springfox.documentation.builders.RequestHandlerSelectors; 27 | import springfox.documentation.service.ApiInfo; 28 | import springfox.documentation.spi.DocumentationType; 29 | import springfox.documentation.spring.web.plugins.Docket; 30 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 31 | 32 | /** 33 | * 34 | * swager2 config class 35 | * 36 | */ 37 | @Configuration 38 | @EnableSwagger2 39 | @EnableSwaggerBootstrapUI 40 | @ConditionalOnWebApplication 41 | public class SwaggerConfig implements WebMvcConfigurer { 42 | 43 | @Bean 44 | public Docket createRestApi() { 45 | return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select() 46 | .apis(RequestHandlerSelectors.basePackage("com.niezhili.dataplatform.monitor.admin.controller")).paths(PathSelectors.any()) 47 | .build(); 48 | } 49 | 50 | private ApiInfo apiInfo() { 51 | return new ApiInfoBuilder().title("Zhili Dataplatform Monitor Admin Api Docs").description("Zhili Dataplatform Monitor Admin Api Docs") 52 | .build(); 53 | } 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-admin/src/main/java/com/niezhili/dataplatform/metadata/admin/configuration/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.metadata.admin.configuration; 18 | 19 | import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI; 20 | import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; 21 | import org.springframework.context.annotation.Bean; 22 | import org.springframework.context.annotation.Configuration; 23 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 24 | import springfox.documentation.builders.ApiInfoBuilder; 25 | import springfox.documentation.builders.PathSelectors; 26 | import springfox.documentation.builders.RequestHandlerSelectors; 27 | import springfox.documentation.service.ApiInfo; 28 | import springfox.documentation.spi.DocumentationType; 29 | import springfox.documentation.spring.web.plugins.Docket; 30 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 31 | 32 | /** 33 | * 34 | * swager2 config class 35 | * 36 | */ 37 | @Configuration 38 | @EnableSwagger2 39 | @EnableSwaggerBootstrapUI 40 | @ConditionalOnWebApplication 41 | public class SwaggerConfig implements WebMvcConfigurer { 42 | 43 | @Bean 44 | public Docket createRestApi() { 45 | return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select() 46 | .apis(RequestHandlerSelectors.basePackage("com.niezhili.dataplatform.metadata.admin.controller")).paths(PathSelectors.any()) 47 | .build(); 48 | } 49 | 50 | private ApiInfo apiInfo() { 51 | return new ApiInfoBuilder().title("Zhili Dataplatform Metadata Admin Api Docs").description("Zhili Dataplatform Metadata Admin Api Docs") 52 | .build(); 53 | } 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-admin/src/main/java/com/niezhili/dataplatform/dataservice/admin/configuration/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.dataservice.admin.configuration; 18 | 19 | import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI; 20 | import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; 21 | import org.springframework.context.annotation.Bean; 22 | import org.springframework.context.annotation.Configuration; 23 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 24 | import springfox.documentation.builders.ApiInfoBuilder; 25 | import springfox.documentation.builders.PathSelectors; 26 | import springfox.documentation.builders.RequestHandlerSelectors; 27 | import springfox.documentation.service.ApiInfo; 28 | import springfox.documentation.spi.DocumentationType; 29 | import springfox.documentation.spring.web.plugins.Docket; 30 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 31 | 32 | /** 33 | * 34 | * swager2 config class 35 | * 36 | */ 37 | @Configuration 38 | @EnableSwagger2 39 | @EnableSwaggerBootstrapUI 40 | @ConditionalOnWebApplication 41 | public class SwaggerConfig implements WebMvcConfigurer { 42 | 43 | @Bean 44 | public Docket createRestApi() { 45 | return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select() 46 | .apis(RequestHandlerSelectors.basePackage("com.niezhili.dataplatform.dataservice.admin.controller")).paths(PathSelectors.any()) 47 | .build(); 48 | } 49 | 50 | private ApiInfo apiInfo() { 51 | return new ApiInfoBuilder().title("Zhili Dataplatform DataService Admin Api Docs").description("Zhili Dataplatform DataService Admin Api Docs") 52 | .build(); 53 | } 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /zhili-monitor/zhili-monitor-admin/src/main/java/com/niezhili/dataplatform/monitor/admin/configuration/InfluxDBConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.monitor.admin.configuration; 18 | 19 | import org.influxdb.dto.Point; 20 | import org.springframework.boot.context.properties.EnableConfigurationProperties; 21 | import org.springframework.context.annotation.Bean; 22 | import org.springframework.context.annotation.Configuration; 23 | import org.springframework.data.influxdb.DefaultInfluxDBTemplate; 24 | import org.springframework.data.influxdb.InfluxDBConnectionFactory; 25 | import org.springframework.data.influxdb.InfluxDBProperties; 26 | import org.springframework.data.influxdb.InfluxDBTemplate; 27 | import org.springframework.data.influxdb.converter.PointConverter; 28 | 29 | @Configuration 30 | @EnableConfigurationProperties(InfluxDBProperties.class) 31 | public class InfluxDBConfiguration 32 | { 33 | @Bean 34 | public InfluxDBConnectionFactory connectionFactory(final InfluxDBProperties properties) 35 | { 36 | return new InfluxDBConnectionFactory(properties); 37 | } 38 | 39 | @Bean 40 | public InfluxDBTemplate influxDBTemplate(final InfluxDBConnectionFactory connectionFactory) 41 | { 42 | /* 43 | * You can use your own 'PointCollectionConverter' implementation, e.g. in case 44 | * you want to use your own custom measurement object. 45 | */ 46 | return new InfluxDBTemplate<>(connectionFactory, new PointConverter()); 47 | } 48 | 49 | @Bean 50 | public DefaultInfluxDBTemplate defaultTemplate(final InfluxDBConnectionFactory connectionFactory) 51 | { 52 | /* 53 | * If you are just dealing with Point objects from 'influxdb-java' you could 54 | * also use an instance of class DefaultInfluxDBTemplate. 55 | */ 56 | return new DefaultInfluxDBTemplate(connectionFactory); 57 | } 58 | } -------------------------------------------------------------------------------- /zhili-gateway/src/main/resources/logback-gateway.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n 28 | 29 | UTF-8 30 | 31 | 32 | 33 | 34 | 35 | ${log.base}/dolphinscheduler-api.log 36 | 37 | INFO 38 | 39 | 40 | ${log.base}/zhili-dataservice-admin.%d{yyyy-MM-dd_HH}.%i.log 41 | 168 42 | 64MB 43 | 44 | 45 | 46 | [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n 47 | 48 | UTF-8 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /zhili-report/zhili-report-admin/src/main/resources/logback-report.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n 28 | 29 | UTF-8 30 | 31 | 32 | 33 | 34 | 35 | ${log.base}/dolphinscheduler-api.log 36 | 37 | INFO 38 | 39 | 40 | ${log.base}/zhili-dataservice-admin.%d{yyyy-MM-dd_HH}.%i.log 41 | 168 42 | 64MB 43 | 44 | 45 | 46 | [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n 47 | 48 | UTF-8 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-admin/src/main/resources/logback-admin.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n 28 | 29 | UTF-8 30 | 31 | 32 | 33 | 34 | 35 | ${log.base}/dolphinscheduler-api.log 36 | 37 | INFO 38 | 39 | 40 | ${log.base}/zhili-dataservice-admin.%d{yyyy-MM-dd_HH}.%i.log 41 | 168 42 | 64MB 43 | 44 | 45 | 46 | [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n 47 | 48 | UTF-8 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /zhili-monitor/zhili-monitor-admin/src/main/resources/logback-monitor.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n 28 | 29 | UTF-8 30 | 31 | 32 | 33 | 34 | 35 | ${log.base}/dolphinscheduler-api.log 36 | 37 | INFO 38 | 39 | 40 | ${log.base}/zhili-dataservice-admin.%d{yyyy-MM-dd_HH}.%i.log 41 | 168 42 | 64MB 43 | 44 | 45 | 46 | [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n 47 | 48 | UTF-8 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-admin/src/main/resources/logback-admin.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n 28 | 29 | UTF-8 30 | 31 | 32 | 33 | 34 | 35 | ${log.base}/dolphinscheduler-api.log 36 | 37 | INFO 38 | 39 | 40 | ${log.base}/zhili-dataservice-admin.%d{yyyy-MM-dd_HH}.%i.log 41 | 168 42 | 64MB 43 | 44 | 45 | 46 | [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n 47 | 48 | UTF-8 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /zhili-report/zhili-report-admin/src/main/java/com/niezhili/dataplatform/monitor/admin/controller/ReportController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.monitor.admin.controller; 19 | 20 | import com.niezhili.dataplatform.monitor.admin.service.ReportService; 21 | import com.niezhili.dataplatform.monitor.admin.utils.Result; 22 | import io.swagger.annotations.Api; 23 | import io.swagger.annotations.ApiOperation; 24 | import org.slf4j.Logger; 25 | import org.slf4j.LoggerFactory; 26 | import org.springframework.beans.factory.annotation.Autowired; 27 | import org.springframework.http.HttpStatus; 28 | import org.springframework.web.bind.annotation.*; 29 | 30 | 31 | /** 32 | * @author niezhili 33 | * @date 2021-06-06 34 | * 报表管理controller 35 | */ 36 | @Api(tags = "报表管理") 37 | @RestController 38 | @RequestMapping("report") 39 | public class ReportController extends BaseController { 40 | 41 | private static final Logger logger = LoggerFactory.getLogger(ReportController.class); 42 | 43 | @Autowired 44 | private ReportService applicationService; 45 | 46 | /** 47 | * create data source 48 | * 49 | * @return create result code 50 | */ 51 | @ApiOperation(value = "create", notes = "CREATE_NOTES") 52 | @PostMapping(value = "/create") 53 | @ResponseStatus(HttpStatus.CREATED) 54 | public Result createDataSource() { 55 | applicationService.test(); 56 | return null; 57 | } 58 | 59 | @ApiOperation(value = "列表", notes = "QUERY_LIST_NOTES") 60 | @GetMapping(value = "/list") 61 | @ResponseStatus(HttpStatus.OK) 62 | public void list() { 63 | System.out.println("测试"); 64 | } 65 | 66 | 67 | @PostMapping(value = "/update") 68 | @ResponseStatus(HttpStatus.OK) 69 | public void update(@RequestParam(value = "id") int id, 70 | @RequestParam(value = "name") String name) { 71 | 72 | 73 | } 74 | 75 | 76 | @PostMapping(value = "/delete") 77 | @ResponseStatus(HttpStatus.OK) 78 | public void delete(@RequestParam(value = "id") int id) { 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /zhili-monitor/zhili-monitor-admin/src/main/java/com/niezhili/dataplatform/monitor/admin/controller/MonitorController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.monitor.admin.controller; 19 | 20 | import com.niezhili.dataplatform.monitor.admin.service.MonitorService; 21 | import com.niezhili.dataplatform.monitor.admin.utils.Result; 22 | import io.swagger.annotations.Api; 23 | import io.swagger.annotations.ApiOperation; 24 | import org.slf4j.Logger; 25 | import org.slf4j.LoggerFactory; 26 | import org.springframework.beans.factory.annotation.Autowired; 27 | import org.springframework.http.HttpStatus; 28 | import org.springframework.web.bind.annotation.*; 29 | 30 | 31 | /** 32 | * @author niezhili 33 | * @date 2021-06-20 34 | * 监控管理controller 35 | */ 36 | @Api(tags = "监控管理") 37 | @RestController 38 | @RequestMapping("monitor") 39 | public class MonitorController extends BaseController { 40 | 41 | private static final Logger logger = LoggerFactory.getLogger(MonitorController.class); 42 | 43 | @Autowired 44 | private MonitorService applicationService; 45 | 46 | /** 47 | * create data source 48 | * 49 | * @return create result code 50 | */ 51 | @ApiOperation(value = "create", notes = "CREATE_NOTES") 52 | @PostMapping(value = "/create") 53 | @ResponseStatus(HttpStatus.CREATED) 54 | public Result createDataSource() { 55 | applicationService.test(); 56 | return null; 57 | } 58 | 59 | @ApiOperation(value = "列表", notes = "QUERY_LIST_NOTES") 60 | @GetMapping(value = "/list") 61 | @ResponseStatus(HttpStatus.OK) 62 | public void list() { 63 | System.out.println("测试"); 64 | } 65 | 66 | 67 | @PostMapping(value = "/update") 68 | @ResponseStatus(HttpStatus.OK) 69 | public void update(@RequestParam(value = "id") int id, 70 | @RequestParam(value = "name") String name) { 71 | 72 | 73 | } 74 | 75 | 76 | @PostMapping(value = "/delete") 77 | @ResponseStatus(HttpStatus.OK) 78 | public void delete(@RequestParam(value = "id") int id) { 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-admin/src/main/java/com/niezhili/dataplatform/metadata/admin/controller/ApplicationController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.metadata.admin.controller; 19 | 20 | import com.niezhili.dataplatform.metadata.admin.service.ApplicationService; 21 | import com.niezhili.dataplatform.metadata.admin.utils.Result; 22 | import io.swagger.annotations.Api; 23 | import io.swagger.annotations.ApiOperation; 24 | import org.slf4j.Logger; 25 | import org.slf4j.LoggerFactory; 26 | import org.springframework.beans.factory.annotation.Autowired; 27 | import org.springframework.http.HttpStatus; 28 | import org.springframework.web.bind.annotation.*; 29 | 30 | 31 | /** 32 | * @author niezhili 33 | * @date 2021-05-29 34 | * 应用管理controller 35 | */ 36 | @Api(tags = "应用管理") 37 | @RestController 38 | @RequestMapping("application") 39 | public class ApplicationController extends BaseController { 40 | 41 | private static final Logger logger = LoggerFactory.getLogger(ApplicationController.class); 42 | 43 | @Autowired 44 | private ApplicationService applicationService; 45 | 46 | /** 47 | * create data source 48 | * 49 | * @return create result code 50 | */ 51 | @ApiOperation(value = "create", notes = "CREATE_NOTES") 52 | @PostMapping(value = "/create") 53 | @ResponseStatus(HttpStatus.CREATED) 54 | public Result createDataSource() { 55 | applicationService.test(); 56 | return null; 57 | } 58 | 59 | @ApiOperation(value = "列表", notes = "QUERY_LIST_NOTES") 60 | @GetMapping(value = "/list") 61 | @ResponseStatus(HttpStatus.OK) 62 | public void list() { 63 | System.out.println("测试"); 64 | } 65 | 66 | 67 | @PostMapping(value = "/update") 68 | @ResponseStatus(HttpStatus.OK) 69 | public void update(@RequestParam(value = "id") int id, 70 | @RequestParam(value = "name") String name) { 71 | 72 | 73 | } 74 | 75 | 76 | @PostMapping(value = "/delete") 77 | @ResponseStatus(HttpStatus.OK) 78 | public void delete(@RequestParam(value = "id") int id) { 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /zhili-scheduler/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 4.0.0 6 | 7 | com.niezhili 8 | zhili-scheduler 9 | 1.0-SNAPSHOT 10 | 11 | zhili-scheduler 12 | 13 | http://www.example.com 14 | 15 | 16 | UTF-8 17 | 1.8 18 | 1.8 19 | 20 | 21 | 22 | 23 | junit 24 | junit 25 | 4.11 26 | test 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | maven-clean-plugin 36 | 3.1.0 37 | 38 | 39 | 40 | maven-resources-plugin 41 | 3.0.2 42 | 43 | 44 | maven-compiler-plugin 45 | 3.8.0 46 | 47 | 48 | maven-surefire-plugin 49 | 2.22.1 50 | 51 | 52 | maven-jar-plugin 53 | 3.0.2 54 | 55 | 56 | maven-install-plugin 57 | 2.5.2 58 | 59 | 60 | maven-deploy-plugin 61 | 2.8.2 62 | 63 | 64 | 65 | maven-site-plugin 66 | 3.7.1 67 | 68 | 69 | maven-project-info-reports-plugin 70 | 3.0.0 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-collect/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 4.0.0 6 | 7 | com.niezhili 8 | zhili-metadata-collect 9 | 1.0-SNAPSHOT 10 | 11 | zhili-metadata-collect 12 | 13 | http://www.example.com 14 | 15 | 16 | UTF-8 17 | 1.8 18 | 1.8 19 | 20 | 21 | 22 | 23 | junit 24 | junit 25 | 4.11 26 | test 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | maven-clean-plugin 36 | 3.1.0 37 | 38 | 39 | 40 | maven-resources-plugin 41 | 3.0.2 42 | 43 | 44 | maven-compiler-plugin 45 | 3.8.0 46 | 47 | 48 | maven-surefire-plugin 49 | 2.22.1 50 | 51 | 52 | maven-jar-plugin 53 | 3.0.2 54 | 55 | 56 | maven-install-plugin 57 | 2.5.2 58 | 59 | 60 | maven-deploy-plugin 61 | 2.8.2 62 | 63 | 64 | 65 | maven-site-plugin 66 | 3.7.1 67 | 68 | 69 | maven-project-info-reports-plugin 70 | 3.0.0 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-datasource/src/test/java/com/niezhili/dataplatform/metadata/DruidTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.metadata; 18 | 19 | import com.alibaba.druid.pool.DruidDataSource; 20 | import org.junit.Test; 21 | 22 | import java.sql.Connection; 23 | import java.sql.PreparedStatement; 24 | import java.sql.Statement; 25 | 26 | /** 27 | * https://www.cnblogs.com/chy18883701161/p/12594889.html 28 | * Druid动态连接池的使用 29 | * 前端页面配置数据源的时候,将下面的参数替换成页面参数,就可以实现数据源配置 30 | * @author niezhili 31 | * @date 2022-01-15 32 | */ 33 | public class DruidTest { 34 | 35 | @Test 36 | public void testDruidSource() { 37 | try { 38 | //数据源配置 39 | DruidDataSource dataSource = new DruidDataSource(); 40 | dataSource.setUrl("jdbc:mysql://127.0.0.1/db_student?serverTimezone=UTC"); 41 | dataSource.setDriverClassName("com.mysql.jdbc.Driver"); //这个可以缺省的,会根据url自动识别 42 | dataSource.setUsername("root"); 43 | dataSource.setPassword("abcd"); 44 | 45 | //下面都是可选的配置 46 | dataSource.setInitialSize(10); //初始连接数,默认0 47 | dataSource.setMaxActive(30); //最大连接数,默认8 48 | dataSource.setMinIdle(10); //最小闲置数 49 | dataSource.setMaxWait(2000); //获取连接的最大等待时间,单位毫秒 50 | dataSource.setPoolPreparedStatements(true); //缓存PreparedStatement,默认false 51 | dataSource.setMaxOpenPreparedStatements(20); //缓存PreparedStatement的最大数量,默认-1(不缓存)。大于0时会自动开启缓存PreparedStatement,所以可以省略上一句代码 52 | 53 | //获取连接 54 | Connection connection = dataSource.getConnection(); 55 | 56 | //Statement接口 57 | Statement statement = connection.createStatement(); 58 | String sql1 = "insert into tb_student (name,age) values ('chy',20)"; 59 | statement.executeUpdate(sql1); 60 | 61 | //PreparedStatement接口 62 | String sql2 = "insert into tb_student (name,age) values ('chy',21)"; 63 | PreparedStatement preparedStatement = connection.prepareStatement(sql2); 64 | preparedStatement.execute(); 65 | 66 | //关闭连接 67 | connection.close(); 68 | } catch (Exception e) { 69 | e.printStackTrace(); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /zhili-ui/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | zhili-dataplatform 7 | com.niezhili 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | com.niezhili 13 | zhili-ui 14 | 1.0-SNAPSHOT 15 | 16 | zhili-ui 17 | 18 | http://www.example.com 19 | 20 | 21 | UTF-8 22 | 1.7 23 | 1.7 24 | 25 | 26 | 27 | 28 | junit 29 | junit 30 | 4.11 31 | test 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | maven-clean-plugin 41 | 3.1.0 42 | 43 | 44 | 45 | maven-resources-plugin 46 | 3.0.2 47 | 48 | 49 | maven-compiler-plugin 50 | 3.8.0 51 | 52 | 53 | maven-surefire-plugin 54 | 2.22.1 55 | 56 | 57 | maven-jar-plugin 58 | 3.0.2 59 | 60 | 61 | maven-install-plugin 62 | 2.5.2 63 | 64 | 65 | maven-deploy-plugin 66 | 2.8.2 67 | 68 | 69 | 70 | maven-site-plugin 71 | 3.7.1 72 | 73 | 74 | maven-project-info-reports-plugin 75 | 3.0.0 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /zhili-safe/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | zhili-dataplatform 7 | com.niezhili 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | com.niezhili 13 | zhili-safe 14 | 1.0-SNAPSHOT 15 | 16 | zhili-safe 17 | 18 | http://www.example.com 19 | 20 | 21 | UTF-8 22 | 1.8 23 | 1.8 24 | 25 | 26 | 27 | 28 | junit 29 | junit 30 | 4.11 31 | test 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | maven-clean-plugin 41 | 3.1.0 42 | 43 | 44 | 45 | maven-resources-plugin 46 | 3.0.2 47 | 48 | 49 | maven-compiler-plugin 50 | 3.8.0 51 | 52 | 53 | maven-surefire-plugin 54 | 2.22.1 55 | 56 | 57 | maven-jar-plugin 58 | 3.0.2 59 | 60 | 61 | maven-install-plugin 62 | 2.5.2 63 | 64 | 65 | maven-deploy-plugin 66 | 2.8.2 67 | 68 | 69 | 70 | maven-site-plugin 71 | 3.7.1 72 | 73 | 74 | maven-project-info-reports-plugin 75 | 3.0.0 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /zhili-collect/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | zhili-dataplatform 7 | com.niezhili 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | com.niezhili 13 | zhili-collect 14 | 1.0-SNAPSHOT 15 | 16 | zhili-collect 17 | 18 | http://www.example.com 19 | 20 | 21 | UTF-8 22 | 1.8 23 | 1.8 24 | 25 | 26 | 27 | 28 | junit 29 | junit 30 | 4.11 31 | test 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | maven-clean-plugin 41 | 3.1.0 42 | 43 | 44 | 45 | maven-resources-plugin 46 | 3.0.2 47 | 48 | 49 | maven-compiler-plugin 50 | 3.8.0 51 | 52 | 53 | maven-surefire-plugin 54 | 2.22.1 55 | 56 | 57 | maven-jar-plugin 58 | 3.0.2 59 | 60 | 61 | maven-install-plugin 62 | 2.5.2 63 | 64 | 65 | maven-deploy-plugin 66 | 2.8.2 67 | 68 | 69 | 70 | maven-site-plugin 71 | 3.7.1 72 | 73 | 74 | maven-project-info-reports-plugin 75 | 3.0.0 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /zhili-auth/zhili-auth-dao/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | zhili-auth 7 | com.niezhili 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | com.niezhili 13 | zhili-auth-dao 14 | 1.0-SNAPSHOT 15 | 16 | zhili-auth-dao 17 | 18 | http://www.example.com 19 | 20 | 21 | UTF-8 22 | 1.7 23 | 1.7 24 | 25 | 26 | 27 | 28 | junit 29 | junit 30 | 4.11 31 | test 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | maven-clean-plugin 41 | 3.1.0 42 | 43 | 44 | 45 | maven-resources-plugin 46 | 3.0.2 47 | 48 | 49 | maven-compiler-plugin 50 | 3.8.0 51 | 52 | 53 | maven-surefire-plugin 54 | 2.22.1 55 | 56 | 57 | maven-jar-plugin 58 | 3.0.2 59 | 60 | 61 | maven-install-plugin 62 | 2.5.2 63 | 64 | 65 | maven-deploy-plugin 66 | 2.8.2 67 | 68 | 69 | 70 | maven-site-plugin 71 | 3.7.1 72 | 73 | 74 | maven-project-info-reports-plugin 75 | 3.0.0 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /zhili-adhoc/zhili-adhoc-dao/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | zhili-adhoc 7 | com.niezhili 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | com.niezhili 13 | zhili-adhoc-dao 14 | 1.0-SNAPSHOT 15 | 16 | zhili-adhoc-dao 17 | 18 | http://www.example.com 19 | 20 | 21 | UTF-8 22 | 1.7 23 | 1.7 24 | 25 | 26 | 27 | 28 | junit 29 | junit 30 | 4.11 31 | test 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | maven-clean-plugin 41 | 3.1.0 42 | 43 | 44 | 45 | maven-resources-plugin 46 | 3.0.2 47 | 48 | 49 | maven-compiler-plugin 50 | 3.8.0 51 | 52 | 53 | maven-surefire-plugin 54 | 2.22.1 55 | 56 | 57 | maven-jar-plugin 58 | 3.0.2 59 | 60 | 61 | maven-install-plugin 62 | 2.5.2 63 | 64 | 65 | maven-deploy-plugin 66 | 2.8.2 67 | 68 | 69 | 70 | maven-site-plugin 71 | 3.7.1 72 | 73 | 74 | maven-project-info-reports-plugin 75 | 3.0.0 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /zhili-auth/zhili-auth-admin/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | zhili-auth 7 | com.niezhili 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | com.niezhili 13 | zhili-auth-admin 14 | 1.0-SNAPSHOT 15 | 16 | zhili-auth-admin 17 | 18 | http://www.example.com 19 | 20 | 21 | UTF-8 22 | 1.7 23 | 1.7 24 | 25 | 26 | 27 | 28 | junit 29 | junit 30 | 4.11 31 | test 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | maven-clean-plugin 41 | 3.1.0 42 | 43 | 44 | 45 | maven-resources-plugin 46 | 3.0.2 47 | 48 | 49 | maven-compiler-plugin 50 | 3.8.0 51 | 52 | 53 | maven-surefire-plugin 54 | 2.22.1 55 | 56 | 57 | maven-jar-plugin 58 | 3.0.2 59 | 60 | 61 | maven-install-plugin 62 | 2.5.2 63 | 64 | 65 | maven-deploy-plugin 66 | 2.8.2 67 | 68 | 69 | 70 | maven-site-plugin 71 | 3.7.1 72 | 73 | 74 | maven-project-info-reports-plugin 75 | 3.0.0 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /zhili-adhoc/zhili-adhoc-executor/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | zhili-adhoc 7 | com.niezhili 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | com.niezhili 13 | zhili-adhoc-executor 14 | 1.0-SNAPSHOT 15 | 16 | zhili-adhoc-executor 17 | 18 | http://www.example.com 19 | 20 | 21 | UTF-8 22 | 1.7 23 | 1.7 24 | 25 | 26 | 27 | 28 | junit 29 | junit 30 | 4.11 31 | test 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | maven-clean-plugin 41 | 3.1.0 42 | 43 | 44 | 45 | maven-resources-plugin 46 | 3.0.2 47 | 48 | 49 | maven-compiler-plugin 50 | 3.8.0 51 | 52 | 53 | maven-surefire-plugin 54 | 2.22.1 55 | 56 | 57 | maven-jar-plugin 58 | 3.0.2 59 | 60 | 61 | maven-install-plugin 62 | 2.5.2 63 | 64 | 65 | maven-deploy-plugin 66 | 2.8.2 67 | 68 | 69 | 70 | maven-site-plugin 71 | 3.7.1 72 | 73 | 74 | maven-project-info-reports-plugin 75 | 3.0.0 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-sdk/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | zhili-dataservice 7 | com.niezhili 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | com.niezhili 13 | zhili-dataservice-sdk 14 | 1.0-SNAPSHOT 15 | 16 | zhili-dataservice-sdk 17 | 18 | http://www.example.com 19 | 20 | 21 | UTF-8 22 | 1.8 23 | 1.8 24 | 25 | 26 | 27 | 28 | junit 29 | junit 30 | 4.11 31 | test 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | maven-clean-plugin 41 | 3.1.0 42 | 43 | 44 | 45 | maven-resources-plugin 46 | 3.0.2 47 | 48 | 49 | maven-compiler-plugin 50 | 3.8.0 51 | 52 | 53 | maven-surefire-plugin 54 | 2.22.1 55 | 56 | 57 | maven-jar-plugin 58 | 3.0.2 59 | 60 | 61 | maven-install-plugin 62 | 2.5.2 63 | 64 | 65 | maven-deploy-plugin 66 | 2.8.2 67 | 68 | 69 | 70 | maven-site-plugin 71 | 3.7.1 72 | 73 | 74 | maven-project-info-reports-plugin 75 | 3.0.0 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-datasource/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 4.0.0 6 | 7 | org.example 8 | zhili-metadata-datasource 9 | 1.0-SNAPSHOT 10 | 11 | zhili-metadata-datasource 12 | 13 | http://www.example.com 14 | 15 | 16 | UTF-8 17 | 1.8 18 | 1.8 19 | 20 | 21 | 22 | 23 | junit 24 | junit 25 | 4.11 26 | test 27 | 28 | 29 | 30 | com.niezhili 31 | zhili-metadata-dao 32 | 1.0-SNAPSHOT 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | maven-clean-plugin 42 | 3.1.0 43 | 44 | 45 | 46 | maven-resources-plugin 47 | 3.0.2 48 | 49 | 50 | maven-compiler-plugin 51 | 3.8.0 52 | 53 | 54 | maven-surefire-plugin 55 | 2.22.1 56 | 57 | 58 | maven-jar-plugin 59 | 3.0.2 60 | 61 | 62 | maven-install-plugin 63 | 2.5.2 64 | 65 | 66 | maven-deploy-plugin 67 | 2.8.2 68 | 69 | 70 | 71 | maven-site-plugin 72 | 3.7.1 73 | 74 | 75 | maven-project-info-reports-plugin 76 | 3.0.0 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /zhili-auth/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | zhili-dataplatform 7 | com.niezhili 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | com.niezhili 13 | zhili-auth 14 | pom 15 | 1.0-SNAPSHOT 16 | 17 | zhili-auth-dao 18 | zhili-auth-admin 19 | 20 | 21 | zhili-auth 22 | 23 | http://www.example.com 24 | 25 | 26 | UTF-8 27 | 1.8 28 | 1.8 29 | 30 | 31 | 32 | 33 | junit 34 | junit 35 | 4.11 36 | test 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | maven-clean-plugin 46 | 3.1.0 47 | 48 | 49 | 50 | maven-resources-plugin 51 | 3.0.2 52 | 53 | 54 | maven-compiler-plugin 55 | 3.8.0 56 | 57 | 58 | maven-surefire-plugin 59 | 2.22.1 60 | 61 | 62 | maven-jar-plugin 63 | 3.0.2 64 | 65 | 66 | maven-install-plugin 67 | 2.5.2 68 | 69 | 70 | maven-deploy-plugin 71 | 2.8.2 72 | 73 | 74 | 75 | maven-site-plugin 76 | 3.7.1 77 | 78 | 79 | maven-project-info-reports-plugin 80 | 3.0.0 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /zhili-adhoc/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | zhili-dataplatform 7 | com.niezhili 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | com.niezhili 13 | zhili-adhoc 14 | pom 15 | 1.0-SNAPSHOT 16 | 17 | zhili-adhoc-dao 18 | zhili-adhoc-executor 19 | 20 | 21 | zhili-adhoc 22 | 23 | http://www.example.com 24 | 25 | 26 | UTF-8 27 | 1.8 28 | 1.8 29 | 30 | 31 | 32 | 33 | junit 34 | junit 35 | 4.11 36 | test 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | maven-clean-plugin 46 | 3.1.0 47 | 48 | 49 | 50 | maven-resources-plugin 51 | 3.0.2 52 | 53 | 54 | maven-compiler-plugin 55 | 3.8.0 56 | 57 | 58 | maven-surefire-plugin 59 | 2.22.1 60 | 61 | 62 | maven-jar-plugin 63 | 3.0.2 64 | 65 | 66 | maven-install-plugin 67 | 2.5.2 68 | 69 | 70 | maven-deploy-plugin 71 | 2.8.2 72 | 73 | 74 | 75 | maven-site-plugin 76 | 3.7.1 77 | 78 | 79 | maven-project-info-reports-plugin 80 | 3.0.0 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /zhili-report/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | zhili-dataplatform 7 | com.niezhili 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | com.niezhili 13 | zhili-report 14 | pom 15 | 1.0-SNAPSHOT 16 | 17 | zhili-report-admin 18 | zhili-report-dao 19 | 20 | 21 | zhili-report 22 | 23 | http://www.example.com 24 | 25 | 26 | UTF-8 27 | 1.8 28 | 1.8 29 | 30 | 31 | 32 | 33 | junit 34 | junit 35 | 4.11 36 | test 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | maven-clean-plugin 46 | 3.1.0 47 | 48 | 49 | 50 | maven-resources-plugin 51 | 3.0.2 52 | 53 | 54 | maven-compiler-plugin 55 | 3.8.0 56 | 57 | 58 | maven-surefire-plugin 59 | 2.22.1 60 | 61 | 62 | maven-jar-plugin 63 | 3.0.2 64 | 65 | 66 | maven-install-plugin 67 | 2.5.2 68 | 69 | 70 | maven-deploy-plugin 71 | 2.8.2 72 | 73 | 74 | 75 | maven-site-plugin 76 | 3.7.1 77 | 78 | 79 | maven-project-info-reports-plugin 80 | 3.0.0 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-dao/src/main/java/com/niezhili/dataplatform/metadata/dao/mapper/DataSourceMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.metadata.dao.mapper; 18 | 19 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; 20 | import com.baomidou.mybatisplus.core.metadata.IPage; 21 | 22 | import com.niezhili.dataplatform.metadata.dao.entity.DataSource; 23 | import org.apache.ibatis.annotations.Param; 24 | 25 | import java.util.List; 26 | 27 | /** 28 | * datasource mapper interface 29 | */ 30 | public interface DataSourceMapper extends BaseMapper { 31 | 32 | /** 33 | * query datasource by type 34 | * @param userId userId 35 | * @param type type 36 | * @return datasource list 37 | */ 38 | List queryDataSourceByType(@Param("userId") int userId, @Param("type") Integer type); 39 | 40 | /** 41 | * datasource page 42 | * @param page page 43 | * @param userId userId 44 | * @param name name 45 | * @return datasource IPage 46 | */ 47 | IPage selectPaging(IPage page, 48 | @Param("userId") int userId, 49 | @Param("name") String name); 50 | 51 | /** 52 | * query datasource by name 53 | * @param name name 54 | * @return datasource list 55 | */ 56 | List queryDataSourceByName(@Param("name") String name); 57 | 58 | 59 | /** 60 | * query authed datasource 61 | * @param userId userId 62 | * @return datasource list 63 | */ 64 | List queryAuthedDatasource(@Param("userId") int userId); 65 | 66 | /** 67 | * query datasource except userId 68 | * @param userId userId 69 | * @return datasource list 70 | */ 71 | List queryDatasourceExceptUserId(@Param("userId") int userId); 72 | 73 | /** 74 | * list all datasource by type 75 | * @param type datasource type 76 | * @return datasource list 77 | */ 78 | List listAllDataSourceByType(@Param("type") Integer type); 79 | 80 | 81 | /** 82 | * list authorized UDF function 83 | * 84 | * @param userId userId 85 | * @param dataSourceIds data source id array 86 | * @param T 87 | * @return UDF function list 88 | */ 89 | List listAuthorizedDataSource(@Param("userId") int userId, @Param("dataSourceIds") T[] dataSourceIds); 90 | 91 | 92 | } 93 | -------------------------------------------------------------------------------- /zhili-metadata/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | zhili-dataplatform 7 | com.niezhili 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | com.niezhili 13 | zhili-metadata 14 | pom 15 | 1.0-SNAPSHOT 16 | 17 | zhili-metadata-datasource 18 | zhili-metadata-collect 19 | zhili-metadata-admin 20 | zhili-metadata-dao 21 | 22 | 23 | zhili-metadata 24 | 25 | http://www.example.com 26 | 27 | 28 | UTF-8 29 | 1.8 30 | 1.8 31 | 32 | 33 | 34 | 35 | junit 36 | junit 37 | 4.11 38 | test 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | maven-clean-plugin 48 | 3.1.0 49 | 50 | 51 | 52 | maven-resources-plugin 53 | 3.0.2 54 | 55 | 56 | maven-compiler-plugin 57 | 3.8.0 58 | 59 | 60 | maven-surefire-plugin 61 | 2.22.1 62 | 63 | 64 | maven-jar-plugin 65 | 3.0.2 66 | 67 | 68 | maven-install-plugin 69 | 2.5.2 70 | 71 | 72 | maven-deploy-plugin 73 | 2.8.2 74 | 75 | 76 | 77 | maven-site-plugin 78 | 3.7.1 79 | 80 | 81 | maven-project-info-reports-plugin 82 | 3.0.0 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /zhili-dataservice/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | zhili-dataplatform 7 | com.niezhili 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | com.niezhili 13 | zhili-dataservice 14 | pom 15 | 1.0-SNAPSHOT 16 | 17 | zhili-dataservice-sdk 18 | zhili-dataservice-api 19 | zhili-dataservice-admin 20 | zhili-dataservice-dao 21 | 22 | 23 | zhili-dataservice 24 | 25 | http://www.example.com 26 | 27 | 28 | UTF-8 29 | 1.8 30 | 1.8 31 | 32 | 33 | 34 | 35 | junit 36 | junit 37 | 4.11 38 | test 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | maven-clean-plugin 48 | 3.1.0 49 | 50 | 51 | 52 | maven-resources-plugin 53 | 3.0.2 54 | 55 | 56 | maven-compiler-plugin 57 | 3.8.0 58 | 59 | 60 | maven-surefire-plugin 61 | 2.22.1 62 | 63 | 64 | maven-jar-plugin 65 | 3.0.2 66 | 67 | 68 | maven-install-plugin 69 | 2.5.2 70 | 71 | 72 | maven-deploy-plugin 73 | 2.8.2 74 | 75 | 76 | 77 | maven-site-plugin 78 | 3.7.1 79 | 80 | 81 | maven-project-info-reports-plugin 82 | 3.0.0 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /zhili-common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | zhili-dataplatform 7 | com.niezhili 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | com.niezhili 13 | zhili-common 14 | 1.0-SNAPSHOT 15 | 16 | zhili-common 17 | 18 | http://www.example.com 19 | 20 | 21 | UTF-8 22 | 1.8 23 | 1.8 24 | 25 | 26 | 27 | 28 | org.slf4j 29 | slf4j-api 30 | 31 | 32 | 33 | junit 34 | junit 35 | 4.11 36 | test 37 | 38 | 39 | 40 | io.jsonwebtoken 41 | jjwt 42 | 0.9.1 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | maven-clean-plugin 52 | 3.1.0 53 | 54 | 55 | 56 | maven-resources-plugin 57 | 3.0.2 58 | 59 | 60 | maven-compiler-plugin 61 | 3.8.0 62 | 63 | 64 | maven-surefire-plugin 65 | 2.22.1 66 | 67 | 68 | maven-jar-plugin 69 | 3.0.2 70 | 71 | 72 | maven-install-plugin 73 | 2.5.2 74 | 75 | 76 | maven-deploy-plugin 77 | 2.8.2 78 | 79 | 80 | 81 | maven-site-plugin 82 | 3.7.1 83 | 84 | 85 | maven-project-info-reports-plugin 86 | 3.0.0 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-dao/src/main/resources/datasource.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # postgresql 19 | #spring.datasource.driver-class-name=org.postgresql.Driver 20 | #spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/dolphinscheduler 21 | #spring.datasource.username=test 22 | #spring.datasource.password=test 23 | 24 | # mysql 25 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 26 | spring.datasource.url=jdbc:mysql://127.0.0.1:3306/dolphinscheduler?useUnicode=true&characterEncoding=UTF-8 27 | spring.datasource.username=root 28 | spring.datasource.password=root 29 | 30 | # connection configuration 31 | #spring.datasource.initialSize=5 32 | # min connection number 33 | #spring.datasource.minIdle=5 34 | # max connection number 35 | #spring.datasource.maxActive=50 36 | 37 | # max wait time for get a connection in milliseconds. if configuring maxWait, fair locks are enabled by default and concurrency efficiency decreases. 38 | # If necessary, unfair locks can be used by configuring the useUnfairLock attribute to true. 39 | #spring.datasource.maxWait=60000 40 | 41 | # milliseconds for check to close free connections 42 | #spring.datasource.timeBetweenEvictionRunsMillis=60000 43 | 44 | # the Destroy thread detects the connection interval and closes the physical connection in milliseconds if the connection idle time is greater than or equal to minEvictableIdleTimeMillis. 45 | #spring.datasource.timeBetweenConnectErrorMillis=60000 46 | 47 | # the longest time a connection remains idle without being evicted, in milliseconds 48 | #spring.datasource.minEvictableIdleTimeMillis=300000 49 | 50 | #the SQL used to check whether the connection is valid requires a query statement. If validation Query is null, testOnBorrow, testOnReturn, and testWhileIdle will not work. 51 | #spring.datasource.validationQuery=SELECT 1 52 | 53 | #check whether the connection is valid for timeout, in seconds 54 | #spring.datasource.validationQueryTimeout=3 55 | 56 | # when applying for a connection, if it is detected that the connection is idle longer than time Between Eviction Runs Millis, 57 | # validation Query is performed to check whether the connection is valid 58 | #spring.datasource.testWhileIdle=true 59 | 60 | #execute validation to check if the connection is valid when applying for a connection 61 | #spring.datasource.testOnBorrow=true 62 | #execute validation to check if the connection is valid when the connection is returned 63 | #spring.datasource.testOnReturn=false 64 | #spring.datasource.defaultAutoCommit=true 65 | #spring.datasource.keepAlive=true 66 | 67 | # open PSCache, specify count PSCache for every connection 68 | #spring.datasource.poolPreparedStatements=true 69 | #spring.datasource.maxPoolPreparedStatementPerConnectionSize=20 -------------------------------------------------------------------------------- /zhili-report/zhili-report-dao/src/main/resources/datasource.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # postgresql 19 | #spring.datasource.driver-class-name=org.postgresql.Driver 20 | #spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/dolphinscheduler 21 | #spring.datasource.username=test 22 | #spring.datasource.password=test 23 | 24 | # mysql 25 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 26 | spring.datasource.url=jdbc:mysql://127.0.0.1:3306/dolphinscheduler?useUnicode=true&characterEncoding=UTF-8 27 | spring.datasource.username=root 28 | spring.datasource.password=root 29 | 30 | # connection configuration 31 | #spring.datasource.initialSize=5 32 | # min connection number 33 | #spring.datasource.minIdle=5 34 | # max connection number 35 | #spring.datasource.maxActive=50 36 | 37 | # max wait time for get a connection in milliseconds. if configuring maxWait, fair locks are enabled by default and concurrency efficiency decreases. 38 | # If necessary, unfair locks can be used by configuring the useUnfairLock attribute to true. 39 | #spring.datasource.maxWait=60000 40 | 41 | # milliseconds for check to close free connections 42 | #spring.datasource.timeBetweenEvictionRunsMillis=60000 43 | 44 | # the Destroy thread detects the connection interval and closes the physical connection in milliseconds if the connection idle time is greater than or equal to minEvictableIdleTimeMillis. 45 | #spring.datasource.timeBetweenConnectErrorMillis=60000 46 | 47 | # the longest time a connection remains idle without being evicted, in milliseconds 48 | #spring.datasource.minEvictableIdleTimeMillis=300000 49 | 50 | #the SQL used to check whether the connection is valid requires a query statement. If validation Query is null, testOnBorrow, testOnReturn, and testWhileIdle will not work. 51 | #spring.datasource.validationQuery=SELECT 1 52 | 53 | #check whether the connection is valid for timeout, in seconds 54 | #spring.datasource.validationQueryTimeout=3 55 | 56 | # when applying for a connection, if it is detected that the connection is idle longer than time Between Eviction Runs Millis, 57 | # validation Query is performed to check whether the connection is valid 58 | #spring.datasource.testWhileIdle=true 59 | 60 | #execute validation to check if the connection is valid when applying for a connection 61 | #spring.datasource.testOnBorrow=true 62 | #execute validation to check if the connection is valid when the connection is returned 63 | #spring.datasource.testOnReturn=false 64 | #spring.datasource.defaultAutoCommit=true 65 | #spring.datasource.keepAlive=true 66 | 67 | # open PSCache, specify count PSCache for every connection 68 | #spring.datasource.poolPreparedStatements=true 69 | #spring.datasource.maxPoolPreparedStatementPerConnectionSize=20 -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-dao/src/main/resources/datasource.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # postgresql 19 | #spring.datasource.driver-class-name=org.postgresql.Driver 20 | #spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/dolphinscheduler 21 | #spring.datasource.username=test 22 | #spring.datasource.password=test 23 | 24 | # mysql 25 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 26 | spring.datasource.url=jdbc:mysql://127.0.0.1:3306/dolphinscheduler?useUnicode=true&characterEncoding=UTF-8 27 | spring.datasource.username=root 28 | spring.datasource.password=root 29 | 30 | # connection configuration 31 | #spring.datasource.initialSize=5 32 | # min connection number 33 | #spring.datasource.minIdle=5 34 | # max connection number 35 | #spring.datasource.maxActive=50 36 | 37 | # max wait time for get a connection in milliseconds. if configuring maxWait, fair locks are enabled by default and concurrency efficiency decreases. 38 | # If necessary, unfair locks can be used by configuring the useUnfairLock attribute to true. 39 | #spring.datasource.maxWait=60000 40 | 41 | # milliseconds for check to close free connections 42 | #spring.datasource.timeBetweenEvictionRunsMillis=60000 43 | 44 | # the Destroy thread detects the connection interval and closes the physical connection in milliseconds if the connection idle time is greater than or equal to minEvictableIdleTimeMillis. 45 | #spring.datasource.timeBetweenConnectErrorMillis=60000 46 | 47 | # the longest time a connection remains idle without being evicted, in milliseconds 48 | #spring.datasource.minEvictableIdleTimeMillis=300000 49 | 50 | #the SQL used to check whether the connection is valid requires a query statement. If validation Query is null, testOnBorrow, testOnReturn, and testWhileIdle will not work. 51 | #spring.datasource.validationQuery=SELECT 1 52 | 53 | #check whether the connection is valid for timeout, in seconds 54 | #spring.datasource.validationQueryTimeout=3 55 | 56 | # when applying for a connection, if it is detected that the connection is idle longer than time Between Eviction Runs Millis, 57 | # validation Query is performed to check whether the connection is valid 58 | #spring.datasource.testWhileIdle=true 59 | 60 | #execute validation to check if the connection is valid when applying for a connection 61 | #spring.datasource.testOnBorrow=true 62 | #execute validation to check if the connection is valid when the connection is returned 63 | #spring.datasource.testOnReturn=false 64 | #spring.datasource.defaultAutoCommit=true 65 | #spring.datasource.keepAlive=true 66 | 67 | # open PSCache, specify count PSCache for every connection 68 | #spring.datasource.poolPreparedStatements=true 69 | #spring.datasource.maxPoolPreparedStatementPerConnectionSize=20 -------------------------------------------------------------------------------- /zhili-monitor/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | zhili-dataplatform 7 | com.niezhili 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | zhili-monitor 13 | pom 14 | 15 | zhili-monitor 16 | 17 | http://www.example.com 18 | 19 | zhili-monitor-admin 20 | 21 | 22 | 23 | UTF-8 24 | 1.8 25 | 1.8 26 | 27 | 28 | 29 | 30 | junit 31 | junit 32 | 4.11 33 | test 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | maven-clean-plugin 43 | 3.1.0 44 | 45 | 46 | 47 | maven-resources-plugin 48 | 3.0.2 49 | 50 | 51 | maven-compiler-plugin 52 | 3.8.0 53 | 54 | 55 | maven-surefire-plugin 56 | 2.22.1 57 | 58 | 59 | maven-jar-plugin 60 | 3.0.2 61 | 62 | 63 | maven-install-plugin 64 | 2.5.2 65 | 66 | 67 | maven-deploy-plugin 68 | 2.8.2 69 | 70 | 71 | 72 | maven-site-plugin 73 | 3.7.1 74 | 75 | 76 | maven-project-info-reports-plugin 77 | 3.0.0 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /zhili-monitor/zhili-monitor-admin/src/main/java/com/niezhili/dataplatform/monitor/admin/utils/Result.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.monitor.admin.utils; 18 | 19 | 20 | import com.niezhili.dataplatform.monitor.admin.enums.Status; 21 | 22 | import java.text.MessageFormat; 23 | 24 | /** 25 | * result 26 | * 27 | * @param T 28 | */ 29 | public class Result { 30 | /** 31 | * status 32 | */ 33 | private Integer code; 34 | 35 | /** 36 | * message 37 | */ 38 | private String msg; 39 | 40 | /** 41 | * data 42 | */ 43 | private T data; 44 | 45 | public Result() { 46 | } 47 | 48 | public Result(Integer code, String msg) { 49 | this.code = code; 50 | this.msg = msg; 51 | } 52 | 53 | private Result(T data) { 54 | this.code = 0; 55 | this.data = data; 56 | } 57 | 58 | private Result(Status status) { 59 | if (status != null) { 60 | this.code = status.getCode(); 61 | this.msg = status.getMsg(); 62 | } 63 | } 64 | 65 | /** 66 | * Call this function if there is success 67 | * 68 | * @param data data 69 | * @param type 70 | * @return resule 71 | */ 72 | public static Result success(T data) { 73 | return new Result<>(data); 74 | } 75 | 76 | /** 77 | * Call this function if there is any error 78 | * 79 | * @param status status 80 | * @return result 81 | */ 82 | public static Result error(Status status) { 83 | return new Result(status); 84 | } 85 | 86 | /** 87 | * Call this function if there is any error 88 | * 89 | * @param status status 90 | * @param args args 91 | * @return result 92 | */ 93 | public static Result errorWithArgs(Status status, Object... args) { 94 | return new Result(status.getCode(), MessageFormat.format(status.getMsg(), args)); 95 | } 96 | 97 | public Integer getCode() { 98 | return code; 99 | } 100 | 101 | public void setCode(Integer code) { 102 | this.code = code; 103 | } 104 | 105 | public String getMsg() { 106 | return msg; 107 | } 108 | 109 | public void setMsg(String msg) { 110 | this.msg = msg; 111 | } 112 | 113 | public T getData() { 114 | return data; 115 | } 116 | 117 | public void setData(T data) { 118 | this.data = data; 119 | } 120 | 121 | 122 | @Override 123 | public String toString() { 124 | return "Status{" + 125 | "code='" + code + '\'' + 126 | ", msg='" + msg + '\'' + 127 | ", data=" + data + 128 | '}'; 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /zhili-report/zhili-report-admin/src/main/java/com/niezhili/dataplatform/monitor/admin/utils/Result.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.monitor.admin.utils; 18 | 19 | 20 | import com.niezhili.dataplatform.monitor.admin.enums.Status; 21 | 22 | import java.text.MessageFormat; 23 | 24 | /** 25 | * result 26 | * 27 | * @param T 28 | */ 29 | public class Result { 30 | /** 31 | * status 32 | */ 33 | private Integer code; 34 | 35 | /** 36 | * message 37 | */ 38 | private String msg; 39 | 40 | /** 41 | * data 42 | */ 43 | private T data; 44 | 45 | public Result() { 46 | } 47 | 48 | public Result(Integer code, String msg) { 49 | this.code = code; 50 | this.msg = msg; 51 | } 52 | 53 | private Result(T data) { 54 | this.code = 0; 55 | this.data = data; 56 | } 57 | 58 | private Result(Status status) { 59 | if (status != null) { 60 | this.code = status.getCode(); 61 | this.msg = status.getMsg(); 62 | } 63 | } 64 | 65 | /** 66 | * Call this function if there is success 67 | * 68 | * @param data data 69 | * @param type 70 | * @return resule 71 | */ 72 | public static Result success(T data) { 73 | return new Result<>(data); 74 | } 75 | 76 | /** 77 | * Call this function if there is any error 78 | * 79 | * @param status status 80 | * @return result 81 | */ 82 | public static Result error(Status status) { 83 | return new Result(status); 84 | } 85 | 86 | /** 87 | * Call this function if there is any error 88 | * 89 | * @param status status 90 | * @param args args 91 | * @return result 92 | */ 93 | public static Result errorWithArgs(Status status, Object... args) { 94 | return new Result(status.getCode(), MessageFormat.format(status.getMsg(), args)); 95 | } 96 | 97 | public Integer getCode() { 98 | return code; 99 | } 100 | 101 | public void setCode(Integer code) { 102 | this.code = code; 103 | } 104 | 105 | public String getMsg() { 106 | return msg; 107 | } 108 | 109 | public void setMsg(String msg) { 110 | this.msg = msg; 111 | } 112 | 113 | public T getData() { 114 | return data; 115 | } 116 | 117 | public void setData(T data) { 118 | this.data = data; 119 | } 120 | 121 | 122 | @Override 123 | public String toString() { 124 | return "Status{" + 125 | "code='" + code + '\'' + 126 | ", msg='" + msg + '\'' + 127 | ", data=" + data + 128 | '}'; 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-admin/src/main/java/com/niezhili/dataplatform/metadata/admin/utils/Result.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.metadata.admin.utils; 18 | 19 | 20 | import com.niezhili.dataplatform.metadata.admin.enums.Status; 21 | 22 | import java.text.MessageFormat; 23 | 24 | /** 25 | * result 26 | * 27 | * @param T 28 | */ 29 | public class Result { 30 | /** 31 | * status 32 | */ 33 | private Integer code; 34 | 35 | /** 36 | * message 37 | */ 38 | private String msg; 39 | 40 | /** 41 | * data 42 | */ 43 | private T data; 44 | 45 | public Result() { 46 | } 47 | 48 | public Result(Integer code, String msg) { 49 | this.code = code; 50 | this.msg = msg; 51 | } 52 | 53 | private Result(T data) { 54 | this.code = 0; 55 | this.data = data; 56 | } 57 | 58 | private Result(Status status) { 59 | if (status != null) { 60 | this.code = status.getCode(); 61 | this.msg = status.getMsg(); 62 | } 63 | } 64 | 65 | /** 66 | * Call this function if there is success 67 | * 68 | * @param data data 69 | * @param type 70 | * @return resule 71 | */ 72 | public static Result success(T data) { 73 | return new Result<>(data); 74 | } 75 | 76 | /** 77 | * Call this function if there is any error 78 | * 79 | * @param status status 80 | * @return result 81 | */ 82 | public static Result error(Status status) { 83 | return new Result(status); 84 | } 85 | 86 | /** 87 | * Call this function if there is any error 88 | * 89 | * @param status status 90 | * @param args args 91 | * @return result 92 | */ 93 | public static Result errorWithArgs(Status status, Object... args) { 94 | return new Result(status.getCode(), MessageFormat.format(status.getMsg(), args)); 95 | } 96 | 97 | public Integer getCode() { 98 | return code; 99 | } 100 | 101 | public void setCode(Integer code) { 102 | this.code = code; 103 | } 104 | 105 | public String getMsg() { 106 | return msg; 107 | } 108 | 109 | public void setMsg(String msg) { 110 | this.msg = msg; 111 | } 112 | 113 | public T getData() { 114 | return data; 115 | } 116 | 117 | public void setData(T data) { 118 | this.data = data; 119 | } 120 | 121 | 122 | @Override 123 | public String toString() { 124 | return "Status{" + 125 | "code='" + code + '\'' + 126 | ", msg='" + msg + '\'' + 127 | ", data=" + data + 128 | '}'; 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-admin/src/main/java/com/niezhili/dataplatform/dataservice/admin/utils/Result.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.dataservice.admin.utils; 18 | 19 | 20 | import com.niezhili.dataplatform.dataservice.admin.enums.Status; 21 | 22 | import java.text.MessageFormat; 23 | 24 | /** 25 | * result 26 | * 27 | * @param T 28 | */ 29 | public class Result { 30 | /** 31 | * status 32 | */ 33 | private Integer code; 34 | 35 | /** 36 | * message 37 | */ 38 | private String msg; 39 | 40 | /** 41 | * data 42 | */ 43 | private T data; 44 | 45 | public Result() { 46 | } 47 | 48 | public Result(Integer code, String msg) { 49 | this.code = code; 50 | this.msg = msg; 51 | } 52 | 53 | private Result(T data) { 54 | this.code = 0; 55 | this.data = data; 56 | } 57 | 58 | private Result(Status status) { 59 | if (status != null) { 60 | this.code = status.getCode(); 61 | this.msg = status.getMsg(); 62 | } 63 | } 64 | 65 | /** 66 | * Call this function if there is success 67 | * 68 | * @param data data 69 | * @param type 70 | * @return resule 71 | */ 72 | public static Result success(T data) { 73 | return new Result<>(data); 74 | } 75 | 76 | /** 77 | * Call this function if there is any error 78 | * 79 | * @param status status 80 | * @return result 81 | */ 82 | public static Result error(Status status) { 83 | return new Result(status); 84 | } 85 | 86 | /** 87 | * Call this function if there is any error 88 | * 89 | * @param status status 90 | * @param args args 91 | * @return result 92 | */ 93 | public static Result errorWithArgs(Status status, Object... args) { 94 | return new Result(status.getCode(), MessageFormat.format(status.getMsg(), args)); 95 | } 96 | 97 | public Integer getCode() { 98 | return code; 99 | } 100 | 101 | public void setCode(Integer code) { 102 | this.code = code; 103 | } 104 | 105 | public String getMsg() { 106 | return msg; 107 | } 108 | 109 | public void setMsg(String msg) { 110 | this.msg = msg; 111 | } 112 | 113 | public T getData() { 114 | return data; 115 | } 116 | 117 | public void setData(T data) { 118 | this.data = data; 119 | } 120 | 121 | 122 | @Override 123 | public String toString() { 124 | return "Status{" + 125 | "code='" + code + '\'' + 126 | ", msg='" + msg + '\'' + 127 | ", data=" + data + 128 | '}'; 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-admin/src/main/java/com/niezhili/dataplatform/dataservice/admin/controller/ApplicationController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.dataservice.admin.controller; 19 | 20 | import com.niezhili.dataplatform.dataservice.admin.aspect.AccessLogAnnotation; 21 | import com.niezhili.dataplatform.dataservice.admin.exceptions.ApiException; 22 | import com.niezhili.dataplatform.dataservice.admin.service.ApplicationService; 23 | import com.niezhili.dataplatform.dataservice.admin.utils.Result; 24 | import io.swagger.annotations.Api; 25 | import io.swagger.annotations.ApiOperation; 26 | import org.slf4j.Logger; 27 | import org.slf4j.LoggerFactory; 28 | import org.springframework.beans.factory.annotation.Autowired; 29 | import org.springframework.beans.factory.annotation.Value; 30 | import org.springframework.cloud.context.config.annotation.RefreshScope; 31 | import org.springframework.http.HttpStatus; 32 | import org.springframework.web.bind.annotation.*; 33 | 34 | import static com.niezhili.dataplatform.dataservice.admin.enums.Status.CREATE_DATASOURCE_ERROR; 35 | 36 | 37 | /** 38 | * @author niezhili 39 | * @date 2021-05-29 40 | * 应用管理controller 41 | */ 42 | @Api(tags = "应用管理") 43 | @RestController 44 | @RequestMapping("application") 45 | @RefreshScope 46 | public class ApplicationController extends BaseController { 47 | 48 | private static final Logger logger = LoggerFactory.getLogger(ApplicationController.class); 49 | 50 | @Autowired 51 | private ApplicationService applicationService; 52 | 53 | @Value("${user.name}") 54 | private String userName; 55 | 56 | @Value("${user.age}") 57 | private int age; 58 | 59 | @GetMapping("/getConfigValue") 60 | public String getConfigValue() { 61 | return userName + age; 62 | } 63 | 64 | /** 65 | * create data source 66 | * 67 | * @return create result code 68 | */ 69 | @ApiOperation(value = "create", notes = "CREATE_NOTES") 70 | @PostMapping(value = "/create") 71 | @ResponseStatus(HttpStatus.CREATED) 72 | @ApiException(CREATE_DATASOURCE_ERROR) 73 | @AccessLogAnnotation(ignoreRequestArgs = "loginUser") 74 | public Result createDataSource() { 75 | applicationService.test(); 76 | return null; 77 | } 78 | 79 | @ApiOperation(value = "列表", notes = "QUERY_LIST_NOTES") 80 | @GetMapping(value = "/list") 81 | @ResponseStatus(HttpStatus.OK) 82 | public void list() { 83 | System.out.println("测试"); 84 | } 85 | 86 | 87 | @PostMapping(value = "/update") 88 | @ResponseStatus(HttpStatus.OK) 89 | public void update(@RequestParam(value = "id") int id, 90 | @RequestParam(value = "name") String name) { 91 | 92 | 93 | } 94 | 95 | 96 | @PostMapping(value = "/delete") 97 | @ResponseStatus(HttpStatus.OK) 98 | public void delete(@RequestParam(value = "id") int id) { 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /zhili-common/src/main/java/com/niezhili/dataplatform/common/constants/Constants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.niezhili.dataplatform.common.constants; 19 | 20 | 21 | /** 22 | * Constants 23 | */ 24 | public final class Constants { 25 | 26 | private Constants() { 27 | throw new UnsupportedOperationException("Construct Constants"); 28 | } 29 | 30 | /** 31 | * common properties path 32 | */ 33 | public static final String COMMON_PROPERTIES_PATH = "/common.properties"; 34 | 35 | /** 36 | * datasource configuration path 37 | */ 38 | public static final String DATASOURCE_PROPERTIES = "/datasource.properties"; 39 | 40 | /** 41 | * data source config 42 | */ 43 | 44 | public static final String SPRING_DATASOURCE_DRIVER_CLASS_NAME = "spring.datasource.driver-class-name"; 45 | 46 | public static final String SPRING_DATASOURCE_URL = "spring.datasource.url"; 47 | 48 | public static final String SPRING_DATASOURCE_USERNAME = "spring.datasource.username"; 49 | 50 | public static final String SPRING_DATASOURCE_PASSWORD = "spring.datasource.password"; 51 | 52 | public static final String SPRING_DATASOURCE_VALIDATION_QUERY_TIMEOUT = "spring.datasource.validationQueryTimeout"; 53 | 54 | public static final String SPRING_DATASOURCE_INITIAL_SIZE = "spring.datasource.initialSize"; 55 | 56 | public static final String SPRING_DATASOURCE_MIN_IDLE = "spring.datasource.minIdle"; 57 | 58 | public static final String SPRING_DATASOURCE_MAX_ACTIVE = "spring.datasource.maxActive"; 59 | 60 | public static final String SPRING_DATASOURCE_MAX_WAIT = "spring.datasource.maxWait"; 61 | 62 | public static final String SPRING_DATASOURCE_TIME_BETWEEN_EVICTION_RUNS_MILLIS = "spring.datasource.timeBetweenEvictionRunsMillis"; 63 | 64 | public static final String SPRING_DATASOURCE_TIME_BETWEEN_CONNECT_ERROR_MILLIS = "spring.datasource.timeBetweenConnectErrorMillis"; 65 | 66 | public static final String SPRING_DATASOURCE_MIN_EVICTABLE_IDLE_TIME_MILLIS = "spring.datasource.minEvictableIdleTimeMillis"; 67 | 68 | public static final String SPRING_DATASOURCE_VALIDATION_QUERY = "spring.datasource.validationQuery"; 69 | 70 | public static final String SPRING_DATASOURCE_TEST_WHILE_IDLE = "spring.datasource.testWhileIdle"; 71 | 72 | public static final String SPRING_DATASOURCE_TEST_ON_BORROW = "spring.datasource.testOnBorrow"; 73 | 74 | public static final String SPRING_DATASOURCE_TEST_ON_RETURN = "spring.datasource.testOnReturn"; 75 | 76 | public static final String SPRING_DATASOURCE_POOL_PREPARED_STATEMENTS = "spring.datasource.poolPreparedStatements"; 77 | 78 | public static final String SPRING_DATASOURCE_DEFAULT_AUTO_COMMIT = "spring.datasource.defaultAutoCommit"; 79 | 80 | public static final String SPRING_DATASOURCE_KEEP_ALIVE = "spring.datasource.keepAlive"; 81 | 82 | public static final String SPRING_DATASOURCE_MAX_POOL_PREPARED_STATEMENT_PER_CONNECTION_SIZE = "spring.datasource.maxPoolPreparedStatementPerConnectionSize"; 83 | 84 | 85 | } 86 | -------------------------------------------------------------------------------- /zhili-common/src/main/resources/common.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | # resource storage type : HDFS, S3, NONE 19 | resource.storage.type=NONE 20 | 21 | # resource store on HDFS/S3 path, resource file will store to this hadoop hdfs path, self configuration, please make sure the directory exists on hdfs and have read write permissions。"/dolphinscheduler" is recommended 22 | resource.upload.path=/dolphinscheduler 23 | 24 | # user data local directory path, please make sure the directory exists and have read write permissions 25 | #data.basedir.path=/tmp/dolphinscheduler 26 | 27 | # whether kerberos starts 28 | hadoop.security.authentication.startup.state=false 29 | 30 | # java.security.krb5.conf path 31 | java.security.krb5.conf.path=/opt/krb5.conf 32 | 33 | # login user from keytab username 34 | login.user.keytab.username=hdfs-mycluster@ESZ.COM 35 | 36 | # login user from keytab path 37 | login.user.keytab.path=/opt/hdfs.headless.keytab 38 | 39 | #resource.view.suffixs 40 | #resource.view.suffixs=txt,log,sh,bat,conf,cfg,py,java,sql,xml,hql,properties,json,yml,yaml,ini,js 41 | 42 | # if resource.storage.type=HDFS, the user need to have permission to create directories under the HDFS root path 43 | hdfs.root.user=hdfs 44 | 45 | # if resource.storage.type=S3, the value like: s3a://dolphinscheduler; if resource.storage.type=HDFS, When namenode HA is enabled, you need to copy core-site.xml and hdfs-site.xml to conf dir 46 | fs.defaultFS=hdfs://mycluster:8020 47 | 48 | # if resource.storage.type=S3, s3 endpoint 49 | fs.s3a.endpoint=http://192.168.xx.xx:9010 50 | 51 | # if resource.storage.type=S3, s3 access key 52 | fs.s3a.access.key=A3DXS30FO22544RE 53 | 54 | # if resource.storage.type=S3, s3 secret key 55 | fs.s3a.secret.key=OloCLq3n+8+sdPHUhJ21XrSxTC+JK 56 | 57 | # if resourcemanager HA enable, please type the HA ips ; if resourcemanager is single, make this value empty 58 | yarn.resourcemanager.ha.rm.ids=192.168.xx.xx,192.168.xx.xx 59 | 60 | # if resourcemanager HA enable or not use resourcemanager, please keep the default value; If resourcemanager is single, you only need to replace ds1 to actual resourcemanager hostname. 61 | yarn.application.status.address=http://10.172.33.1:%s/ws/v1/cluster/apps/%s 62 | 63 | # if custom you resourcemanager port ,you need to replace 8088 else default value. 64 | resource.manager.httpaddress.port=8088 65 | 66 | # job history status url when application number threshold is reached(default 10000,maybe it was set to 1000) 67 | yarn.job.history.status.address=http://ds1:19888/ws/v1/history/mapreduce/jobs/%s 68 | 69 | # system env path, If you want to set your own path, you need to set this env file to an absolute path 70 | #dolphinscheduler.env.path=env/dolphinscheduler_env.sh 71 | development.state=false 72 | 73 | # kerberos tgt expire time, unit is hours 74 | kerberos.expire.time=2 75 | 76 | # datasource encryption salt 77 | datasource.encryption.enable=false 78 | datasource.encryption.salt=!@#$%^&* 79 | 80 | # Network IP gets priority, default inner outer 81 | #dolphin.scheduler.network.priority.strategy=default 82 | 83 | # use sudo or not, if set true ,executing user is tenant user and deploy user need sudo permissions ; if set false, executing user is the deploy user, don't need sudo permissions. 84 | sudo.enable=true 85 | -------------------------------------------------------------------------------- /zhili-report/zhili-report-dao/src/main/java/com/niezhili/dataplatform/monitor/dao/entity/ProjectUser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.monitor.dao.entity; 18 | 19 | import com.baomidou.mybatisplus.annotation.IdType; 20 | import com.baomidou.mybatisplus.annotation.TableField; 21 | import com.baomidou.mybatisplus.annotation.TableId; 22 | import com.baomidou.mybatisplus.annotation.TableName; 23 | 24 | import java.util.Date; 25 | 26 | @TableName("t_ds_relation_project_user") 27 | public class ProjectUser { 28 | /** 29 | * id 30 | */ 31 | @TableId(value="id", type=IdType.AUTO) 32 | private int id; 33 | 34 | @TableField("user_id") 35 | private int userId; 36 | 37 | @TableField("project_id") 38 | private int projectId; 39 | 40 | /** 41 | * project name 42 | */ 43 | @TableField(exist = false) 44 | private String projectName; 45 | 46 | /** 47 | * user name 48 | */ 49 | @TableField(exist = false) 50 | private String userName; 51 | 52 | /** 53 | * permission 54 | */ 55 | private int perm; 56 | 57 | @TableField("create_time") 58 | private Date createTime; 59 | 60 | @TableField("update_time") 61 | private Date updateTime; 62 | 63 | public int getId() { 64 | return id; 65 | } 66 | 67 | public void setId(int id) { 68 | this.id = id; 69 | } 70 | 71 | public int getUserId() { 72 | return userId; 73 | } 74 | 75 | public void setUserId(int userId) { 76 | this.userId = userId; 77 | } 78 | 79 | public int getProjectId() { 80 | return projectId; 81 | } 82 | 83 | public void setProjectId(int projectId) { 84 | this.projectId = projectId; 85 | } 86 | 87 | public Date getCreateTime() { 88 | return createTime; 89 | } 90 | 91 | public void setCreateTime(Date createTime) { 92 | this.createTime = createTime; 93 | } 94 | 95 | public Date getUpdateTime() { 96 | return updateTime; 97 | } 98 | 99 | public void setUpdateTime(Date updateTime) { 100 | this.updateTime = updateTime; 101 | } 102 | 103 | public String getProjectName() { 104 | return projectName; 105 | } 106 | 107 | public void setProjectName(String projectName) { 108 | this.projectName = projectName; 109 | } 110 | 111 | public String getUserName() { 112 | return userName; 113 | } 114 | 115 | public void setUserName(String userName) { 116 | this.userName = userName; 117 | } 118 | 119 | public int getPerm() { 120 | return perm; 121 | } 122 | 123 | public void setPerm(int perm) { 124 | this.perm = perm; 125 | } 126 | 127 | @Override 128 | public String toString() { 129 | return "ProjectUser{" 130 | + "id=" + id 131 | + ", userId=" + userId 132 | + ", projectId=" + projectId 133 | + ", projectName='" + projectName + '\'' 134 | + ", userName='" + userName + '\'' 135 | + ", perm=" + perm 136 | + ", createTime=" + createTime 137 | + ", updateTime=" + updateTime 138 | + '}'; 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /zhili-metadata/zhili-metadata-dao/src/main/java/com/niezhili/dataplatform/metadata/dao/entity/ProjectUser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.metadata.dao.entity; 18 | 19 | import com.baomidou.mybatisplus.annotation.IdType; 20 | import com.baomidou.mybatisplus.annotation.TableField; 21 | import com.baomidou.mybatisplus.annotation.TableId; 22 | import com.baomidou.mybatisplus.annotation.TableName; 23 | 24 | import java.util.Date; 25 | 26 | @TableName("t_ds_relation_project_user") 27 | public class ProjectUser { 28 | /** 29 | * id 30 | */ 31 | @TableId(value="id", type=IdType.AUTO) 32 | private int id; 33 | 34 | @TableField("user_id") 35 | private int userId; 36 | 37 | @TableField("project_id") 38 | private int projectId; 39 | 40 | /** 41 | * project name 42 | */ 43 | @TableField(exist = false) 44 | private String projectName; 45 | 46 | /** 47 | * user name 48 | */ 49 | @TableField(exist = false) 50 | private String userName; 51 | 52 | /** 53 | * permission 54 | */ 55 | private int perm; 56 | 57 | @TableField("create_time") 58 | private Date createTime; 59 | 60 | @TableField("update_time") 61 | private Date updateTime; 62 | 63 | public int getId() { 64 | return id; 65 | } 66 | 67 | public void setId(int id) { 68 | this.id = id; 69 | } 70 | 71 | public int getUserId() { 72 | return userId; 73 | } 74 | 75 | public void setUserId(int userId) { 76 | this.userId = userId; 77 | } 78 | 79 | public int getProjectId() { 80 | return projectId; 81 | } 82 | 83 | public void setProjectId(int projectId) { 84 | this.projectId = projectId; 85 | } 86 | 87 | public Date getCreateTime() { 88 | return createTime; 89 | } 90 | 91 | public void setCreateTime(Date createTime) { 92 | this.createTime = createTime; 93 | } 94 | 95 | public Date getUpdateTime() { 96 | return updateTime; 97 | } 98 | 99 | public void setUpdateTime(Date updateTime) { 100 | this.updateTime = updateTime; 101 | } 102 | 103 | public String getProjectName() { 104 | return projectName; 105 | } 106 | 107 | public void setProjectName(String projectName) { 108 | this.projectName = projectName; 109 | } 110 | 111 | public String getUserName() { 112 | return userName; 113 | } 114 | 115 | public void setUserName(String userName) { 116 | this.userName = userName; 117 | } 118 | 119 | public int getPerm() { 120 | return perm; 121 | } 122 | 123 | public void setPerm(int perm) { 124 | this.perm = perm; 125 | } 126 | 127 | @Override 128 | public String toString() { 129 | return "ProjectUser{" 130 | + "id=" + id 131 | + ", userId=" + userId 132 | + ", projectId=" + projectId 133 | + ", projectName='" + projectName + '\'' 134 | + ", userName='" + userName + '\'' 135 | + ", perm=" + perm 136 | + ", createTime=" + createTime 137 | + ", updateTime=" + updateTime 138 | + '}'; 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /zhili-dataservice/zhili-dataservice-dao/src/main/java/com/niezhili/dataplatform/dataservice/dao/entity/ProjectUser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.niezhili.dataplatform.dataservice.dao.entity; 18 | 19 | import com.baomidou.mybatisplus.annotation.IdType; 20 | import com.baomidou.mybatisplus.annotation.TableField; 21 | import com.baomidou.mybatisplus.annotation.TableId; 22 | import com.baomidou.mybatisplus.annotation.TableName; 23 | 24 | import java.util.Date; 25 | 26 | @TableName("t_ds_relation_project_user") 27 | public class ProjectUser { 28 | /** 29 | * id 30 | */ 31 | @TableId(value="id", type=IdType.AUTO) 32 | private int id; 33 | 34 | @TableField("user_id") 35 | private int userId; 36 | 37 | @TableField("project_id") 38 | private int projectId; 39 | 40 | /** 41 | * project name 42 | */ 43 | @TableField(exist = false) 44 | private String projectName; 45 | 46 | /** 47 | * user name 48 | */ 49 | @TableField(exist = false) 50 | private String userName; 51 | 52 | /** 53 | * permission 54 | */ 55 | private int perm; 56 | 57 | @TableField("create_time") 58 | private Date createTime; 59 | 60 | @TableField("update_time") 61 | private Date updateTime; 62 | 63 | public int getId() { 64 | return id; 65 | } 66 | 67 | public void setId(int id) { 68 | this.id = id; 69 | } 70 | 71 | public int getUserId() { 72 | return userId; 73 | } 74 | 75 | public void setUserId(int userId) { 76 | this.userId = userId; 77 | } 78 | 79 | public int getProjectId() { 80 | return projectId; 81 | } 82 | 83 | public void setProjectId(int projectId) { 84 | this.projectId = projectId; 85 | } 86 | 87 | public Date getCreateTime() { 88 | return createTime; 89 | } 90 | 91 | public void setCreateTime(Date createTime) { 92 | this.createTime = createTime; 93 | } 94 | 95 | public Date getUpdateTime() { 96 | return updateTime; 97 | } 98 | 99 | public void setUpdateTime(Date updateTime) { 100 | this.updateTime = updateTime; 101 | } 102 | 103 | public String getProjectName() { 104 | return projectName; 105 | } 106 | 107 | public void setProjectName(String projectName) { 108 | this.projectName = projectName; 109 | } 110 | 111 | public String getUserName() { 112 | return userName; 113 | } 114 | 115 | public void setUserName(String userName) { 116 | this.userName = userName; 117 | } 118 | 119 | public int getPerm() { 120 | return perm; 121 | } 122 | 123 | public void setPerm(int perm) { 124 | this.perm = perm; 125 | } 126 | 127 | @Override 128 | public String toString() { 129 | return "ProjectUser{" 130 | + "id=" + id 131 | + ", userId=" + userId 132 | + ", projectId=" + projectId 133 | + ", projectName='" + projectName + '\'' 134 | + ", userName='" + userName + '\'' 135 | + ", perm=" + perm 136 | + ", createTime=" + createTime 137 | + ", updateTime=" + updateTime 138 | + '}'; 139 | } 140 | } 141 | --------------------------------------------------------------------------------