refactor() 拆分数据源,规则引擎模块 三层框架
parent
dd456647dc
commit
0558149969
|
@ -9,7 +9,7 @@
|
||||||
<version>3.6.3</version>
|
<version>3.6.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>etl-modules-data-source-system</artifactId>
|
<artifactId>etl-modules-data-source-server</artifactId>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
|
@ -14,7 +14,7 @@
|
||||||
<modules>
|
<modules>
|
||||||
<module>etl-modules-data-source-common</module>
|
<module>etl-modules-data-source-common</module>
|
||||||
<module>etl-modules-data-source-remote</module>
|
<module>etl-modules-data-source-remote</module>
|
||||||
<module>etl-modules-data-source-system</module>
|
<module>etl-modules-data-source-server</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.etl</groupId>
|
||||||
|
<artifactId>etl-modules-rule-engine</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>etl-modules-rule-engine-common</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.etl</groupId>
|
||||||
|
<artifactId>etl-common-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -1,4 +1,4 @@
|
||||||
package com.etl.data.rule.domain;
|
package com.etl.rule.engine.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.etl.data.rule.domain;
|
package com.etl.rule.engine.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
|
@ -1,9 +1,9 @@
|
||||||
package com.etl.data.rule.domain.resp;
|
package com.etl.rule.engine.domain.resp;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.etl.data.rule.domain.EngineRule;
|
import com.etl.rule.engine.domain.EngineRule;
|
||||||
import com.etl.data.rule.domain.EngineRuleVersion;
|
import com.etl.rule.engine.domain.EngineRuleVersion;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.etl</groupId>
|
||||||
|
<artifactId>etl-modules-rule-engine</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>etl-modules-rule-engine-remote</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.etl</groupId>
|
||||||
|
<artifactId>etl-modules-rule-engine-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,88 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.etl</groupId>
|
||||||
|
<artifactId>etl-modules-rule-engine</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>etl-modules-rule-engine-server</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- SpringCloud Alibaba Nacos -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Nacos Config -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Sentinel -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringBoot Actuator -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Swagger UI -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-swagger-ui</artifactId>
|
||||||
|
<version>${swagger.fox.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Mysql Connector -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- ETL Common DataSource -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.etl</groupId>
|
||||||
|
<artifactId>etl-common-datasource</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- ETL Common DataScope -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.etl</groupId>
|
||||||
|
<artifactId>etl-common-datascope</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- ETL Common Log -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.etl</groupId>
|
||||||
|
<artifactId>etl-common-log</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- ETL Common Swagger -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.etl</groupId>
|
||||||
|
<artifactId>etl-common-swagger</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.etl</groupId>
|
||||||
|
<artifactId>etl-modules-rule-engine-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.etl.rule;
|
||||||
|
|
||||||
|
import com.etl.common.security.annotation.EnableCustomConfig;
|
||||||
|
import com.etl.common.security.annotation.EnableMyFeignClients;
|
||||||
|
import com.etl.common.swagger.annotation.EnableCustomSwagger2;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据源模块
|
||||||
|
*
|
||||||
|
* @author Chao
|
||||||
|
*/
|
||||||
|
@EnableCustomConfig
|
||||||
|
@EnableCustomSwagger2
|
||||||
|
@EnableMyFeignClients
|
||||||
|
@SpringBootApplication
|
||||||
|
@EnableAsync
|
||||||
|
public class ETLRuleEngineApplication {
|
||||||
|
public static void main (String[] args) {
|
||||||
|
SpringApplication.run(ETLRuleEngineApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.etl.data.rule.classLoading;
|
package com.etl.rule.engine.classLoading;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类加载器
|
* 类加载器
|
|
@ -1,4 +1,4 @@
|
||||||
package com.etl.data.rule.controller;
|
package com.etl.rule.engine.controller;
|
||||||
|
|
||||||
import com.etl.common.core.domain.Result;
|
import com.etl.common.core.domain.Result;
|
||||||
import com.etl.common.core.utils.poi.ExcelUtil;
|
import com.etl.common.core.utils.poi.ExcelUtil;
|
||||||
|
@ -7,9 +7,9 @@ import com.etl.common.core.web.page.TableDataInfo;
|
||||||
import com.etl.common.log.annotation.Log;
|
import com.etl.common.log.annotation.Log;
|
||||||
import com.etl.common.log.enums.BusinessType;
|
import com.etl.common.log.enums.BusinessType;
|
||||||
import com.etl.common.security.annotation.RequiresPermissions;
|
import com.etl.common.security.annotation.RequiresPermissions;
|
||||||
import com.etl.data.rule.domain.EngineRule;
|
import com.etl.rule.engine.domain.EngineRule;
|
||||||
import com.etl.data.rule.domain.resp.EngineRuleAndEngineRuleVersionResp;
|
import com.etl.rule.engine.domain.resp.EngineRuleAndEngineRuleVersionResp;
|
||||||
import com.etl.data.rule.service.IEngineRuleService;
|
import com.etl.rule.engine.service.IEngineRuleService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ public class EngineRuleController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 查询引擎维护列表
|
* 查询引擎维护列表
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("data:engine:list")
|
@RequiresPermissions("rule:engine:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public Result<TableDataInfo<EngineRule>> list(EngineRule engineRule) {
|
public Result<TableDataInfo<EngineRule>> list(EngineRule engineRule) {
|
||||||
startPage();
|
startPage();
|
||||||
|
@ -43,7 +43,7 @@ public class EngineRuleController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 导出引擎维护列表
|
* 导出引擎维护列表
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("data:engine:export")
|
@RequiresPermissions("rule:engine:export")
|
||||||
@Log(title = "引擎维护", businessType = BusinessType.EXPORT)
|
@Log(title = "引擎维护", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, EngineRule engineRule) {
|
public void export(HttpServletResponse response, EngineRule engineRule) {
|
||||||
|
@ -55,7 +55,7 @@ public class EngineRuleController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 获取引擎维护详细信息
|
* 获取引擎维护详细信息
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("data:engine:query")
|
@RequiresPermissions("rule:engine:query")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public Result getInfo(@PathVariable("id") Long id) {
|
public Result getInfo(@PathVariable("id") Long id) {
|
||||||
return success(engineRuleService.selectEngineRuleById(id));
|
return success(engineRuleService.selectEngineRuleById(id));
|
||||||
|
@ -64,7 +64,7 @@ public class EngineRuleController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 新增引擎维护
|
* 新增引擎维护
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("data:engine:add")
|
@RequiresPermissions("rule:engine:add")
|
||||||
@Log(title = "引擎维护", businessType = BusinessType.INSERT)
|
@Log(title = "引擎维护", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Result add(@RequestBody EngineRule engineRule) {
|
public Result add(@RequestBody EngineRule engineRule) {
|
||||||
|
@ -74,7 +74,7 @@ public class EngineRuleController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 修改引擎维护
|
* 修改引擎维护
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("data:engine:edit")
|
@RequiresPermissions("rule:engine:edit")
|
||||||
@Log(title = "引擎维护", businessType = BusinessType.UPDATE)
|
@Log(title = "引擎维护", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public Result edit(@RequestBody EngineRule engineRule) {
|
public Result edit(@RequestBody EngineRule engineRule) {
|
||||||
|
@ -84,7 +84,7 @@ public class EngineRuleController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 删除引擎维护
|
* 删除引擎维护
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("data:engine:remove")
|
@RequiresPermissions("rule:engine:remove")
|
||||||
@Log(title = "引擎维护", businessType = BusinessType.DELETE)
|
@Log(title = "引擎维护", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public Result remove(@PathVariable Long[] ids) {
|
public Result remove(@PathVariable Long[] ids) {
|
||||||
|
@ -96,7 +96,7 @@ public class EngineRuleController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 修改引擎维护激活
|
* 修改引擎维护激活
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("data:engine:editActivatedOrNot")
|
@RequiresPermissions("rule:engine:editActivatedOrNot")
|
||||||
@Log(title = "引擎维护", businessType = BusinessType.UPDATE)
|
@Log(title = "引擎维护", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/editActivatedOrNot")
|
@PutMapping("/editActivatedOrNot")
|
||||||
public Result editActivatedOrNot(@RequestBody EngineRule engineRule) {
|
public Result editActivatedOrNot(@RequestBody EngineRule engineRule) {
|
||||||
|
@ -106,7 +106,7 @@ public class EngineRuleController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 修改引擎维护激活
|
* 修改引擎维护激活
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("data:engine:editStatus")
|
@RequiresPermissions("rule:engine:editStatus")
|
||||||
@Log(title = "引擎维护", businessType = BusinessType.UPDATE)
|
@Log(title = "引擎维护", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/editStatus")
|
@PutMapping("/editStatus")
|
||||||
public Result editStatus(@RequestBody EngineRule engineRule) {
|
public Result editStatus(@RequestBody EngineRule engineRule) {
|
||||||
|
@ -118,7 +118,7 @@ public class EngineRuleController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 获取引擎维护详细信息和版本列表
|
* 获取引擎维护详细信息和版本列表
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("data:engine:queryEngineAndEngineVersion")
|
@RequiresPermissions("rule:engine:queryEngineAndEngineVersion")
|
||||||
@GetMapping(value = "queryEngineAndEngineVersion/{id}")
|
@GetMapping(value = "queryEngineAndEngineVersion/{id}")
|
||||||
public Result<EngineRuleAndEngineRuleVersionResp> queryEngineAndEngineVersion(@PathVariable("id") Long id) {
|
public Result<EngineRuleAndEngineRuleVersionResp> queryEngineAndEngineVersion(@PathVariable("id") Long id) {
|
||||||
return Result.success(engineRuleService.queryEngineAndEngineVersion(id));
|
return Result.success(engineRuleService.queryEngineAndEngineVersion(id));
|
|
@ -1,11 +1,11 @@
|
||||||
package com.etl.data.rule.controller;
|
package com.etl.rule.engine.controller;
|
||||||
|
|
||||||
import com.etl.common.core.domain.Result;
|
import com.etl.common.core.domain.Result;
|
||||||
import com.etl.common.log.annotation.Log;
|
import com.etl.common.log.annotation.Log;
|
||||||
import com.etl.common.log.enums.BusinessType;
|
import com.etl.common.log.enums.BusinessType;
|
||||||
import com.etl.common.security.annotation.RequiresPermissions;
|
import com.etl.common.security.annotation.RequiresPermissions;
|
||||||
import com.etl.data.rule.domain.EngineRuleVersion;
|
import com.etl.rule.engine.domain.EngineRuleVersion;
|
||||||
import com.etl.data.rule.service.IEngineRuleVersionService;
|
import com.etl.rule.engine.service.IEngineRuleVersionService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ public class EngineRuleVersionController {
|
||||||
/**
|
/**
|
||||||
* 新增引擎维护版本
|
* 新增引擎维护版本
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("data:engineVersion:add")
|
@RequiresPermissions("rule:engineVersion:add")
|
||||||
@Log(title = "引擎维护版本", businessType = BusinessType.INSERT)
|
@Log(title = "引擎维护版本", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Result add(@RequestBody EngineRuleVersion engineRuleVersion) {
|
public Result add(@RequestBody EngineRuleVersion engineRuleVersion) {
|
||||||
|
@ -37,7 +37,7 @@ public class EngineRuleVersionController {
|
||||||
/**
|
/**
|
||||||
* 修改引擎维护版本数据
|
* 修改引擎维护版本数据
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("data:engine:edit")
|
@RequiresPermissions("rule:engine:edit")
|
||||||
@Log(title = "引擎维护版本", businessType = BusinessType.UPDATE)
|
@Log(title = "引擎维护版本", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public Result editStatus(@RequestBody EngineRuleVersion engineRuleVersion) {
|
public Result editStatus(@RequestBody EngineRuleVersion engineRuleVersion) {
|
|
@ -1,7 +1,7 @@
|
||||||
package com.etl.data.rule.mapper;
|
package com.etl.rule.engine.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.etl.data.rule.domain.EngineRule;
|
import com.etl.rule.engine.domain.EngineRule;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.etl.data.rule.mapper;
|
package com.etl.rule.engine.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.etl.data.rule.domain.EngineRuleVersion;
|
import com.etl.rule.engine.domain.EngineRuleVersion;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 引擎维护Mapper接口
|
* 引擎维护Mapper接口
|
|
@ -1,4 +1,4 @@
|
||||||
package com.etl.data.rule.scope;
|
package com.etl.rule.engine.scope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: Chao
|
* @Author: Chao
|
|
@ -1,4 +1,4 @@
|
||||||
package com.etl.data.rule.scope;
|
package com.etl.rule.engine.scope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: Chao
|
* @Author: Chao
|
|
@ -1,4 +1,4 @@
|
||||||
package com.etl.data.rule.scope;
|
package com.etl.rule.engine.scope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: Chao
|
* @Author: Chao
|
|
@ -1,4 +1,4 @@
|
||||||
package com.etl.data.rule.scope;
|
package com.etl.rule.engine.scope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: Chao
|
* @Author: Chao
|
|
@ -1,9 +1,10 @@
|
||||||
package com.etl.data.rule.service;
|
package com.etl.rule.engine.service;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.etl.common.core.domain.Result;
|
import com.etl.common.core.domain.Result;
|
||||||
import com.etl.data.rule.domain.EngineRule;
|
import com.etl.rule.engine.domain.EngineRule;
|
||||||
import com.etl.data.rule.domain.resp.EngineRuleAndEngineRuleVersionResp;
|
import com.etl.rule.engine.domain.resp.EngineRuleAndEngineRuleVersionResp;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.etl.data.rule.service;
|
package com.etl.rule.engine.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.etl.data.rule.domain.EngineRuleVersion;
|
import com.etl.rule.engine.domain.EngineRuleVersion;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 引擎维护版本Service接口
|
* 引擎维护版本Service接口
|
|
@ -1,16 +1,17 @@
|
||||||
package com.etl.data.rule.service.impl;
|
package com.etl.rule.engine.service.impl;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.etl.common.core.domain.Result;
|
import com.etl.common.core.domain.Result;
|
||||||
import com.etl.common.core.utils.DateUtils;
|
import com.etl.common.core.utils.DateUtils;
|
||||||
import com.etl.data.rule.domain.EngineRule;
|
import com.etl.rule.engine.domain.EngineRule;
|
||||||
import com.etl.data.rule.domain.EngineRuleVersion;
|
import com.etl.rule.engine.domain.EngineRuleVersion;
|
||||||
import com.etl.data.rule.domain.resp.EngineRuleAndEngineRuleVersionResp;
|
import com.etl.rule.engine.domain.resp.EngineRuleAndEngineRuleVersionResp;
|
||||||
import com.etl.data.rule.mapper.EngineRuleMapper;
|
import com.etl.rule.engine.mapper.EngineRuleMapper;
|
||||||
import com.etl.data.rule.service.IEngineRuleService;
|
import com.etl.rule.engine.service.IEngineRuleService;
|
||||||
import com.etl.data.rule.service.IEngineRuleVersionService;
|
import com.etl.rule.engine.service.IEngineRuleVersionService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@ -36,6 +37,7 @@ import java.util.stream.Collectors;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class EngineRuleServiceImpl extends ServiceImpl<EngineRuleMapper, EngineRule> implements IEngineRuleService {
|
public class EngineRuleServiceImpl extends ServiceImpl<EngineRuleMapper, EngineRule> implements IEngineRuleService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private EngineRuleMapper engineRuleMapper;
|
private EngineRuleMapper engineRuleMapper;
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
package com.etl.data.rule.service.impl;
|
package com.etl.rule.engine.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.etl.data.rule.domain.EngineRuleVersion;
|
import com.etl.rule.engine.domain.EngineRuleVersion;
|
||||||
import com.etl.data.rule.mapper.EngineRuleVersionMapper;
|
import com.etl.rule.engine.mapper.EngineRuleVersionMapper;
|
||||||
import com.etl.data.rule.service.IEngineRuleVersionService;
|
import com.etl.rule.engine.service.IEngineRuleVersionService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 引擎维护版本Service业务层处理
|
* 引擎维护版本Service业务层处理
|
||||||
*
|
*
|
|
@ -1,4 +1,4 @@
|
||||||
package com.etl.data.rule.utils;
|
package com.etl.rule.engine.utils;
|
||||||
|
|
||||||
import javax.tools.JavaCompiler;
|
import javax.tools.JavaCompiler;
|
||||||
import javax.tools.JavaFileObject;
|
import javax.tools.JavaFileObject;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.etl.data.rule.utils;
|
package com.etl.rule.engine.utils;
|
||||||
|
|
||||||
|
|
||||||
import javax.tools.*;
|
import javax.tools.*;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.etl.data.rule.utils;
|
package com.etl.rule.engine.utils;
|
||||||
|
|
||||||
import javax.tools.SimpleJavaFileObject;
|
import javax.tools.SimpleJavaFileObject;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
|
@ -0,0 +1,2 @@
|
||||||
|
Spring Boot Version: ${spring-boot.version}
|
||||||
|
Spring Application Name: ${spring.application.name}
|
|
@ -0,0 +1,35 @@
|
||||||
|
# Tomcat
|
||||||
|
server:
|
||||||
|
port: 9303
|
||||||
|
|
||||||
|
# Spring
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: etl-rule-engine
|
||||||
|
profiles:
|
||||||
|
# 环境配置
|
||||||
|
active: dev
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: 192.168.23.133:8848
|
||||||
|
# 命名空间
|
||||||
|
namespace: etl
|
||||||
|
config:
|
||||||
|
# 配置中心地址
|
||||||
|
server-addr: 192.168.23.133:8848
|
||||||
|
# 命名空间
|
||||||
|
namespace: etl
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
# 主启动类 允许循环依赖
|
||||||
|
main:
|
||||||
|
allow-circular-references: true
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
com.etl.system.mapper: DEBUG
|
|
@ -0,0 +1,74 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||||
|
<!-- 日志存放路径 -->
|
||||||
|
<property name="log.path" value="logs/etl-system"/>
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统日志输出 -->
|
||||||
|
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/info.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>INFO</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/error.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>ERROR</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统模块日志级别控制 -->
|
||||||
|
<logger name="com.etl" level="info"/>
|
||||||
|
<!-- Spring日志级别控制 -->
|
||||||
|
<logger name="org.springframework" level="warn"/>
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="console"/>
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!--系统操作日志-->
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="file_info"/>
|
||||||
|
<appender-ref ref="file_error"/>
|
||||||
|
</root>
|
||||||
|
</configuration>
|
|
@ -2,9 +2,9 @@
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.etl.data.rule.mapper.EngineRuleMapper">
|
<mapper namespace="com.etl.rule.engine.mapper.EngineRuleMapper">
|
||||||
|
|
||||||
<resultMap type="com.etl.data.rule.domain.EngineRule" id="EngineRuleResult">
|
<resultMap type="com.etl.rule.engine.domain.EngineRule" id="EngineRuleResult">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
<result property="name" column="name" />
|
<result property="name" column="name" />
|
||||||
<result property="type" column="type" />
|
<result property="type" column="type" />
|
||||||
|
@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
select id, name, type, scope, encoding, activated_or_not, status, description, remark, code_text, create_by, create_time, update_by, update_time from engine_rule
|
select id, name, type, scope, encoding, activated_or_not, status, description, remark, code_text, create_by, create_time, update_by, update_time from engine_rule
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectEngineRuleList" parameterType="com.etl.data.rule.domain.EngineRule" resultMap="EngineRuleResult">
|
<select id="selectEngineRuleList" parameterType="com.etl.rule.engine.domain.EngineRule" resultMap="EngineRuleResult">
|
||||||
<include refid="selectEngineRuleVo"/>
|
<include refid="selectEngineRuleVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||||
|
@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertEngineRule" parameterType="com.etl.data.rule.domain.EngineRule" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertEngineRule" parameterType="com.etl.rule.engine.domain.EngineRule" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into engine_rule
|
insert into engine_rule
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="name != null">name,</if>
|
<if test="name != null">name,</if>
|
||||||
|
@ -75,7 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateEngineRule" parameterType="com.etl.data.rule.domain.EngineRule">
|
<update id="updateEngineRule" parameterType="com.etl.rule.engine.domain.EngineRule">
|
||||||
update engine_rule
|
update engine_rule
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="name != null">name = #{name},</if>
|
<if test="name != null">name = #{name},</if>
|
|
@ -0,0 +1,29 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.etl</groupId>
|
||||||
|
<artifactId>etl-modules</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>etl-modules-rule-engine</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<modules>
|
||||||
|
<module>etl-modules-rule-engine-common</module>
|
||||||
|
<module>etl-modules-rule-engine-remote</module>
|
||||||
|
<module>etl-modules-rule-engine-server</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
<description>
|
||||||
|
etl-modules-rule-engine 规则引擎模块
|
||||||
|
</description>
|
||||||
|
|
||||||
|
</project>
|
|
@ -14,6 +14,7 @@
|
||||||
<module>etl-modules-job</module>
|
<module>etl-modules-job</module>
|
||||||
<module>etl-modules-file</module>
|
<module>etl-modules-file</module>
|
||||||
<module>etl-modules-data-source</module>
|
<module>etl-modules-data-source</module>
|
||||||
|
<module>etl-modules-rule-engine</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<artifactId>etl-modules</artifactId>
|
<artifactId>etl-modules</artifactId>
|
||||||
|
|
14
pom.xml
14
pom.xml
|
@ -222,6 +222,20 @@
|
||||||
<version>${etl.version}</version>
|
<version>${etl.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 规则引擎模块 公共依赖-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.etl</groupId>
|
||||||
|
<artifactId>etl-modules-rule-engine-common</artifactId>
|
||||||
|
<version>${etl.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 规则引擎模块 远程依赖-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.etl</groupId>
|
||||||
|
<artifactId>etl-modules-rule-engine-remote</artifactId>
|
||||||
|
<version>${etl.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>redis.clients</groupId>
|
<groupId>redis.clients</groupId>
|
||||||
<artifactId>jedis</artifactId>
|
<artifactId>jedis</artifactId>
|
||||||
|
|
Loading…
Reference in New Issue